Re: How to inject knowledge into a Postgres database

Поиск
Список
Период
Сортировка
Искать
От
Oleg Bartunov
Тема
Re: How to inject knowledge into a Postgres database
Дата
Msg-id
Pine.GSO.4.63.0510071936520.6241@ra.sai.msu.su
Ответ на
How to inject knowledge into a Postgres database (han.holl@informationslogik.nl)
Список
Дерево обсуждения
How to inject knowledge into a Postgres database han.holl@informationslogik.nl
Re: How to inject knowledge into a Postgres database Tom Lane <tgl@sss.pgh.pa.us>
Re: How to inject knowledge into a Postgres database Oleg Bartunov <oleg@sai.msu.su>
Re: How to inject knowledge into a Postgres database Yonatan Ben-Nes <da@canaan.co.il>
Re: How to inject knowledge into a Postgres database han.holl@informationslogik.nl
Re: How to inject knowledge into a Postgres database "Jim C. Nasby" <jnasby@pervasive.com>
Re: How to inject knowledge into a Postgres database han.holl@informationslogik.nl
Re: How to inject knowledge into a Postgres database Tom Lane <tgl@sss.pgh.pa.us>
Re: How to inject knowledge into a Postgres database han.holl@informationslogik.nl
You could increase statistics or try contrib/tsearch2

 	Oleg
On Fri, 7 Oct 2005, han.holl@informationslogik.nl wrote:

>
> Hello,
>
> We have a table of people with a date-of-birth and a surname, both indexed.
> We have queries like this:
> select report from table where dateofbirth = '1966-12-12' and surname like
> 'boer%'
>
> The planner estimates that in a 1.5M record table 'boer%' will have one record
> and 1966-12-12 about 40.
> Unfortunately, names are not evenly distributed, and in some combinations it
> will have to process many thousands of records. On some older and slower
> systems, this hurts.
>
> Is there a way to tell the planner to always prefer the dateofbirth index ?
> Alternatively, to inform it about the wildly uneven distribution of surnames
> (this must be even worse in China).
>
> A third possibility would be to rewrite such a query as a nested query: is
> there a rewrite query - hook (like apaches mod_rewrite) available ? Or is
> there a somewhere a proxy-server that could do this ?
>
> Cheers,
>
> Han Holl
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>

 	Regards,
 		Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83
В списке pgsql-general по дате отправления
От: Emi Lu
Дата:
От: Mark Rae
Дата:
Сообщение: Database Comments
FAQ