4 CREATE TABLE quad_point_tbl AS
5 SELECT point(unique1,unique2) AS p FROM tenk1;
6 INSERT INTO quad_point_tbl
7 SELECT '(333.0,400.0)'::point FROM generate_series(1,1000);
8 INSERT INTO quad_point_tbl VALUES (NULL), (NULL), (NULL);
9 CREATE INDEX sp_quad_ind ON quad_point_tbl USING spgist (p);
10 CREATE TABLE kd_point_tbl AS SELECT * FROM quad_point_tbl;
11 CREATE INDEX sp_kd_ind ON kd_point_tbl USING spgist (p kd_point_ops);
12 CREATE TABLE radix_text_tbl AS
13 SELECT name AS t FROM road WHERE name !~ '^[0-9]';
14 INSERT INTO radix_text_tbl
15 SELECT 'P0123456789abcdef' FROM generate_series(1,1000);
16 INSERT INTO radix_text_tbl VALUES ('P0123456789abcde');
17 INSERT INTO radix_text_tbl VALUES ('P0123456789abcdefF');
18 CREATE INDEX sp_radix_ind ON radix_text_tbl USING spgist (t);
19 -- get non-indexed results for comparison purposes
20 SET enable_seqscan = ON;
21 SET enable_indexscan = OFF;
22 SET enable_bitmapscan = OFF;
23 SELECT count(*) FROM quad_point_tbl WHERE p IS NULL;
29 SELECT count(*) FROM quad_point_tbl WHERE p IS NOT NULL;
35 SELECT count(*) FROM quad_point_tbl;
41 SELECT count(*) FROM quad_point_tbl WHERE p <@ box '(200,200,1000,1000)';
47 SELECT count(*) FROM quad_point_tbl WHERE box '(200,200,1000,1000)' @> p;
53 SELECT count(*) FROM quad_point_tbl WHERE p << '(5000, 4000)';
59 SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)';
65 SELECT count(*) FROM quad_point_tbl WHERE p <<| '(5000, 4000)';
71 SELECT count(*) FROM quad_point_tbl WHERE p |>> '(5000, 4000)';
77 SELECT count(*) FROM quad_point_tbl WHERE p ~= '(4585, 365)';
83 CREATE TEMP TABLE quad_point_tbl_ord_seq1 AS
84 SELECT row_number() OVER (ORDER BY p <-> '0,0') n, p <-> '0,0' dist, p
86 CREATE TEMP TABLE quad_point_tbl_ord_seq2 AS
87 SELECT row_number() OVER (ORDER BY p <-> '0,0') n, p <-> '0,0' dist, p
88 FROM quad_point_tbl WHERE p <@ box '(200,200,1000,1000)';
89 CREATE TEMP TABLE quad_point_tbl_ord_seq3 AS
90 SELECT row_number() OVER (ORDER BY p <-> '333,400') n, p <-> '333,400' dist, p
91 FROM quad_point_tbl WHERE p IS NOT NULL;
92 SELECT count(*) FROM radix_text_tbl WHERE t = 'P0123456789abcdef';
98 SELECT count(*) FROM radix_text_tbl WHERE t = 'P0123456789abcde';
104 SELECT count(*) FROM radix_text_tbl WHERE t = 'P0123456789abcdefF';
110 SELECT count(*) FROM radix_text_tbl WHERE t < 'Aztec Ct ';
116 SELECT count(*) FROM radix_text_tbl WHERE t ~<~ 'Aztec Ct ';
122 SELECT count(*) FROM radix_text_tbl WHERE t <= 'Aztec Ct ';
128 SELECT count(*) FROM radix_text_tbl WHERE t ~<=~ 'Aztec Ct ';
134 SELECT count(*) FROM radix_text_tbl WHERE t = 'Aztec Ct ';
140 SELECT count(*) FROM radix_text_tbl WHERE t = 'Worth St ';
146 SELECT count(*) FROM radix_text_tbl WHERE t >= 'Worth St ';
152 SELECT count(*) FROM radix_text_tbl WHERE t ~>=~ 'Worth St ';
158 SELECT count(*) FROM radix_text_tbl WHERE t > 'Worth St ';
164 SELECT count(*) FROM radix_text_tbl WHERE t ~>~ 'Worth St ';
170 SELECT count(*) FROM radix_text_tbl WHERE t ^@ 'Worth';
176 -- Now check the results from plain indexscan
177 SET enable_seqscan = OFF;
178 SET enable_indexscan = ON;
179 SET enable_bitmapscan = OFF;
181 SELECT count(*) FROM quad_point_tbl WHERE p IS NULL;
183 -----------------------------------------------------------
185 -> Index Only Scan using sp_quad_ind on quad_point_tbl
186 Index Cond: (p IS NULL)
189 SELECT count(*) FROM quad_point_tbl WHERE p IS NULL;
196 SELECT count(*) FROM quad_point_tbl WHERE p IS NOT NULL;
198 -----------------------------------------------------------
200 -> Index Only Scan using sp_quad_ind on quad_point_tbl
201 Index Cond: (p IS NOT NULL)
204 SELECT count(*) FROM quad_point_tbl WHERE p IS NOT NULL;
211 SELECT count(*) FROM quad_point_tbl;
213 -----------------------------------------------------------
215 -> Index Only Scan using sp_quad_ind on quad_point_tbl
218 SELECT count(*) FROM quad_point_tbl;
225 SELECT count(*) FROM quad_point_tbl WHERE p <@ box '(200,200,1000,1000)';
227 -----------------------------------------------------------
229 -> Index Only Scan using sp_quad_ind on quad_point_tbl
230 Index Cond: (p <@ '(1000,1000),(200,200)'::box)
233 SELECT count(*) FROM quad_point_tbl WHERE p <@ box '(200,200,1000,1000)';
240 SELECT count(*) FROM quad_point_tbl WHERE box '(200,200,1000,1000)' @> p;
242 -----------------------------------------------------------
244 -> Index Only Scan using sp_quad_ind on quad_point_tbl
245 Index Cond: (p <@ '(1000,1000),(200,200)'::box)
248 SELECT count(*) FROM quad_point_tbl WHERE box '(200,200,1000,1000)' @> p;
255 SELECT count(*) FROM quad_point_tbl WHERE p << '(5000, 4000)';
257 -----------------------------------------------------------
259 -> Index Only Scan using sp_quad_ind on quad_point_tbl
260 Index Cond: (p << '(5000,4000)'::point)
263 SELECT count(*) FROM quad_point_tbl WHERE p << '(5000, 4000)';
270 SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)';
272 -----------------------------------------------------------
274 -> Index Only Scan using sp_quad_ind on quad_point_tbl
275 Index Cond: (p >> '(5000,4000)'::point)
278 SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)';
285 SELECT count(*) FROM quad_point_tbl WHERE p <<| '(5000, 4000)';
287 -----------------------------------------------------------
289 -> Index Only Scan using sp_quad_ind on quad_point_tbl
290 Index Cond: (p <<| '(5000,4000)'::point)
293 SELECT count(*) FROM quad_point_tbl WHERE p <<| '(5000, 4000)';
300 SELECT count(*) FROM quad_point_tbl WHERE p |>> '(5000, 4000)';
302 -----------------------------------------------------------
304 -> Index Only Scan using sp_quad_ind on quad_point_tbl
305 Index Cond: (p |>> '(5000,4000)'::point)
308 SELECT count(*) FROM quad_point_tbl WHERE p |>> '(5000, 4000)';
315 SELECT count(*) FROM quad_point_tbl WHERE p ~= '(4585, 365)';
317 -----------------------------------------------------------
319 -> Index Only Scan using sp_quad_ind on quad_point_tbl
320 Index Cond: (p ~= '(4585,365)'::point)
323 SELECT count(*) FROM quad_point_tbl WHERE p ~= '(4585, 365)';
330 SELECT row_number() OVER (ORDER BY p <-> '0,0') n, p <-> '0,0' dist, p
333 -----------------------------------------------------------
335 -> Index Only Scan using sp_quad_ind on quad_point_tbl
336 Order By: (p <-> '(0,0)'::point)
339 CREATE TEMP TABLE quad_point_tbl_ord_idx1 AS
340 SELECT row_number() OVER (ORDER BY p <-> '0,0') n, p <-> '0,0' dist, p
342 SELECT * FROM quad_point_tbl_ord_seq1 seq FULL JOIN quad_point_tbl_ord_idx1 idx
344 WHERE seq.dist IS DISTINCT FROM idx.dist;
345 n | dist | p | n | dist | p
346 ---+------+---+---+------+---
350 SELECT row_number() OVER (ORDER BY p <-> '0,0') n, p <-> '0,0' dist, p
351 FROM quad_point_tbl WHERE p <@ box '(200,200,1000,1000)';
353 -----------------------------------------------------------
355 -> Index Only Scan using sp_quad_ind on quad_point_tbl
356 Index Cond: (p <@ '(1000,1000),(200,200)'::box)
357 Order By: (p <-> '(0,0)'::point)
360 CREATE TEMP TABLE quad_point_tbl_ord_idx2 AS
361 SELECT row_number() OVER (ORDER BY p <-> '0,0') n, p <-> '0,0' dist, p
362 FROM quad_point_tbl WHERE p <@ box '(200,200,1000,1000)';
363 SELECT * FROM quad_point_tbl_ord_seq2 seq FULL JOIN quad_point_tbl_ord_idx2 idx
365 WHERE seq.dist IS DISTINCT FROM idx.dist;
366 n | dist | p | n | dist | p
367 ---+------+---+---+------+---
371 SELECT row_number() OVER (ORDER BY p <-> '333,400') n, p <-> '333,400' dist, p
372 FROM quad_point_tbl WHERE p IS NOT NULL;
374 -----------------------------------------------------------
376 -> Index Only Scan using sp_quad_ind on quad_point_tbl
377 Index Cond: (p IS NOT NULL)
378 Order By: (p <-> '(333,400)'::point)
381 CREATE TEMP TABLE quad_point_tbl_ord_idx3 AS
382 SELECT row_number() OVER (ORDER BY p <-> '333,400') n, p <-> '333,400' dist, p
383 FROM quad_point_tbl WHERE p IS NOT NULL;
384 SELECT * FROM quad_point_tbl_ord_seq3 seq FULL JOIN quad_point_tbl_ord_idx3 idx
386 WHERE seq.dist IS DISTINCT FROM idx.dist;
387 n | dist | p | n | dist | p
388 ---+------+---+---+------+---
392 SELECT count(*) FROM kd_point_tbl WHERE p <@ box '(200,200,1000,1000)';
394 ---------------------------------------------------------
396 -> Index Only Scan using sp_kd_ind on kd_point_tbl
397 Index Cond: (p <@ '(1000,1000),(200,200)'::box)
400 SELECT count(*) FROM kd_point_tbl WHERE p <@ box '(200,200,1000,1000)';
407 SELECT count(*) FROM kd_point_tbl WHERE box '(200,200,1000,1000)' @> p;
409 ---------------------------------------------------------
411 -> Index Only Scan using sp_kd_ind on kd_point_tbl
412 Index Cond: (p <@ '(1000,1000),(200,200)'::box)
415 SELECT count(*) FROM kd_point_tbl WHERE box '(200,200,1000,1000)' @> p;
422 SELECT count(*) FROM kd_point_tbl WHERE p << '(5000, 4000)';
424 -------------------------------------------------------
426 -> Index Only Scan using sp_kd_ind on kd_point_tbl
427 Index Cond: (p << '(5000,4000)'::point)
430 SELECT count(*) FROM kd_point_tbl WHERE p << '(5000, 4000)';
437 SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)';
439 -------------------------------------------------------
441 -> Index Only Scan using sp_kd_ind on kd_point_tbl
442 Index Cond: (p >> '(5000,4000)'::point)
445 SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)';
452 SELECT count(*) FROM kd_point_tbl WHERE p <<| '(5000, 4000)';
454 -------------------------------------------------------
456 -> Index Only Scan using sp_kd_ind on kd_point_tbl
457 Index Cond: (p <<| '(5000,4000)'::point)
460 SELECT count(*) FROM kd_point_tbl WHERE p <<| '(5000, 4000)';
467 SELECT count(*) FROM kd_point_tbl WHERE p |>> '(5000, 4000)';
469 -------------------------------------------------------
471 -> Index Only Scan using sp_kd_ind on kd_point_tbl
472 Index Cond: (p |>> '(5000,4000)'::point)
475 SELECT count(*) FROM kd_point_tbl WHERE p |>> '(5000, 4000)';
482 SELECT count(*) FROM kd_point_tbl WHERE p ~= '(4585, 365)';
484 -------------------------------------------------------
486 -> Index Only Scan using sp_kd_ind on kd_point_tbl
487 Index Cond: (p ~= '(4585,365)'::point)
490 SELECT count(*) FROM kd_point_tbl WHERE p ~= '(4585, 365)';
497 SELECT row_number() OVER (ORDER BY p <-> '0,0') n, p <-> '0,0' dist, p
500 -------------------------------------------------------
502 -> Index Only Scan using sp_kd_ind on kd_point_tbl
503 Order By: (p <-> '(0,0)'::point)
506 CREATE TEMP TABLE kd_point_tbl_ord_idx1 AS
507 SELECT row_number() OVER (ORDER BY p <-> '0,0') n, p <-> '0,0' dist, p
509 SELECT * FROM quad_point_tbl_ord_seq1 seq FULL JOIN kd_point_tbl_ord_idx1 idx
511 WHERE seq.dist IS DISTINCT FROM idx.dist;
512 n | dist | p | n | dist | p
513 ---+------+---+---+------+---
517 SELECT row_number() OVER (ORDER BY p <-> '0,0') n, p <-> '0,0' dist, p
518 FROM kd_point_tbl WHERE p <@ box '(200,200,1000,1000)';
520 ---------------------------------------------------------
522 -> Index Only Scan using sp_kd_ind on kd_point_tbl
523 Index Cond: (p <@ '(1000,1000),(200,200)'::box)
524 Order By: (p <-> '(0,0)'::point)
527 CREATE TEMP TABLE kd_point_tbl_ord_idx2 AS
528 SELECT row_number() OVER (ORDER BY p <-> '0,0') n, p <-> '0,0' dist, p
529 FROM kd_point_tbl WHERE p <@ box '(200,200,1000,1000)';
530 SELECT * FROM quad_point_tbl_ord_seq2 seq FULL JOIN kd_point_tbl_ord_idx2 idx
532 WHERE seq.dist IS DISTINCT FROM idx.dist;
533 n | dist | p | n | dist | p
534 ---+------+---+---+------+---
538 SELECT row_number() OVER (ORDER BY p <-> '333,400') n, p <-> '333,400' dist, p
539 FROM kd_point_tbl WHERE p IS NOT NULL;
541 -------------------------------------------------------
543 -> Index Only Scan using sp_kd_ind on kd_point_tbl
544 Index Cond: (p IS NOT NULL)
545 Order By: (p <-> '(333,400)'::point)
548 CREATE TEMP TABLE kd_point_tbl_ord_idx3 AS
549 SELECT row_number() OVER (ORDER BY p <-> '333,400') n, p <-> '333,400' dist, p
550 FROM kd_point_tbl WHERE p IS NOT NULL;
551 SELECT * FROM quad_point_tbl_ord_seq3 seq FULL JOIN kd_point_tbl_ord_idx3 idx
553 WHERE seq.dist IS DISTINCT FROM idx.dist;
554 n | dist | p | n | dist | p
555 ---+------+---+---+------+---
558 -- test KNN scan with included columns
559 -- the distance numbers are not exactly the same across platforms
560 SET extra_float_digits = 0;
561 CREATE INDEX ON quad_point_tbl_ord_seq1 USING spgist(p) INCLUDE(dist);
563 SELECT p, dist FROM quad_point_tbl_ord_seq1 ORDER BY p <-> '0,0' LIMIT 10;
565 -------------------------------------------------------------------------------------------
567 -> Index Only Scan using quad_point_tbl_ord_seq1_p_dist_idx on quad_point_tbl_ord_seq1
568 Order By: (p <-> '(0,0)'::point)
571 SELECT p, dist FROM quad_point_tbl_ord_seq1 ORDER BY p <-> '0,0' LIMIT 10;
573 -----------+------------------
574 (59,21) | 62.6258732474047
575 (88,104) | 136.235090927411
576 (39,143) | 148.222805262888
577 (139,160) | 211.945747775227
578 (209,38) | 212.42645786248
579 (157,156) | 221.325552072055
580 (175,150) | 230.488611432322
581 (236,34) | 238.436574375661
582 (263,28) | 264.486294540946
583 (322,53) | 326.33265236565
586 RESET extra_float_digits;
587 -- check ORDER BY distance to NULL
588 SELECT (SELECT p FROM kd_point_tbl ORDER BY p <-> pt, p <-> '0,0' LIMIT 1)
589 FROM (VALUES (point '1,2'), (NULL), ('1234,5678')) pts(pt);
598 SELECT count(*) FROM radix_text_tbl WHERE t = 'P0123456789abcdef';
600 ------------------------------------------------------------
602 -> Index Only Scan using sp_radix_ind on radix_text_tbl
603 Index Cond: (t = 'P0123456789abcdef'::text)
606 SELECT count(*) FROM radix_text_tbl WHERE t = 'P0123456789abcdef';
613 SELECT count(*) FROM radix_text_tbl WHERE t = 'P0123456789abcde';
615 ------------------------------------------------------------
617 -> Index Only Scan using sp_radix_ind on radix_text_tbl
618 Index Cond: (t = 'P0123456789abcde'::text)
621 SELECT count(*) FROM radix_text_tbl WHERE t = 'P0123456789abcde';
628 SELECT count(*) FROM radix_text_tbl WHERE t = 'P0123456789abcdefF';
630 ------------------------------------------------------------
632 -> Index Only Scan using sp_radix_ind on radix_text_tbl
633 Index Cond: (t = 'P0123456789abcdefF'::text)
636 SELECT count(*) FROM radix_text_tbl WHERE t = 'P0123456789abcdefF';
643 SELECT count(*) FROM radix_text_tbl WHERE t < 'Aztec Ct ';
645 ----------------------------------------------------------------------
647 -> Index Only Scan using sp_radix_ind on radix_text_tbl
648 Index Cond: (t < 'Aztec Ct '::text)
651 SELECT count(*) FROM radix_text_tbl WHERE t < 'Aztec Ct ';
658 SELECT count(*) FROM radix_text_tbl WHERE t ~<~ 'Aztec Ct ';
660 ------------------------------------------------------------------------
662 -> Index Only Scan using sp_radix_ind on radix_text_tbl
663 Index Cond: (t ~<~ 'Aztec Ct '::text)
666 SELECT count(*) FROM radix_text_tbl WHERE t ~<~ 'Aztec Ct ';
673 SELECT count(*) FROM radix_text_tbl WHERE t <= 'Aztec Ct ';
675 -----------------------------------------------------------------------
677 -> Index Only Scan using sp_radix_ind on radix_text_tbl
678 Index Cond: (t <= 'Aztec Ct '::text)
681 SELECT count(*) FROM radix_text_tbl WHERE t <= 'Aztec Ct ';
688 SELECT count(*) FROM radix_text_tbl WHERE t ~<=~ 'Aztec Ct ';
690 -------------------------------------------------------------------------
692 -> Index Only Scan using sp_radix_ind on radix_text_tbl
693 Index Cond: (t ~<=~ 'Aztec Ct '::text)
696 SELECT count(*) FROM radix_text_tbl WHERE t ~<=~ 'Aztec Ct ';
703 SELECT count(*) FROM radix_text_tbl WHERE t = 'Aztec Ct ';
705 ----------------------------------------------------------------------
707 -> Index Only Scan using sp_radix_ind on radix_text_tbl
708 Index Cond: (t = 'Aztec Ct '::text)
711 SELECT count(*) FROM radix_text_tbl WHERE t = 'Aztec Ct ';
718 SELECT count(*) FROM radix_text_tbl WHERE t = 'Worth St ';
720 ----------------------------------------------------------------------
722 -> Index Only Scan using sp_radix_ind on radix_text_tbl
723 Index Cond: (t = 'Worth St '::text)
726 SELECT count(*) FROM radix_text_tbl WHERE t = 'Worth St ';
733 SELECT count(*) FROM radix_text_tbl WHERE t >= 'Worth St ';
735 -----------------------------------------------------------------------
737 -> Index Only Scan using sp_radix_ind on radix_text_tbl
738 Index Cond: (t >= 'Worth St '::text)
741 SELECT count(*) FROM radix_text_tbl WHERE t >= 'Worth St ';
748 SELECT count(*) FROM radix_text_tbl WHERE t ~>=~ 'Worth St ';
750 -------------------------------------------------------------------------
752 -> Index Only Scan using sp_radix_ind on radix_text_tbl
753 Index Cond: (t ~>=~ 'Worth St '::text)
756 SELECT count(*) FROM radix_text_tbl WHERE t ~>=~ 'Worth St ';
763 SELECT count(*) FROM radix_text_tbl WHERE t > 'Worth St ';
765 ----------------------------------------------------------------------
767 -> Index Only Scan using sp_radix_ind on radix_text_tbl
768 Index Cond: (t > 'Worth St '::text)
771 SELECT count(*) FROM radix_text_tbl WHERE t > 'Worth St ';
778 SELECT count(*) FROM radix_text_tbl WHERE t ~>~ 'Worth St ';
780 ------------------------------------------------------------------------
782 -> Index Only Scan using sp_radix_ind on radix_text_tbl
783 Index Cond: (t ~>~ 'Worth St '::text)
786 SELECT count(*) FROM radix_text_tbl WHERE t ~>~ 'Worth St ';
793 SELECT count(*) FROM radix_text_tbl WHERE t ^@ 'Worth';
795 ------------------------------------------------------------
797 -> Index Only Scan using sp_radix_ind on radix_text_tbl
798 Index Cond: (t ^@ 'Worth'::text)
801 SELECT count(*) FROM radix_text_tbl WHERE t ^@ 'Worth';
808 SELECT count(*) FROM radix_text_tbl WHERE starts_with(t, 'Worth');
810 ------------------------------------------------------------
812 -> Index Only Scan using sp_radix_ind on radix_text_tbl
813 Index Cond: (t ^@ 'Worth'::text)
814 Filter: starts_with(t, 'Worth'::text)
817 SELECT count(*) FROM radix_text_tbl WHERE starts_with(t, 'Worth');
823 -- Now check the results from bitmap indexscan
824 SET enable_seqscan = OFF;
825 SET enable_indexscan = OFF;
826 SET enable_bitmapscan = ON;
828 SELECT count(*) FROM quad_point_tbl WHERE p IS NULL;
830 ----------------------------------------------
832 -> Bitmap Heap Scan on quad_point_tbl
833 Recheck Cond: (p IS NULL)
834 -> Bitmap Index Scan on sp_quad_ind
835 Index Cond: (p IS NULL)
838 SELECT count(*) FROM quad_point_tbl WHERE p IS NULL;
845 SELECT count(*) FROM quad_point_tbl WHERE p IS NOT NULL;
847 ----------------------------------------------
849 -> Bitmap Heap Scan on quad_point_tbl
850 Recheck Cond: (p IS NOT NULL)
851 -> Bitmap Index Scan on sp_quad_ind
852 Index Cond: (p IS NOT NULL)
855 SELECT count(*) FROM quad_point_tbl WHERE p IS NOT NULL;
862 SELECT count(*) FROM quad_point_tbl;
864 ----------------------------------------------
866 -> Bitmap Heap Scan on quad_point_tbl
867 -> Bitmap Index Scan on sp_quad_ind
870 SELECT count(*) FROM quad_point_tbl;
877 SELECT count(*) FROM quad_point_tbl WHERE p <@ box '(200,200,1000,1000)';
879 ---------------------------------------------------------------
881 -> Bitmap Heap Scan on quad_point_tbl
882 Recheck Cond: (p <@ '(1000,1000),(200,200)'::box)
883 -> Bitmap Index Scan on sp_quad_ind
884 Index Cond: (p <@ '(1000,1000),(200,200)'::box)
887 SELECT count(*) FROM quad_point_tbl WHERE p <@ box '(200,200,1000,1000)';
894 SELECT count(*) FROM quad_point_tbl WHERE box '(200,200,1000,1000)' @> p;
896 ---------------------------------------------------------------
898 -> Bitmap Heap Scan on quad_point_tbl
899 Recheck Cond: ('(1000,1000),(200,200)'::box @> p)
900 -> Bitmap Index Scan on sp_quad_ind
901 Index Cond: (p <@ '(1000,1000),(200,200)'::box)
904 SELECT count(*) FROM quad_point_tbl WHERE box '(200,200,1000,1000)' @> p;
911 SELECT count(*) FROM quad_point_tbl WHERE p << '(5000, 4000)';
913 -------------------------------------------------------
915 -> Bitmap Heap Scan on quad_point_tbl
916 Recheck Cond: (p << '(5000,4000)'::point)
917 -> Bitmap Index Scan on sp_quad_ind
918 Index Cond: (p << '(5000,4000)'::point)
921 SELECT count(*) FROM quad_point_tbl WHERE p << '(5000, 4000)';
928 SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)';
930 -------------------------------------------------------
932 -> Bitmap Heap Scan on quad_point_tbl
933 Recheck Cond: (p >> '(5000,4000)'::point)
934 -> Bitmap Index Scan on sp_quad_ind
935 Index Cond: (p >> '(5000,4000)'::point)
938 SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)';
945 SELECT count(*) FROM quad_point_tbl WHERE p <<| '(5000, 4000)';
947 --------------------------------------------------------
949 -> Bitmap Heap Scan on quad_point_tbl
950 Recheck Cond: (p <<| '(5000,4000)'::point)
951 -> Bitmap Index Scan on sp_quad_ind
952 Index Cond: (p <<| '(5000,4000)'::point)
955 SELECT count(*) FROM quad_point_tbl WHERE p <<| '(5000, 4000)';
962 SELECT count(*) FROM quad_point_tbl WHERE p |>> '(5000, 4000)';
964 --------------------------------------------------------
966 -> Bitmap Heap Scan on quad_point_tbl
967 Recheck Cond: (p |>> '(5000,4000)'::point)
968 -> Bitmap Index Scan on sp_quad_ind
969 Index Cond: (p |>> '(5000,4000)'::point)
972 SELECT count(*) FROM quad_point_tbl WHERE p |>> '(5000, 4000)';
979 SELECT count(*) FROM quad_point_tbl WHERE p ~= '(4585, 365)';
981 ------------------------------------------------------
983 -> Bitmap Heap Scan on quad_point_tbl
984 Recheck Cond: (p ~= '(4585,365)'::point)
985 -> Bitmap Index Scan on sp_quad_ind
986 Index Cond: (p ~= '(4585,365)'::point)
989 SELECT count(*) FROM quad_point_tbl WHERE p ~= '(4585, 365)';
996 SELECT count(*) FROM kd_point_tbl WHERE p <@ box '(200,200,1000,1000)';
998 ---------------------------------------------------------------
1000 -> Bitmap Heap Scan on kd_point_tbl
1001 Recheck Cond: (p <@ '(1000,1000),(200,200)'::box)
1002 -> Bitmap Index Scan on sp_kd_ind
1003 Index Cond: (p <@ '(1000,1000),(200,200)'::box)
1006 SELECT count(*) FROM kd_point_tbl WHERE p <@ box '(200,200,1000,1000)';
1013 SELECT count(*) FROM kd_point_tbl WHERE box '(200,200,1000,1000)' @> p;
1015 ---------------------------------------------------------------
1017 -> Bitmap Heap Scan on kd_point_tbl
1018 Recheck Cond: ('(1000,1000),(200,200)'::box @> p)
1019 -> Bitmap Index Scan on sp_kd_ind
1020 Index Cond: (p <@ '(1000,1000),(200,200)'::box)
1023 SELECT count(*) FROM kd_point_tbl WHERE box '(200,200,1000,1000)' @> p;
1030 SELECT count(*) FROM kd_point_tbl WHERE p << '(5000, 4000)';
1032 -------------------------------------------------------
1034 -> Bitmap Heap Scan on kd_point_tbl
1035 Recheck Cond: (p << '(5000,4000)'::point)
1036 -> Bitmap Index Scan on sp_kd_ind
1037 Index Cond: (p << '(5000,4000)'::point)
1040 SELECT count(*) FROM kd_point_tbl WHERE p << '(5000, 4000)';
1047 SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)';
1049 -------------------------------------------------------
1051 -> Bitmap Heap Scan on kd_point_tbl
1052 Recheck Cond: (p >> '(5000,4000)'::point)
1053 -> Bitmap Index Scan on sp_kd_ind
1054 Index Cond: (p >> '(5000,4000)'::point)
1057 SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)';
1064 SELECT count(*) FROM kd_point_tbl WHERE p <<| '(5000, 4000)';
1066 --------------------------------------------------------
1068 -> Bitmap Heap Scan on kd_point_tbl
1069 Recheck Cond: (p <<| '(5000,4000)'::point)
1070 -> Bitmap Index Scan on sp_kd_ind
1071 Index Cond: (p <<| '(5000,4000)'::point)
1074 SELECT count(*) FROM kd_point_tbl WHERE p <<| '(5000, 4000)';
1081 SELECT count(*) FROM kd_point_tbl WHERE p |>> '(5000, 4000)';
1083 --------------------------------------------------------
1085 -> Bitmap Heap Scan on kd_point_tbl
1086 Recheck Cond: (p |>> '(5000,4000)'::point)
1087 -> Bitmap Index Scan on sp_kd_ind
1088 Index Cond: (p |>> '(5000,4000)'::point)
1091 SELECT count(*) FROM kd_point_tbl WHERE p |>> '(5000, 4000)';
1098 SELECT count(*) FROM kd_point_tbl WHERE p ~= '(4585, 365)';
1100 ------------------------------------------------------
1102 -> Bitmap Heap Scan on kd_point_tbl
1103 Recheck Cond: (p ~= '(4585,365)'::point)
1104 -> Bitmap Index Scan on sp_kd_ind
1105 Index Cond: (p ~= '(4585,365)'::point)
1108 SELECT count(*) FROM kd_point_tbl WHERE p ~= '(4585, 365)';
1115 SELECT count(*) FROM radix_text_tbl WHERE t = 'P0123456789abcdef';
1117 -----------------------------------------------------------
1119 -> Bitmap Heap Scan on radix_text_tbl
1120 Recheck Cond: (t = 'P0123456789abcdef'::text)
1121 -> Bitmap Index Scan on sp_radix_ind
1122 Index Cond: (t = 'P0123456789abcdef'::text)
1125 SELECT count(*) FROM radix_text_tbl WHERE t = 'P0123456789abcdef';
1132 SELECT count(*) FROM radix_text_tbl WHERE t = 'P0123456789abcde';
1134 ----------------------------------------------------------
1136 -> Bitmap Heap Scan on radix_text_tbl
1137 Recheck Cond: (t = 'P0123456789abcde'::text)
1138 -> Bitmap Index Scan on sp_radix_ind
1139 Index Cond: (t = 'P0123456789abcde'::text)
1142 SELECT count(*) FROM radix_text_tbl WHERE t = 'P0123456789abcde';
1149 SELECT count(*) FROM radix_text_tbl WHERE t = 'P0123456789abcdefF';
1151 ------------------------------------------------------------
1153 -> Bitmap Heap Scan on radix_text_tbl
1154 Recheck Cond: (t = 'P0123456789abcdefF'::text)
1155 -> Bitmap Index Scan on sp_radix_ind
1156 Index Cond: (t = 'P0123456789abcdefF'::text)
1159 SELECT count(*) FROM radix_text_tbl WHERE t = 'P0123456789abcdefF';
1166 SELECT count(*) FROM radix_text_tbl WHERE t < 'Aztec Ct ';
1168 ----------------------------------------------------------------------------
1170 -> Bitmap Heap Scan on radix_text_tbl
1171 Recheck Cond: (t < 'Aztec Ct '::text)
1172 -> Bitmap Index Scan on sp_radix_ind
1173 Index Cond: (t < 'Aztec Ct '::text)
1176 SELECT count(*) FROM radix_text_tbl WHERE t < 'Aztec Ct ';
1183 SELECT count(*) FROM radix_text_tbl WHERE t ~<~ 'Aztec Ct ';
1185 ------------------------------------------------------------------------------
1187 -> Bitmap Heap Scan on radix_text_tbl
1188 Recheck Cond: (t ~<~ 'Aztec Ct '::text)
1189 -> Bitmap Index Scan on sp_radix_ind
1190 Index Cond: (t ~<~ 'Aztec Ct '::text)
1193 SELECT count(*) FROM radix_text_tbl WHERE t ~<~ 'Aztec Ct ';
1200 SELECT count(*) FROM radix_text_tbl WHERE t <= 'Aztec Ct ';
1202 -----------------------------------------------------------------------------
1204 -> Bitmap Heap Scan on radix_text_tbl
1205 Recheck Cond: (t <= 'Aztec Ct '::text)
1206 -> Bitmap Index Scan on sp_radix_ind
1207 Index Cond: (t <= 'Aztec Ct '::text)
1210 SELECT count(*) FROM radix_text_tbl WHERE t <= 'Aztec Ct ';
1217 SELECT count(*) FROM radix_text_tbl WHERE t ~<=~ 'Aztec Ct ';
1219 -------------------------------------------------------------------------------
1221 -> Bitmap Heap Scan on radix_text_tbl
1222 Recheck Cond: (t ~<=~ 'Aztec Ct '::text)
1223 -> Bitmap Index Scan on sp_radix_ind
1224 Index Cond: (t ~<=~ 'Aztec Ct '::text)
1227 SELECT count(*) FROM radix_text_tbl WHERE t ~<=~ 'Aztec Ct ';
1234 SELECT count(*) FROM radix_text_tbl WHERE t = 'Aztec Ct ';
1236 ----------------------------------------------------------------------------
1238 -> Bitmap Heap Scan on radix_text_tbl
1239 Recheck Cond: (t = 'Aztec Ct '::text)
1240 -> Bitmap Index Scan on sp_radix_ind
1241 Index Cond: (t = 'Aztec Ct '::text)
1244 SELECT count(*) FROM radix_text_tbl WHERE t = 'Aztec Ct ';
1251 SELECT count(*) FROM radix_text_tbl WHERE t = 'Worth St ';
1253 ----------------------------------------------------------------------------
1255 -> Bitmap Heap Scan on radix_text_tbl
1256 Recheck Cond: (t = 'Worth St '::text)
1257 -> Bitmap Index Scan on sp_radix_ind
1258 Index Cond: (t = 'Worth St '::text)
1261 SELECT count(*) FROM radix_text_tbl WHERE t = 'Worth St ';
1268 SELECT count(*) FROM radix_text_tbl WHERE t >= 'Worth St ';
1270 -----------------------------------------------------------------------------
1272 -> Bitmap Heap Scan on radix_text_tbl
1273 Recheck Cond: (t >= 'Worth St '::text)
1274 -> Bitmap Index Scan on sp_radix_ind
1275 Index Cond: (t >= 'Worth St '::text)
1278 SELECT count(*) FROM radix_text_tbl WHERE t >= 'Worth St ';
1285 SELECT count(*) FROM radix_text_tbl WHERE t ~>=~ 'Worth St ';
1287 -------------------------------------------------------------------------------
1289 -> Bitmap Heap Scan on radix_text_tbl
1290 Recheck Cond: (t ~>=~ 'Worth St '::text)
1291 -> Bitmap Index Scan on sp_radix_ind
1292 Index Cond: (t ~>=~ 'Worth St '::text)
1295 SELECT count(*) FROM radix_text_tbl WHERE t ~>=~ 'Worth St ';
1302 SELECT count(*) FROM radix_text_tbl WHERE t > 'Worth St ';
1304 ----------------------------------------------------------------------------
1306 -> Bitmap Heap Scan on radix_text_tbl
1307 Recheck Cond: (t > 'Worth St '::text)
1308 -> Bitmap Index Scan on sp_radix_ind
1309 Index Cond: (t > 'Worth St '::text)
1312 SELECT count(*) FROM radix_text_tbl WHERE t > 'Worth St ';
1319 SELECT count(*) FROM radix_text_tbl WHERE t ~>~ 'Worth St ';
1321 ------------------------------------------------------------------------------
1323 -> Bitmap Heap Scan on radix_text_tbl
1324 Recheck Cond: (t ~>~ 'Worth St '::text)
1325 -> Bitmap Index Scan on sp_radix_ind
1326 Index Cond: (t ~>~ 'Worth St '::text)
1329 SELECT count(*) FROM radix_text_tbl WHERE t ~>~ 'Worth St ';
1336 SELECT count(*) FROM radix_text_tbl WHERE t ^@ 'Worth';
1338 ------------------------------------------------
1340 -> Bitmap Heap Scan on radix_text_tbl
1341 Recheck Cond: (t ^@ 'Worth'::text)
1342 -> Bitmap Index Scan on sp_radix_ind
1343 Index Cond: (t ^@ 'Worth'::text)
1346 SELECT count(*) FROM radix_text_tbl WHERE t ^@ 'Worth';
1353 SELECT count(*) FROM radix_text_tbl WHERE starts_with(t, 'Worth');
1355 ------------------------------------------------
1357 -> Bitmap Heap Scan on radix_text_tbl
1358 Filter: starts_with(t, 'Worth'::text)
1359 -> Bitmap Index Scan on sp_radix_ind
1360 Index Cond: (t ^@ 'Worth'::text)
1363 SELECT count(*) FROM radix_text_tbl WHERE starts_with(t, 'Worth');
1369 RESET enable_seqscan;
1370 RESET enable_indexscan;
1371 RESET enable_bitmapscan;