Re: why is bitmap index chosen for this query?

Поиск
Список
Период
Сортировка
От Steinar H. Gunderson
Тема Re: why is bitmap index chosen for this query?
Дата
Msg-id 20060518194813.GA8539@uio.no
обсуждение исходный текст
Ответ на Re: why is bitmap index chosen for this query?  (Stephen Byers <stephenabyers@yahoo.com>)
Ответы Re: why is bitmap index chosen for this query?  (Stephen Byers <stephenabyers@yahoo.com>)
Список pgsql-performance
On Thu, May 18, 2006 at 12:38:18PM -0700, Stephen Byers wrote:
> I repeated explain analyze on the query 5 times and it came up with the same plan.

Yes, but did it end up with the same runtime? That's the interesting part --
the plan will almost always be identical between explain analyze runs given
that you haven't done anything in between them.

> You asked about index order and physical table order.  In general the index
> order is indeed close to the same order as the physical table order.
> However, this query is likely an exception.  The data is actually from a
> backup server that has filled a hole for some of the time range that I'm
> specifying in my query.

Well, it still isn't all that far-fetched to believe that the data has lots
of correlation (which helps the index scan quite a lot) that the planner
isn't able to pick up. I don't know the details here, so I can't tell you how
the correlation for such a query (WHERE a=foo and b between bar and baz) is
estimated. Something tells me someone else might, though. :-)

/* Steinar */
--
Homepage: http://www.sesse.net/

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

Предыдущее
От: Stephen Byers
Дата:
Сообщение: Re: why is bitmap index chosen for this query?
Следующее
От: Stephen Byers
Дата:
Сообщение: Re: why is bitmap index chosen for this query?