@@ -125,16 +125,18 @@ SELECT id FROM test_text_o WHERE t @@ 'wr&qh' AND id >= '400' ORDER BY id;
125125(8 rows)
126126
127127CREATE TABLE test_text_a AS SELECT id::text, t FROM tsts;
128+ -- Should fail, temporarly it isn't allowed to order an index over pass-by-reference column
128129CREATE INDEX test_text_a_idx ON test_text_a USING rum
129130 (t rum_tsvector_addon_ops, id)
130131 WITH (attach = 'id', to = 't', order_by_attach='t');
132+ ERROR: doesn't support order index over pass-by-reference column
131133EXPLAIN (costs off)
132134SELECT count(*) FROM test_text_a WHERE id < '400';
133- QUERY PLAN
134- -------------------------------------------------------
135+ QUERY PLAN
136+ ------------------------------------
135137 Aggregate
136- -> Index Scan using test_text_a_idx on test_text_a
137- Index Cond : (id < '400'::text)
138+ -> Seq Scan on test_text_a
139+ Filter : (id < '400'::text)
138140(3 rows)
139141
140142SELECT count(*) FROM test_text_a WHERE id < '400';
@@ -145,12 +147,12 @@ SELECT count(*) FROM test_text_a WHERE id < '400';
145147
146148EXPLAIN (costs off)
147149SELECT id FROM test_text_a WHERE t @@ 'wr&qh' AND id <= '400' ORDER BY id;
148- QUERY PLAN
149- ---------------------------------------------------------------------------------
150+ QUERY PLAN
151+ -----------------------------------------------------------------------------
150152 Sort
151153 Sort Key: id
152- -> Index Scan using test_text_a_idx on test_text_a
153- Index Cond : ((t @@ '''wr'' & ''qh'''::tsquery) AND (id <= '400'::text))
154+ -> Seq Scan on test_text_a
155+ Filter : ((t @@ '''wr'' & ''qh'''::tsquery) AND (id <= '400'::text))
154156(4 rows)
155157
156158SELECT id FROM test_text_a WHERE t @@ 'wr&qh' AND id <= '400' ORDER BY id;
@@ -169,12 +171,12 @@ SELECT id FROM test_text_a WHERE t @@ 'wr&qh' AND id <= '400' ORDER BY id;
169171
170172EXPLAIN (costs off)
171173SELECT id FROM test_text_a WHERE t @@ 'wr&qh' AND id >= '400' ORDER BY id;
172- QUERY PLAN
173- ---------------------------------------------------------------------------------
174+ QUERY PLAN
175+ -----------------------------------------------------------------------------
174176 Sort
175177 Sort Key: id
176- -> Index Scan using test_text_a_idx on test_text_a
177- Index Cond : ((t @@ '''wr'' & ''qh'''::tsquery) AND (id >= '400'::text))
178+ -> Seq Scan on test_text_a
179+ Filter : ((t @@ '''wr'' & ''qh'''::tsquery) AND (id >= '400'::text))
178180(4 rows)
179181
180182SELECT id FROM test_text_a WHERE t @@ 'wr&qh' AND id >= '400' ORDER BY id;
@@ -242,16 +244,18 @@ SELECT id FROM test_text_h_o WHERE t @@ 'wr&qh' AND id >= '400' ORDER BY id;
242244(8 rows)
243245
244246CREATE TABLE test_text_h_a AS SELECT id::text, t FROM tsts;
247+ -- Should fail, temporarly it isn't allowed to order an index over pass-by-reference column
245248CREATE INDEX test_text_h_a_idx ON test_text_h_a USING rum
246249 (t rum_tsvector_hash_addon_ops, id)
247250 WITH (attach = 'id', to = 't', order_by_attach='t');
251+ ERROR: doesn't support order index over pass-by-reference column
248252EXPLAIN (costs off)
249253SELECT count(*) FROM test_text_h_a WHERE id < '400';
250- QUERY PLAN
251- -----------------------------------------------------------
254+ QUERY PLAN
255+ ------------------------------------
252256 Aggregate
253- -> Index Scan using test_text_h_a_idx on test_text_h_a
254- Index Cond : (id < '400'::text)
257+ -> Seq Scan on test_text_h_a
258+ Filter : (id < '400'::text)
255259(3 rows)
256260
257261SELECT count(*) FROM test_text_h_a WHERE id < '400';
@@ -262,12 +266,12 @@ SELECT count(*) FROM test_text_h_a WHERE id < '400';
262266
263267EXPLAIN (costs off)
264268SELECT id FROM test_text_h_a WHERE t @@ 'wr&qh' AND id <= '400' ORDER BY id;
265- QUERY PLAN
266- ---------------------------------------------------------------------------------
269+ QUERY PLAN
270+ -----------------------------------------------------------------------------
267271 Sort
268272 Sort Key: id
269- -> Index Scan using test_text_h_a_idx on test_text_h_a
270- Index Cond : ((t @@ '''wr'' & ''qh'''::tsquery) AND (id <= '400'::text))
273+ -> Seq Scan on test_text_h_a
274+ Filter : ((t @@ '''wr'' & ''qh'''::tsquery) AND (id <= '400'::text))
271275(4 rows)
272276
273277SELECT id FROM test_text_h_a WHERE t @@ 'wr&qh' AND id <= '400' ORDER BY id;
@@ -286,12 +290,12 @@ SELECT id FROM test_text_h_a WHERE t @@ 'wr&qh' AND id <= '400' ORDER BY id;
286290
287291EXPLAIN (costs off)
288292SELECT id FROM test_text_h_a WHERE t @@ 'wr&qh' AND id >= '400' ORDER BY id;
289- QUERY PLAN
290- ---------------------------------------------------------------------------------
293+ QUERY PLAN
294+ -----------------------------------------------------------------------------
291295 Sort
292296 Sort Key: id
293- -> Index Scan using test_text_h_a_idx on test_text_h_a
294- Index Cond : ((t @@ '''wr'' & ''qh'''::tsquery) AND (id >= '400'::text))
297+ -> Seq Scan on test_text_h_a
298+ Filter : ((t @@ '''wr'' & ''qh'''::tsquery) AND (id >= '400'::text))
295299(4 rows)
296300
297301SELECT id FROM test_text_h_a WHERE t @@ 'wr&qh' AND id >= '400' ORDER BY id;
0 commit comments