Re: Caching query plan costs

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Caching query plan costs
Date: 2018-09-03 18:33:35
Message-ID: 20180903183335.GE25700@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Sep 3, 2018 at 01:30:33PM -0400, Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > What if we globally or locally cache the _cost_ of plans, so we can
> > consult that cache before planning and enable certain optimizations?
>
> But what would you use as cache key? And how's this help if we haven't

Uh, I assume we would do what pg_stat_statements does and remove the
constants an hash that.

> seen a similar query before in the session?

Well, if it was global we could use output from another session.

I guess my point is that this only used to turn on micro-optimizations
and maybe parallelism and JIT, so it doesn't have to be 100% accurate.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-09-03 18:36:31 Re: Out arguments name of "pg_identify_object_as_address" function in 9.5.14 and 11beta3
Previous Message Andrey Borodin 2018-09-03 18:09:33 Re: A strange GiST error message or fillfactor of GiST build