Re: Optimize slow query

Поиск
Список
Период
Сортировка
От Cédric Villemain
Тема Re: Optimize slow query
Дата
Msg-id 200706131350.01695.cedric.villemain@dalibo.com
обсуждение исходный текст
Ответ на Optimize slow query  ("Tyler Durden" <tylersticky@gmail.com>)
Список pgsql-performance
Le mercredi 13 juin 2007, Tyler Durden a écrit :
> Hi,
> I've a table with 300 000 records and I'm trying to do a search:
>
> SELECT * FROM addresses WHERE address ILIKE '%Jean Paul%' AND
> (l_pc='4250' or r_pc='4250') AND (l_struc='O' or r_struc='O') AND
> (prenm ILIKE 'Street')
>
> It performs in 2 seconds in a dual Xeon 2.4mhz with 2Gb of RAM.
> I'm using Postgresql 8.1 on ubuntu.
> I've indexes on l_pc, r_pc, l_struc,r_struc and prenm (all btrees)
> What I'm doing wrong to have such a slow query?
Could you add 'explain analyze' to your post ?
And how much content have the text fields ? (isn't tsearch2 an option for
you ?)
>
> Thanks,
> Nuno Mariz
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: You can help support the PostgreSQL project by donating at
>
>                 http://www.postgresql.org/about/donate



--
Cédric Villemain
Administrateur de Base de Données
Cel: +33 (0)6 74 15 56 53
http://dalibo.com - http://dalibo.org

Вложения

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

Предыдущее
От: "Tyler Durden"
Дата:
Сообщение: Re: Optimize slow query
Следующее
От: "Michael Dengler"
Дата:
Сообщение: WAL shipping and ever expanding pg_xlog