@@ -27,63 +27,68 @@ CREATE TABLE tbl_gistkey (
27
27
);
28
28
CREATE INDEX cidx_circle ON tbl_gistkey USING gist (c);
29
29
ALTER TABLE tbl_gistkey CLUSTER ON cidx_circle;
30
+ --
31
+ -- insert data
32
+ --
30
33
INSERT INTO tbl_cluster VALUES(1, '2008-12-31 10:00:00', 'admin');
31
34
INSERT INTO tbl_cluster VALUES(2, '2008-01-01 00:00:00', 'king');
32
35
INSERT INTO tbl_cluster VALUES(3, '2008-03-04 12:00:00', 'joker');
33
36
INSERT INTO tbl_cluster VALUES(4, '2008-03-05 15:00:00', 'queen');
34
37
INSERT INTO tbl_cluster VALUES(5, '2008-01-01 00:30:00', sqrt(2::numeric(1000,999))::text || sqrt(3::numeric(1000,999))::text);
38
+ INSERT INTO tbl_only_pkey VALUES(1, 'abc');
39
+ INSERT INTO tbl_only_pkey VALUES(2, 'def');
40
+ INSERT INTO tbl_only_ckey VALUES(1, '2008-01-01 00:00:00', 'abc');
41
+ INSERT INTO tbl_only_ckey VALUES(2, '2008-02-01 00:00:00', 'def');
42
+ INSERT INTO tbl_gistkey VALUES(1, '<(1,2),3>');
43
+ INSERT INTO tbl_gistkey VALUES(2, '<(4,5),6>');
35
44
--
36
45
-- do reorg
37
46
--
47
+ \! pg_reorg --dbname=contrib_regression --no-order
48
+ \! pg_reorg --dbname=contrib_regression
38
49
\! pg_reorg --dbname=contrib_regression --table=tbl_cluster
39
50
--
40
51
-- results
41
52
--
42
- \d+ tbl_cluster
43
- Table "public.tbl_cluster"
44
- Column | Type | Modifiers | Storage | Description
45
- --------+-----------------------------+-----------+----------+-------------
46
- col1 | integer | not null | plain |
47
- col2 | timestamp without time zone | | plain |
48
- :-) | text | not null | extended |
53
+ \d tbl_cluster
54
+ Table "public.tbl_cluster"
55
+ Column | Type | Modifiers
56
+ --------+-----------------------------+-----------
57
+ col1 | integer | not null
58
+ col2 | timestamp without time zone |
59
+ :-) | text | not null
49
60
Indexes:
50
61
"tbl_cluster_pkey" PRIMARY KEY, btree (":-)", col1)
51
62
"cidx_cluster" btree (col2, length(":-)")) CLUSTER
52
- Has OIDs: no
53
- Options: fillfactor=70
54
63
55
- \d+ tbl_gistkey
56
- Table "public.tbl_gistkey"
57
- Column | Type | Modifiers | Storage | Description
58
- --------+---------+-----------+---------+-------------
59
- id | integer | not null | plain |
60
- c | circle | | plain |
64
+ \d tbl_gistkey
65
+ Table "public.tbl_gistkey"
66
+ Column | Type | Modifiers
67
+ --------+---------+-----------
68
+ id | integer | not null
69
+ c | circle |
61
70
Indexes:
62
71
"tbl_gistkey_pkey" PRIMARY KEY, btree (id)
63
72
"cidx_circle" gist (c) CLUSTER
64
- Has OIDs: no
65
73
66
- \d+ tbl_only_ckey
67
- Table "public.tbl_only_ckey"
68
- Column | Type | Modifiers | Storage | Description
69
- --------+-----------------------------+-----------+----------+-------------
70
- col1 | integer | | plain |
71
- col2 | timestamp without time zone | | plain |
72
- :-) | text | | extended |
74
+ \d tbl_only_ckey
75
+ Table "public.tbl_only_ckey"
76
+ Column | Type | Modifiers
77
+ --------+-----------------------------+-----------
78
+ col1 | integer |
79
+ col2 | timestamp without time zone |
80
+ :-) | text |
73
81
Indexes:
74
82
"cidx_only_ckey" btree (col2, ":-)") CLUSTER
75
- Has OIDs: no
76
- Options: fillfactor=70
77
83
78
- \d+ tbl_only_pkey
79
- Table "public.tbl_only_pkey"
80
- Column | Type | Modifiers | Storage | Description
81
- --------+---------+-----------+----------+-------------
82
- col1 | integer | not null | plain |
83
- :-) | text | | extended |
84
+ \d tbl_only_pkey
85
+ Table "public.tbl_only_pkey"
86
+ Column | Type | Modifiers
87
+ --------+---------+-----------
88
+ col1 | integer | not null
89
+ :-) | text |
84
90
Indexes:
85
91
"tbl_only_pkey_pkey" PRIMARY KEY, btree (col1)
86
- Has OIDs: no
87
92
88
93
SET synchronize_seqscans = off;
89
94
SELECT col1, to_char(col2, 'YYYY-MM-DD HH24:MI:SS'), ":-)" FROM tbl_cluster;
@@ -96,27 +101,33 @@ SELECT col1, to_char(col2, 'YYYY-MM-DD HH24:MI:SS'), ":-)" FROM tbl_cluster;
96
101
1 | 2008-12-31 10:00:00 | admin
97
102
(5 rows)
98
103
99
- SELECT * FROM tbl_gistkey;
100
- id | c
101
- ----+---
102
- (0 rows)
103
-
104
- SELECT * FROM tbl_only_ckey;
105
- col1 | col2 | :-)
106
- ------+------+-----
107
- (0 rows)
104
+ SELECT * FROM tbl_only_ckey ORDER BY 1;
105
+ col1 | col2 | :-)
106
+ ------+--------------------------+-----
107
+ 1 | Tue Jan 01 00:00:00 2008 | abc
108
+ 2 | Fri Feb 01 00:00:00 2008 | def
109
+ (2 rows)
108
110
109
- SELECT * FROM tbl_only_pkey;
111
+ SELECT * FROM tbl_only_pkey ORDER BY 1 ;
110
112
col1 | :-)
111
113
------+-----
112
- (0 rows)
114
+ 1 | abc
115
+ 2 | def
116
+ (2 rows)
117
+
118
+ SELECT * FROM tbl_gistkey ORDER BY 1;
119
+ id | c
120
+ ----+-----------
121
+ 1 | <(1,2),3>
122
+ 2 | <(4,5),6>
123
+ (2 rows)
113
124
114
125
RESET synchronize_seqscans;
115
126
--
116
127
-- clean up
117
128
--
118
129
DROP TABLE tbl_cluster;
119
- DROP TABLE tbl_gistkey;
120
130
DROP TABLE tbl_only_pkey;
121
131
DROP TABLE tbl_only_ckey;
132
+ DROP TABLE tbl_gistkey;
122
133
RESET client_min_messages;
0 commit comments