Re: index scan with functional indexes

Поиск
Список
Период
Сортировка
От Dave Cramer
Тема Re: index scan with functional indexes
Дата
Msg-id 1075226952.1610.296.camel@localhost.localdomain
обсуждение исходный текст
Ответ на Re: index scan with functional indexes  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: index scan with functional indexes  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tried, all the suggestions

--dc--
davec=# explain analyze select * from url where fn_strrev(url) like
fn_strrev('%beta12.html');                                                      QUERY PLAN

------------------------------------------------------------------------------------------------------------------------Seq
Scanon url  (cost=100000000.00..100013533.04 rows=503 width=454)
 
(actual time=1416.448..3817.221 rows=12 loops=1)  Filter: (fn_strrev((url)::text) ~~ 'lmth.21ateb%'::text)Total
runtime:3817.315 ms
 
(3 rows)
davec=# explain analyze select * from url where fn_strrev(url) like
'lmth.21ateb%';                                                      QUERY PLAN

------------------------------------------------------------------------------------------------------------------------Seq
Scanon url  (cost=100000000.00..100013533.04 rows=503 width=454)
 
(actual time=1412.181..3843.998 rows=12 loops=1)  Filter: (fn_strrev((url)::text) ~~ 'lmth.21ateb%'::text)Total
runtime:3844.106 ms
 
(3 rows)
davec=# explain analyze select * from url where fn_strrev(url) like
'%lmth.21ateb';                                                     QUERY PLAN

-----------------------------------------------------------------------------------------------------------------------Seq
Scanon url  (cost=100000000.00..100013533.04 rows=503 width=454)
 
(actual time=3853.501..3853.501 rows=0 loops=1)  Filter: (fn_strrev((url)::text) ~~ '%lmth.21ateb'::text)Total runtime:
3853.583ms
 
(3 rows)

On Tue, 2004-01-27 at 13:02, Tom Lane wrote:
> Dave Cramer <pg@fastcrypt.com> writes:
> > davec=# explain analyze select * from url where fn_strrev(url) like
> > '%beta12.html';
> 
> Don't you need the % at the right end to have an indexable plan?
> I suspect that both of your tries so far are actually semantically
> wrong, and that what you intend is
> 
> select * from url where fn_strrev(url) like fn_strrev('%beta12.html');
> 
>             regards, tom lane
> 
-- 
Dave Cramer
519 939 0336
ICQ # 1467551



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Another optimizer question
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Function call