pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: Jeff Janes <jeff.janes@gmail.com>
Cc: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: why partition pruning doesn't work?
Date: Sun, 15 Jul 2018 20:45:54 -0400
Message-ID: <15380.1531701954@sss.pgh.pa.us> (raw )
In-Reply-To: <CAKJS1f_ZoH6vJwpiFt4EvE+BuCoDE=hLJZ_9o0TZfkrVXxpSRQ@mail.gmail.com >
References: <CAFj8pRBjrufA3ocDm8o4LPGNye9Y+pm1b9kCwode4X04CULG3g@mail.gmail.com >
<22805.1528386192@sss.pgh.pa.us >
<CAKJS1f9xHoMntARi1RhqwAVZ-E0qp5a5f+Tf_chH9Vr8xOWiAw@mail.gmail.com >
<21787.1528428171@sss.pgh.pa.us >
<17850.1528755844@sss.pgh.pa.us >
<CA+Tgmoa2Vvka6dBMb2w_u_N2o2HUPY6oYkS4FQ3nXMj=4Zd5ig@mail.gmail.com >
<19365.1528820758@sss.pgh.pa.us >
<CA+TgmoZi9hwHb4nZxCeh1TTT8rGq6AYN1Q8o5uXhiPZ3sr6o9g@mail.gmail.com >
<30981.1528822481@sss.pgh.pa.us >
<CA+TgmoZXtauTcAHiTdL9dRShkK+ieLgNtiuxWxYZWJpHB41iWQ@mail.gmail.com >
<637.1528863347@sss.pgh.pa.us >
<CA+TgmoaQ+hxgDP4uxP_nRgC+JAn33_vona8P+GAnRDkceSZNSw@mail.gmail.com >
<28597.1528900759@sss.pgh.pa.us >
<ee1a67dc-69a1-b475-f812-3efe91509e32@lab.ntt.co.jp >
<CA+TgmoajU5mPAvgGqST_iiW6P-Y2T3mAmSfCAw2GEtYi0KQCJg@mail.gmail.com >
<27099.1528987211@sss.pgh.pa.us >
<29987.1529341511@sss.pgh.pa.us >
<b804d3a6-1411-660d-a893-e2bf78231a9f@lab.ntt.co.jp >
<4114.1531674142@sss.pgh.pa.us >
<CA+TgmoZcHQK+sD5yJrWU6vnZ_x5RaYyLtNP_tUUcrUhRorz=9A@mail.gma! il.com >
<CAKJS1f_ZoH6vJwpiFt4EvE+BuCoDE=hLJZ_9o0TZfkrVXxpSRQ@mail.gmail.com >
David Rowley <david.rowley@2ndquadrant.com> writes:
> On 16 July 2018 at 12:12, Robert Haas <robertmhaas@gmail.com> wrote:
>> On Sun, Jul 15, 2018 at 1:02 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> What we'd be better off doing, if we go this route, is to install an
>>> assertion-build-only test that verifies during relation_open(NoLock)
>>> that some kind of lock is already held on the rel.
> Wouldn't it be better to just store the Relation indexed by its relid
> somewhere the first time we opened it? Then just do a direct array
> lookup on that rather than looking up by hashtable in syscache?
That would require carrying said array clear through from the parser to
the executor, plus we'd have some fun keeping it in sync with the RTE
changes that happen in the rewriter and planner, plus it's not entirely
clear where we'd close those relations in cases where the generated
plan isn't fed to the executor immediately (or gets copied in any way).
I don't think it's worth going that far.
I *do* think it might be worth behaving like that within the executor
by itself, and said so upthread. In that situation, we have a clear
place to do relation closes during ExecutorEnd, so it's not as messy
as a more general approach would be.
regards, tom lane
view thread (72+ messages) latest in thread
Message-ID: <15380.1531701954@sss.pgh.pa.us>
Permalink: ../15380.1531701954@sss.pgh.pa.us/
Also on: postgresql.org/message-id/15380.1531701954@sss.pgh.pa.us
copy link · copy postgr.es
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, david.rowley@2ndquadrant.com, robertmhaas@gmail.com, Langote_Amit_f8@lab.ntt.co.jp, 9erthalion6@gmail.com, jeff.janes@gmail.com, ashutosh.bapat@enterprisedb.com, pavel.stehule@gmail.com, pgsql-hackers@lists.postgresql.org
Subject: Re: why partition pruning doesn't work?
In-Reply-To: <15380.1531701954@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox