Search Postgresql Archives

Re: Slow query plan used

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Wetzel, Juergen (Juergen)" <wetzel@xxxxxxxxx> writes:
> Tom Lane <tgl@xxxxxxxxxxxxx> writes:
>> You might get some traction by creating indexes on lower(searchfield1) etc.

> I will try that. Does that mean the column statistics will only be collected when there's an index on the table/column?

No; ANALYZE collects stats on plain columns automatically.  The point
is that your query is not on the plain column searchfield1, it is on
lower(searchfield1).  The planner cannot make a reasonable estimate
for "something LIKE constant-pattern" unless it can find statistics
that are specifically for the "something" value.

			regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux