Re: Possible planner bug?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Possible planner bug?
Дата
Msg-id 15570.1174329063@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Possible planner bug?  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: Possible planner bug?  (Jeff Davis <pgsql@j-davis.com>)
Re: Possible planner bug?  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-general
Jeff Davis <pgsql@j-davis.com> writes:
> I have two indexes defined on "syslog_p":

> "syslog_p_severity_ts_idx" btree (severity, ts)
> "syslog_p_ts_where_severity_1_idx" btree (ts) WHERE severity = 1

> The planner chooses what looks to me like a very strange plan for this
> query:
> => explain analyze select * from syslog where severity=1;

The attached crude hack makes it not do that, but I wonder whether it
won't prevent use of bitmap AND in some cases where we'd rather it did
use an AND.  Want to try it out?

Possibly a more salient question is why are you bothering with two
indexes defined like that.  Now that I look closely, they seem pretty
redundant.

            regards, tom lane


Index: indxpath.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v
retrieving revision 1.217
diff -c -r1.217 indxpath.c
*** indxpath.c    17 Mar 2007 00:11:04 -0000    1.217
--- indxpath.c    19 Mar 2007 18:22:23 -0000
***************
*** 787,793 ****

          foreach(cell2, list2)
          {
!             if (lfirst(cell2) == datum1)
                  return true;
          }
      }
--- 787,793 ----

          foreach(cell2, list2)
          {
!             if (equal(lfirst(cell2), datum1))
                  return true;
          }
      }

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

Предыдущее
От: "hubert depesz lubaczewski"
Дата:
Сообщение: Re: Own messages for constraints?
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: Own messages for constraints?