Re: Estimating costs (was Functional Indices)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Estimating costs (was Functional Indices)
Дата
Msg-id 14644.990629315@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Estimating costs (was Functional Indices)  (Martijn van Oosterhout <kleptog@svana.org>)
Ответы Re: Estimating costs (was Functional Indices)  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general
Martijn van Oosterhout <kleptog@svana.org> writes:
> But I know something that postgres doesn't. The data is clustered somewhat
> around the id we're comparing on. There is a "runlength" involved. Thus,
> when doing an index scan, once it has read in the first tuple of a run there
> will be more just sitting in the cache at basically zero cost.

Hm.  There is code in development sources that will notice data
clustering --- actually what it looks at is the correlation between
physical tuple order and logical order of the values.  I'm not sure
whether it would do the right thing if you have runs of identical keys
but no overall ordering of the keys, however.

> Currently I work around this by fiddling enable_seqscan is strategic places
> but that's blunt instrument.

Yup, it sure is.  Can you propose a statistical measurement that would
cope with this situation?

            regards, tom lane

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

Предыдущее
От: Renaud Thonnart
Дата:
Сообщение: Re: OID again
Следующее
От: snpe
Дата:
Сообщение: Re: Simple question for SQL Student