On 7/22/16 3:37 AM, Robert Klemme wrote:
> I am wondering what to do if the same statement has multiple execution
> plans if that is possible in such a scenario. Present all the plans or
> just the one with the highest impact? Show them next to each other so
> the user is immediately aware that all these plans originated from the
> same piece of SQL?
plpgsql runs all it's stuff via SPI, which can replan queries. So yes, I
think it's necessary to deal with that.
That said, if we only kept the most expensive X plans from a given
function, that could handle both cases.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532) mobile: 512-569-9461