Re: Question about rtrees (overleft replacing left in nodes)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Question about rtrees (overleft replacing left in nodes)
Дата
Msg-id 4658.1080745532@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Question about rtrees (overleft replacing left in nodes)  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Question about rtrees (overleft replacing left in nodes)  (William White <bwhite@frognet.net>)
Список pgsql-general
I said:
> However, if this is indeed wrong, why have we not heard bug reports
> stating that rtree indexes don't work?  Can you generate a test case
> in which it fails?

Actually, it's not necessary to look very far: there's one rtree index
defined in the regression database, and guess what: it gets << queries
wrong.

regression=# explain select count(*) from fast_emp4000 where home_base << '(35565,5404),(35546,5360)';
                             QUERY PLAN
---------------------------------------------------------------------
 Aggregate  (cost=65.53..65.53 rows=1 width=0)
   ->  Seq Scan on fast_emp4000  (cost=0.00..64.75 rows=310 width=0)
         Filter: (home_base << '(35565,5404),(35546,5360)'::box)
(3 rows)

regression=# select count(*) from fast_emp4000 where home_base << '(35565,5404),(35546,5360)';
 count
-------
  2214
(1 row)

regression=# set enable_seqscan to 0;
SET
regression=# explain select count(*) from fast_emp4000 where home_base << '(35565,5404),(35546,5360)';
                                      QUERY PLAN
---------------------------------------------------------------------------------------
 Aggregate  (cost=112.96..112.96 rows=1 width=0)
   ->  Index Scan using rect2ind on fast_emp4000  (cost=0.00..112.18 rows=310 width=0)
         Index Cond: (home_base << '(35565,5404),(35546,5360)'::box)
(3 rows)

regression=# select count(*) from fast_emp4000 where home_base << '(35565,5404),(35546,5360)';
 count
-------
  1363
(1 row)

So we've got a problem here :-(

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Question about rtrees (overleft replacing left in nodes)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Slow IN query