8.2 planner and "like"

From: "Angva" <angvaw(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: 8.2 planner and "like"
Date: 2007-01-26 22:49:42
Message-ID: 1169851782.309511.297880@v33g2000cwv.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I have a question regarding Postgres 8.2 and the planner.

Our company's application runs searches with "like" where clauses, for
example: "where id like '38F20A%'". This query once ran in under 10 ms,
but since upgrading from 8.1.3 to 8.2.0, it now takes about 500 ms to
run. The problem appears to be that the planner does not want to use an
index since the upgrade, for "like" queries.

We experimented with planner cost constants, and we even tried setting
enable_seqscan to false. A seq scan was done every time. Now if my
understanding is correct, setting enable_seqscan to false should tell
the planner never to use a seq scan unless no alternative is possible.
We made sure the relevant index still exists, of course, and that the
table was analyzed with good samples...

Could this be a bug, or am I the problem? :) Any advice or insight is
appreciated.

Thank you,
Mark

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Shane Ambler 2007-01-26 23:28:05 Re: Predicted lifespan of different PostgreSQL branches
Previous Message Angva 2007-01-26 22:46:59 Re: Loop plpgsql recordset