Re: LIke and Indicies

Поиск
Список
Период
Сортировка
От Dave Smith
Тема Re: LIke and Indicies
Дата
Msg-id 1109350440.14397.57.camel@playpen.candata.com
обсуждение исходный текст
Ответ на Re: LIke and Indicies  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: LIke and Indicies  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-general
From my reading of that statement it says it is going to use the index
to match company_id=1000 and then fetch the row and compare
product_desc. Where as in the the case without the like it is using
product description in the Index Condition.

The speed of the queries certainly seems to bare it out .. The query
where the product_desc is in the index condition,  returns almost
immediately where as the other takes about 10 seconds before the first
row is returned.


On Fri, 2005-02-25 at 11:44, Peter Eisentraut wrote:
> Am Freitag, 25. Februar 2005 17:31 schrieb Dave Smith:
> > I am using 7.4.5 and trying to use the like clause (Local C) but
> > postgres does not seem to want to use the index.
> >
> > explain
> > declare t scroll cursor for
> > select * from product where company_id=1000 and product_desc like 'J%'
> >  order by company_id,product_desc;
> >
> >                                    QUERY
> > PLAN
> > ---------------------------------------------------------------------------
> >------ Index Scan using product_4 on product  (cost=0.00..12306.67 rows=881
> > width=181)
> >    Index Cond: (company_id = 1000)
> >    Filter: ((product_desc)::text ~~ 'J%'::text)
>
> What part of "Index Scan" are you misunderstanding?
--
Dave Smith
CANdata Systems Ltd
416-493-9020


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: LIke and Indicies
Следующее
От: "Dr. Stephane Schildknecht"
Дата:
Сообщение: Association PostgreSQLFr, statuts et inscription