Re: Speeding up LIKE with placeholders?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dan Sugalski <dan(at)sidhe(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Speeding up LIKE with placeholders?
Date: 2004-09-10 21:19:22
Message-ID: 2939.1094851162@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dan Sugalski <dan(at)sidhe(dot)org> writes:
> I'd figure, though, that since the parameters are being passed
> into PQexecParams basically to get them out of band so I don't have
> to deal with escaping, quoting, and suchlike things, that the
> optimizer would look at things *after* the substitution was done.

You'd figure wrong :-(. The present mechanism for the LIKE-to-index
optimization requires the LIKE pattern to be a pure, unadulterated constant.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dan Sugalski 2004-09-10 21:23:37 Re: Speeding up LIKE with placeholders?
Previous Message Tom Lane 2004-09-10 21:15:28 Re: SMgrRelation hashtable corrupted