Re: RFD: Discarded tuple count for SeqScan nodes in EXPLAIN ANALYZE

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: RFD: Discarded tuple count for SeqScan nodes in EXPLAIN ANALYZE
Date: 2009-05-22 13:42:28
Message-ID: 4A16ABC4.8050507@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund wrote:
>
> When analyzing the plan of a query I often find myself questioning
> whether an additional index may be sensible, or if it is sensible that a
> SeqScan is used if an index is available.
>
> The current EXPLAIN ANALYZE only shows the number of tuples matching the
> qualifier of an SeqScan Node - for analyzing the above situation it is
> at least equally interesting how many tuples were read and discarded.
>
> Therefore I produced a patch which adds a 'discarded=%f' part to the
> analyze output.
> As this is only a RFD the implementation is a bit hackish at the moment
> - the discarded counter is increased in execScan directly instead of a
> helper routine in instrument.c.
> Also the discarded count is displayed in other node types as well - for
> some there might be a sensible semantic meaning to it...
>
> Good idea - Bad idea?

Isn't the discarded count always equal to (# of rows in table - matched
tuples)? Seems pretty redundant to me.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2009-05-22 13:48:21 Re: RFD: Discarded tuple count for SeqScan nodes in EXPLAIN ANALYZE
Previous Message Andres Freund 2009-05-22 13:40:41 Re: RFD: Discarded tuple count for SeqScan nodes in EXPLAIN ANALYZE - Patch v1