Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit15f7f5a

Browse files
committed
rum from617ae05 commit
1 parentc7fffac commit15f7f5a

File tree

4 files changed

+200
-204
lines changed

4 files changed

+200
-204
lines changed

‎contrib/rum/expected/altorder_1.out

Lines changed: 53 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
CREATE TABLE atsts (id int, t tsvector, d timestamp);
22
\copy atsts from 'data/tsts.data'
3-
CREATE INDEX atsts_idx ON atsts USING rum (trum_tsvector_timestamp_ops, d)
3+
CREATE INDEX atsts_idx ON atsts USING rum (trum_tsvector_addon_ops, d)
44
WITH (attach = 'd', to = 't', order_by_attach='t');
5-
ERROR: currently, RUM doesn't support order by over pass-by-reference column
65
INSERT INTO atsts VALUES (-1, 't1 t2', '2016-05-02 02:24:22.326724');
76
INSERT INTO atsts VALUES (-2, 't1 t2 t3', '2016-05-02 02:26:22.326724');
87
SELECT count(*) FROM atsts WHERE t @@ 'wr|qh';
@@ -119,12 +118,14 @@ RESET enable_bitmapscan;
119118
SET enable_seqscan = off;
120119
EXPLAIN (costs off)
121120
SELECT count(*) FROM atsts WHERE t @@ 'wr|qh';
122-
QUERY PLAN
123-
---------------------------------------------------
121+
QUERY PLAN
122+
-------------------------------------------------------------
124123
Aggregate
125-
-> Seq Scan on atsts
126-
Filter: (t @@ '''wr'' | ''qh'''::tsquery)
127-
(3 rows)
124+
-> Bitmap Heap Scan on atsts
125+
Recheck Cond: (t @@ '''wr'' | ''qh'''::tsquery)
126+
-> Bitmap Index Scan on atsts_idx
127+
Index Cond: (t @@ '''wr'' | ''qh'''::tsquery)
128+
(5 rows)
128129

129130
SELECT count(*) FROM atsts WHERE t @@ 'wr|qh';
130131
count
@@ -164,12 +165,14 @@ SELECT count(*) FROM atsts WHERE t @@ '(eq|yt)&(wr|qh)';
164165

165166
EXPLAIN (costs off)
166167
SELECT count(*) FROM atsts WHERE d < '2016-05-16 14:21:25';
167-
QUERY PLAN
168-
-------------------------------------------------------------------------------
168+
QUERY PLAN
169+
-----------------------------------------------------------------------------------------
169170
Aggregate
170-
-> Seq Scan on atsts
171-
Filter: (d < 'Mon May 16 14:21:25 2016'::timestamp without time zone)
172-
(3 rows)
171+
-> Bitmap Heap Scan on atsts
172+
Recheck Cond: (d < 'Mon May 16 14:21:25 2016'::timestamp without time zone)
173+
-> Bitmap Index Scan on atsts_idx
174+
Index Cond: (d < 'Mon May 16 14:21:25 2016'::timestamp without time zone)
175+
(5 rows)
173176

174177
SELECT count(*) FROM atsts WHERE d < '2016-05-16 14:21:25';
175178
count
@@ -179,12 +182,14 @@ SELECT count(*) FROM atsts WHERE d < '2016-05-16 14:21:25';
179182

180183
EXPLAIN (costs off)
181184
SELECT count(*) FROM atsts WHERE d > '2016-05-16 14:21:25';
182-
QUERY PLAN
183-
-------------------------------------------------------------------------------
185+
QUERY PLAN
186+
-----------------------------------------------------------------------------------------
184187
Aggregate
185-
-> Seq Scan on atsts
186-
Filter: (d > 'Mon May 16 14:21:25 2016'::timestamp without time zone)
187-
(3 rows)
188+
-> Bitmap Heap Scan on atsts
189+
Recheck Cond: (d > 'Mon May 16 14:21:25 2016'::timestamp without time zone)
190+
-> Bitmap Index Scan on atsts_idx
191+
Index Cond: (d > 'Mon May 16 14:21:25 2016'::timestamp without time zone)
192+
(5 rows)
188193

189194
SELECT count(*) FROM atsts WHERE d > '2016-05-16 14:21:25';
190195
count
@@ -194,63 +199,59 @@ SELECT count(*) FROM atsts WHERE d > '2016-05-16 14:21:25';
194199

195200
EXPLAIN (costs off)
196201
SELECT id, d, d <=> '2016-05-16 14:21:25' FROM atsts WHERE t @@ 'wr&qh' ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
197-
QUERY PLAN
198-
-------------------------------------------------------------------------------------
202+
QUERY PLAN
203+
-----------------------------------------------------------------------------------
199204
Limit
200-
-> Sort
201-
Sort Key: ((d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone))
202-
-> Seq Scan on atsts
203-
Filter: (t @@ '''wr'' & ''qh'''::tsquery)
204-
(5 rows)
205+
-> Index Scan using atsts_idx on atsts
206+
Index Cond: (t @@ '''wr'' & ''qh'''::tsquery)
207+
Order By: (d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
208+
(4 rows)
205209

206210
SELECT id, d, d <=> '2016-05-16 14:21:25' FROM atsts WHERE t @@ 'wr&qh' ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
207211
ERROR: doesn't support order by over pass-by-reference column
208212
EXPLAIN (costs off)
209213
SELECT id, d, d <=| '2016-05-16 14:21:25' FROM atsts WHERE t @@ 'wr&qh' ORDER BY d <=| '2016-05-16 14:21:25' LIMIT 5;
210-
QUERY PLAN
211-
-------------------------------------------------------------------------------------
214+
QUERY PLAN
215+
-----------------------------------------------------------------------------------
212216
Limit
213-
-> Sort
214-
Sort Key: ((d <=| 'Mon May 16 14:21:25 2016'::timestamp without time zone))
215-
-> Seq Scan on atsts
216-
Filter: (t @@ '''wr'' & ''qh'''::tsquery)
217-
(5 rows)
217+
-> Index Scan using atsts_idx on atsts
218+
Index Cond: (t @@ '''wr'' & ''qh'''::tsquery)
219+
Order By: (d <=| 'Mon May 16 14:21:25 2016'::timestamp without time zone)
220+
(4 rows)
218221

219222
SELECT id, d, d <=| '2016-05-16 14:21:25' FROM atsts WHERE t @@ 'wr&qh' ORDER BY d <=| '2016-05-16 14:21:25' LIMIT 5;
220223
ERROR: doesn't support order by over pass-by-reference column
221224
EXPLAIN (costs off)
222225
SELECT id, d, d |=> '2016-05-16 14:21:25' FROM atsts WHERE t @@ 'wr&qh' ORDER BY d |=> '2016-05-16 14:21:25' LIMIT 5;
223-
QUERY PLAN
224-
-------------------------------------------------------------------------------------
226+
QUERY PLAN
227+
-----------------------------------------------------------------------------------
225228
Limit
226-
-> Sort
227-
Sort Key: ((d |=> 'Mon May 16 14:21:25 2016'::timestamp without time zone))
228-
-> Seq Scan on atsts
229-
Filter: (t @@ '''wr'' & ''qh'''::tsquery)
230-
(5 rows)
229+
-> Index Scan using atsts_idx on atsts
230+
Index Cond: (t @@ '''wr'' & ''qh'''::tsquery)
231+
Order By: (d |=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
232+
(4 rows)
231233

232234
SELECT id, d, d |=> '2016-05-16 14:21:25' FROM atsts WHERE t @@ 'wr&qh' ORDER BY d |=> '2016-05-16 14:21:25' LIMIT 5;
233235
ERROR: doesn't support order by over pass-by-reference column
234236
EXPLAIN (costs off)
235237
SELECT id, d, d <=> '2016-05-16 14:21:25' FROM atsts ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
236-
QUERY PLAN
237-
-------------------------------------------------------------------------------------
238+
QUERY PLAN
239+
-----------------------------------------------------------------------------------
238240
Limit
239-
-> Sort
240-
Sort Key: ((d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone))
241-
-> Seq Scan on atsts
242-
(4 rows)
241+
-> Index Scan using atsts_idx on atsts
242+
Order By: (d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
243+
(3 rows)
243244

244245
SELECT id, d, d <=> '2016-05-16 14:21:25' FROM atsts ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
245246
ERROR: doesn't support order by over pass-by-reference column
246247
EXPLAIN (costs off)
247248
SELECT id, d FROM atsts WHERE t @@ 'wr&qh' AND d <= '2016-05-16 14:21:25' ORDER BY d;
248-
QUERY PLAN
249-
------------------------------------------------------------------------------------------------------------------------
249+
QUERY PLAN
250+
----------------------------------------------------------------------------------------------------------------------------
250251
Sort
251252
Sort Key: d
252-
->Seq Scan on atsts
253-
Filter: ((t @@ '''wr'' & ''qh'''::tsquery) AND (d <= 'Mon May 16 14:21:25 2016'::timestamp without time zone))
253+
->Index Scan using atsts_idx on atsts
254+
Index Cond: ((t @@ '''wr'' & ''qh'''::tsquery) AND (d <= 'Mon May 16 14:21:25 2016'::timestamp without time zone))
254255
(4 rows)
255256

256257
SELECT id, d FROM atsts WHERE t @@ 'wr&qh' AND d <= '2016-05-16 14:21:25' ORDER BY d;
@@ -269,12 +270,12 @@ SELECT id, d FROM atsts WHERE t @@ 'wr&qh' AND d <= '2016-05-16 14:21:25' ORDER
269270

270271
EXPLAIN (costs off)
271272
SELECT id, d FROM atsts WHERE t @@ 'wr&qh' AND d >= '2016-05-16 14:21:25' ORDER BY d;
272-
QUERY PLAN
273-
------------------------------------------------------------------------------------------------------------------------
273+
QUERY PLAN
274+
----------------------------------------------------------------------------------------------------------------------------
274275
Sort
275276
Sort Key: d
276-
->Seq Scan on atsts
277-
Filter: ((t @@ '''wr'' & ''qh'''::tsquery) AND (d >= 'Mon May 16 14:21:25 2016'::timestamp without time zone))
277+
->Index Scan using atsts_idx on atsts
278+
Index Cond: ((t @@ '''wr'' & ''qh'''::tsquery) AND (d >= 'Mon May 16 14:21:25 2016'::timestamp without time zone))
278279
(4 rows)
279280

280281
SELECT id, d FROM atsts WHERE t @@ 'wr&qh' AND d >= '2016-05-16 14:21:25' ORDER BY d;

‎contrib/rum/expected/altorder_hash_1.out

Lines changed: 53 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
CREATE TABLE atstsh (id int, t tsvector, d timestamp);
22
\copy atstsh from 'data/tsts.data'
3-
CREATE INDEX atstsh_idx ON atstsh USING rum (trum_tsvector_hash_timestamp_ops, d)
3+
CREATE INDEX atstsh_idx ON atstsh USING rum (trum_tsvector_hash_addon_ops, d)
44
WITH (attach = 'd', to = 't', order_by_attach='t');
5-
ERROR: currently, RUM doesn't support order by over pass-by-reference column
65
INSERT INTO atstsh VALUES (-1, 't1 t2', '2016-05-02 02:24:22.326724');
76
INSERT INTO atstsh VALUES (-2, 't1 t2 t3', '2016-05-02 02:26:22.326724');
87
SELECT count(*) FROM atstsh WHERE t @@ 'wr|qh';
@@ -119,12 +118,14 @@ RESET enable_bitmapscan;
119118
SET enable_seqscan = off;
120119
EXPLAIN (costs off)
121120
SELECT count(*) FROM atstsh WHERE t @@ 'wr|qh';
122-
QUERY PLAN
123-
---------------------------------------------------
121+
QUERY PLAN
122+
-------------------------------------------------------------
124123
Aggregate
125-
-> Seq Scan on atstsh
126-
Filter: (t @@ '''wr'' | ''qh'''::tsquery)
127-
(3 rows)
124+
-> Bitmap Heap Scan on atstsh
125+
Recheck Cond: (t @@ '''wr'' | ''qh'''::tsquery)
126+
-> Bitmap Index Scan on atstsh_idx
127+
Index Cond: (t @@ '''wr'' | ''qh'''::tsquery)
128+
(5 rows)
128129

129130
SELECT count(*) FROM atstsh WHERE t @@ 'wr|qh';
130131
count
@@ -164,12 +165,14 @@ SELECT count(*) FROM atstsh WHERE t @@ '(eq|yt)&(wr|qh)';
164165

165166
EXPLAIN (costs off)
166167
SELECT count(*) FROM atstsh WHERE d < '2016-05-16 14:21:25';
167-
QUERY PLAN
168-
-------------------------------------------------------------------------------
168+
QUERY PLAN
169+
-----------------------------------------------------------------------------------------
169170
Aggregate
170-
-> Seq Scan on atstsh
171-
Filter: (d < 'Mon May 16 14:21:25 2016'::timestamp without time zone)
172-
(3 rows)
171+
-> Bitmap Heap Scan on atstsh
172+
Recheck Cond: (d < 'Mon May 16 14:21:25 2016'::timestamp without time zone)
173+
-> Bitmap Index Scan on atstsh_idx
174+
Index Cond: (d < 'Mon May 16 14:21:25 2016'::timestamp without time zone)
175+
(5 rows)
173176

174177
SELECT count(*) FROM atstsh WHERE d < '2016-05-16 14:21:25';
175178
count
@@ -179,12 +182,14 @@ SELECT count(*) FROM atstsh WHERE d < '2016-05-16 14:21:25';
179182

180183
EXPLAIN (costs off)
181184
SELECT count(*) FROM atstsh WHERE d > '2016-05-16 14:21:25';
182-
QUERY PLAN
183-
-------------------------------------------------------------------------------
185+
QUERY PLAN
186+
-----------------------------------------------------------------------------------------
184187
Aggregate
185-
-> Seq Scan on atstsh
186-
Filter: (d > 'Mon May 16 14:21:25 2016'::timestamp without time zone)
187-
(3 rows)
188+
-> Bitmap Heap Scan on atstsh
189+
Recheck Cond: (d > 'Mon May 16 14:21:25 2016'::timestamp without time zone)
190+
-> Bitmap Index Scan on atstsh_idx
191+
Index Cond: (d > 'Mon May 16 14:21:25 2016'::timestamp without time zone)
192+
(5 rows)
188193

189194
SELECT count(*) FROM atstsh WHERE d > '2016-05-16 14:21:25';
190195
count
@@ -194,63 +199,59 @@ SELECT count(*) FROM atstsh WHERE d > '2016-05-16 14:21:25';
194199

195200
EXPLAIN (costs off)
196201
SELECT id, d, d <=> '2016-05-16 14:21:25' FROM atstsh WHERE t @@ 'wr&qh' ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
197-
QUERY PLAN
198-
-------------------------------------------------------------------------------------
202+
QUERY PLAN
203+
-----------------------------------------------------------------------------------
199204
Limit
200-
-> Sort
201-
Sort Key: ((d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone))
202-
-> Seq Scan on atstsh
203-
Filter: (t @@ '''wr'' & ''qh'''::tsquery)
204-
(5 rows)
205+
-> Index Scan using atstsh_idx on atstsh
206+
Index Cond: (t @@ '''wr'' & ''qh'''::tsquery)
207+
Order By: (d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
208+
(4 rows)
205209

206210
SELECT id, d, d <=> '2016-05-16 14:21:25' FROM atstsh WHERE t @@ 'wr&qh' ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
207211
ERROR: doesn't support order by over pass-by-reference column
208212
EXPLAIN (costs off)
209213
SELECT id, d, d <=| '2016-05-16 14:21:25' FROM atstsh WHERE t @@ 'wr&qh' ORDER BY d <=| '2016-05-16 14:21:25' LIMIT 5;
210-
QUERY PLAN
211-
-------------------------------------------------------------------------------------
214+
QUERY PLAN
215+
-----------------------------------------------------------------------------------
212216
Limit
213-
-> Sort
214-
Sort Key: ((d <=| 'Mon May 16 14:21:25 2016'::timestamp without time zone))
215-
-> Seq Scan on atstsh
216-
Filter: (t @@ '''wr'' & ''qh'''::tsquery)
217-
(5 rows)
217+
-> Index Scan using atstsh_idx on atstsh
218+
Index Cond: (t @@ '''wr'' & ''qh'''::tsquery)
219+
Order By: (d <=| 'Mon May 16 14:21:25 2016'::timestamp without time zone)
220+
(4 rows)
218221

219222
SELECT id, d, d <=| '2016-05-16 14:21:25' FROM atstsh WHERE t @@ 'wr&qh' ORDER BY d <=| '2016-05-16 14:21:25' LIMIT 5;
220223
ERROR: doesn't support order by over pass-by-reference column
221224
EXPLAIN (costs off)
222225
SELECT id, d, d |=> '2016-05-16 14:21:25' FROM atstsh WHERE t @@ 'wr&qh' ORDER BY d |=> '2016-05-16 14:21:25' LIMIT 5;
223-
QUERY PLAN
224-
-------------------------------------------------------------------------------------
226+
QUERY PLAN
227+
-----------------------------------------------------------------------------------
225228
Limit
226-
-> Sort
227-
Sort Key: ((d |=> 'Mon May 16 14:21:25 2016'::timestamp without time zone))
228-
-> Seq Scan on atstsh
229-
Filter: (t @@ '''wr'' & ''qh'''::tsquery)
230-
(5 rows)
229+
-> Index Scan using atstsh_idx on atstsh
230+
Index Cond: (t @@ '''wr'' & ''qh'''::tsquery)
231+
Order By: (d |=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
232+
(4 rows)
231233

232234
SELECT id, d, d |=> '2016-05-16 14:21:25' FROM atstsh WHERE t @@ 'wr&qh' ORDER BY d |=> '2016-05-16 14:21:25' LIMIT 5;
233235
ERROR: doesn't support order by over pass-by-reference column
234236
EXPLAIN (costs off)
235237
SELECT id, d, d <=> '2016-05-16 14:21:25' FROM atstsh ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
236-
QUERY PLAN
237-
-------------------------------------------------------------------------------------
238+
QUERY PLAN
239+
-----------------------------------------------------------------------------------
238240
Limit
239-
-> Sort
240-
Sort Key: ((d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone))
241-
-> Seq Scan on atstsh
242-
(4 rows)
241+
-> Index Scan using atstsh_idx on atstsh
242+
Order By: (d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
243+
(3 rows)
243244

244245
SELECT id, d, d <=> '2016-05-16 14:21:25' FROM atstsh ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
245246
ERROR: doesn't support order by over pass-by-reference column
246247
EXPLAIN (costs off)
247248
SELECT id, d FROM atstsh WHERE t @@ 'wr&qh' AND d <= '2016-05-16 14:21:25' ORDER BY d;
248-
QUERY PLAN
249-
------------------------------------------------------------------------------------------------------------------------
249+
QUERY PLAN
250+
----------------------------------------------------------------------------------------------------------------------------
250251
Sort
251252
Sort Key: d
252-
->Seq Scan on atstsh
253-
Filter: ((t @@ '''wr'' & ''qh'''::tsquery) AND (d <= 'Mon May 16 14:21:25 2016'::timestamp without time zone))
253+
->Index Scan using atstsh_idx on atstsh
254+
Index Cond: ((t @@ '''wr'' & ''qh'''::tsquery) AND (d <= 'Mon May 16 14:21:25 2016'::timestamp without time zone))
254255
(4 rows)
255256

256257
SELECT id, d FROM atstsh WHERE t @@ 'wr&qh' AND d <= '2016-05-16 14:21:25' ORDER BY d;
@@ -269,12 +270,12 @@ SELECT id, d FROM atstsh WHERE t @@ 'wr&qh' AND d <= '2016-05-16 14:21:25' ORDE
269270

270271
EXPLAIN (costs off)
271272
SELECT id, d FROM atstsh WHERE t @@ 'wr&qh' AND d >= '2016-05-16 14:21:25' ORDER BY d;
272-
QUERY PLAN
273-
------------------------------------------------------------------------------------------------------------------------
273+
QUERY PLAN
274+
----------------------------------------------------------------------------------------------------------------------------
274275
Sort
275276
Sort Key: d
276-
->Seq Scan on atstsh
277-
Filter: ((t @@ '''wr'' & ''qh'''::tsquery) AND (d >= 'Mon May 16 14:21:25 2016'::timestamp without time zone))
277+
->Index Scan using atstsh_idx on atstsh
278+
Index Cond: ((t @@ '''wr'' & ''qh'''::tsquery) AND (d >= 'Mon May 16 14:21:25 2016'::timestamp without time zone))
278279
(4 rows)
279280

280281
SELECT id, d FROM atstsh WHERE t @@ 'wr&qh' AND d >= '2016-05-16 14:21:25' ORDER BY d;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp