"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