Failure to use generic plans (was: Re: Performance problem in PLPgSQL) - Mailing list pgsql-hackers

From Andrew Gierth
Subject Failure to use generic plans (was: Re: Performance problem in PLPgSQL)
Date
Msg-id 0e6d70debaf899bfbf37edcdfbd03e21@news-out.riddles.org.uk
Whole thread Raw
In response to Performance problem in PLPgSQL  (Marc Cousin <cousinmarc@gmail.com>)
List pgsql-hackers
As failures to use a generic plan goes, that one's fairly tame. I've
seen much worse. For example:

PREPARE foo(integer[]) AS SELECT * FROM complexview WHERE id = ANY ($1);

where the caller typically supplies 1-5 array elements (or any number
less than 10, because generic parameter arrays are assumed to have 10
elements). This one can be a massive performance regression between
9.1 and 9.2; the first guy who mentioned this on IRC was getting a 40x
slowdown (~20ms planning time vs. 0.5ms execution time).

-- 
Andrew (irc:RhodiumToad)



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Performance problem in PLPgSQL
Next
From: Stephen Frost
Date:
Subject: Re: Review: UNNEST (and other functions) WITH ORDINALITY