Re: LIKE optimization - Mailing list pgsql-novice

From Tom Lane
Subject Re: LIKE optimization
Date
Msg-id 12758.979662827@sss.pgh.pa.us
Whole thread Raw
In response to LIKE optimization  (Nabil Sayegh <nsmail@sayegh.de>)
List pgsql-novice
Nabil Sayegh <nsmail@sayegh.de> writes:
> Although the two queries should be equivalent the second takes about 4s
> and the first takes almost 2 MINUTES.

It's impossible to say anything intelligent about this with only the
text of the queries to go on.  What indexes do you have on these tables?
What does EXPLAIN show as the query plan for each query?

Oh, and have you done a VACUUM ANALYZE recently on these tables?

            regards, tom lane

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: log file?
Next
From: Nabil Sayegh
Date:
Subject: Re: LIKE optimization