public inbox for [email protected]
help / color / mirror / Atom feedFrom: Robert Haas <[email protected]>
To: [email protected] <[email protected]>
Cc: pgsql-hackers <[email protected]>
Subject: Re: Where is the filter?
Date: Mon, 6 Feb 2023 11:15:42 -0500
Message-ID: <CA+TgmoZwdiRZDQbFp+=LHWKz7e-2Pb-+R8eb0tvBUnPxWVfRmg@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
On Sat, Feb 4, 2023 at 11:29 PM [email protected] <[email protected]> wrote:
> When I use 'select * from t where a = 1'; And I debug to find where the 'a = 1' is used,
> when I arrive ExecScan in src/backend/executor/execScan.c, line 158, where this 'a = 1' is
> stored in?
It depends somewhat on what query plan you got. For instance if it was
a Seq Scan then it will be a filter-condition, or "qual", and the call
to ExecQual() later in ExecScan() will be responsible for evaluating
it. But if you are using an index scan, then it will probably become
an index qual, and those are passed down into the index machinery and
internally handled by the index AM. It's a good idea when you're
debugging this sort of thing to start by looking at the EXPLAIN or
EXPLAIN ANALYZE output, and perhaps also the output with
debug_print_plan = true.
--
Robert Haas
EDB: http://www.enterprisedb.com
view thread (2+ messages) latest in thread
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: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Where is the filter?
In-Reply-To: <CA+TgmoZwdiRZDQbFp+=LHWKz7e-2Pb-+R8eb0tvBUnPxWVfRmg@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox