Re: count(*), EXISTS, indexes

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: count(*), EXISTS, indexes
Дата
Msg-id
14783.1050105606@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
count(*), EXISTS, indexes Itai Zukerman <zukerman@math-hat.com>
Re: count(*), EXISTS, indexes Tom Lane <tgl@sss.pgh.pa.us>
Re: count(*), EXISTS, indexes Itai Zukerman <zukerman@math-hat.com>
Re: count(*), EXISTS, indexes Tom Lane <tgl@sss.pgh.pa.us>
Re: count(*), EXISTS, indexes Josh Berkus <josh@agliodbs.com>
Re: count(*), EXISTS, indexes Itai Zukerman <zukerman@math-hat.com>
Re: count(*), EXISTS, indexes Josh Berkus <josh@agliodbs.com>
Re: count(*), EXISTS, indexes Itai Zukerman <zukerman@math-hat.com>
Re: count(*), EXISTS, indexes Josh Berkus <josh@agliodbs.com>
Re: count(*), EXISTS, indexes Tom Lane <tgl@sss.pgh.pa.us>
Re: count(*), EXISTS, indexes Itai Zukerman <zukerman@math-hat.com>
Re: count(*), EXISTS, indexes Itai Zukerman <zukerman@math-hat.com>
Re: count(*), EXISTS, indexes Stephan Szabo <sszabo@megazone23.bigpanda.com>
Re: count(*), EXISTS, indexes Itai Zukerman <zukerman@math-hat.com>
SELECT INTO TEMP in Trigger? Itai Zukerman <zukerman@math-hat.com>
Re: SELECT INTO TEMP in Trigger? "Dan Langille" <dan@langille.org>
Re: SELECT INTO TEMP in Trigger? Itai Zukerman <zukerman@math-hat.com>
Re: SELECT INTO TEMP in Trigger? Bruce Momjian <pgman@candle.pha.pa.us>
Josh Berkus  writes:
> Your query problem is that basically you have custom operators which the 
> planner doesn't know how to evaluate the return results on correctly.  This 
> is a radically different situation from how you presented it in your first 
> posting.

> This explains why the planner thinks that the exists clause will return 
> 255,000 rows instead of the handful it actually does return.   I'd suggest 
> re-building the query in several different syntaxes, until you find the one 
> the planner gets right.

Or more likely to work: build some custom selectivity estimation
functions to attach to the custom operators.

> Or build your own custom index types to take advantage of your custom 
> operators.    B-tree indexes are optimized for =, LIKE, <, and > queries; I 
> don't think they know what to do with "~<="

They certainly don't.  Possibly GIST could be taught what to do with
such things, but it won't happen by magic.
		regards, tom lane


В списке pgsql-sql по дате отправления
От: Josh Berkus
Дата:
Сообщение: Re: count(*), EXISTS, indexes
От: Itai Zukerman
Дата:
Сообщение: Re: count(*), EXISTS, indexes
FAQ