Re: parameterized limit statements

From: "Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: parameterized limit statements
Date: 2005-11-07 18:20:32
Message-ID: 6EE64EF3AB31D5448D0007DD34EEB3417DD7F7@Herge.rcsinc.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > ^^
> > If I hardcode $5 to any sub-ridiculous value, I get a proper index
plan.
> > Does your patch assume a limit of 1 or 10% of table rows?
>
> If it doesn't have a value for the parameter, it'll assume 10% of
table
> rows, which is what it's done for a long time if the LIMIT isn't
> reducible to a constant.
>
> I suspect the real issue here is that whatever you are doing doesn't
> give the planner a value to use for the parameter. IIRC, at the
moment
> the only way that that happens is if you use the unnamed-statement
> variation of the Parse/Bind/Execute protocol.

hm...I'm using named statements over ExecPrepared. I can also confirm
the results inside psql with prepare/execute. I can send you a test
case, but was just wondering if your change to makelimit was supposed to
address this case.

Merlin

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chuck McDevitt 2005-11-07 18:29:55 Re: Another pgindent gripe
Previous Message Marc Munro 2005-11-07 18:09:54 Odd db lockup - investigation advice wanted