Re: limit clause breaks query planner?

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: limit clause breaks query planner?
Дата
Msg-id 87wshrn0tu.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: limit clause breaks query planner?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Guillaume Cottenceau <gc@mnc.ch> writes:
>> It seems to me that if the correlation is 0.99[1], and you're
>> looking for less than 1% of rows, the expected rows may be at the
>> beginning or at the end of the heap?
>
> Right, but if you know the value being searched for, you could then
> estimate where it is in the table by consulting the histogram.
>
> Actually, an even easier hack (which would have the nice property of not
> needing to know the exact value being searched for), would simply use
> the existing cost estimates if the WHERE variables have low correlation
> (meaning the random-locations assumption is probably good), but apply
> some sort of penalty factor if the correlation is high.

Fwiw this will have all the same problems our existing uses of the correlation
have. That doesn't mean we shouldn't do it but I would expect it to be
improved along with the other uses when we find a better metric.

I did happen to speak to a statistician the other day and was given some terms
to google. I'll investigate and see if I get anything useful.

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's RemoteDBA services!

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

Предыдущее
От: "Scott Marlowe"
Дата:
Сообщение: Re: More shared_buffers instead of effective_cache_size?
Следующее
От: Ulrich
Дата:
Сообщение: Re: More shared_buffers instead of effective_cache_size?