Am Donnerstag, 31. August 2006 15:36 schrieb Csaba Nagy: > On Thu, 2006-08-31 at 15:19, Peter Eisentraut wrote: > > OK, why don't you work out an example. Let's look at this query: > > > > SELECT * FROM t1 WHERE a LIKE $1; > > > > What two plans would you prepare? > > if substring($1 from 1 for 1) != '%' then > use plan 1 (see below); > else > use plan 2 (see below); > end if;
Note that plan 1 can only be created if you know the actual value for $1. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly