pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Tom Lane <tgl@sss.pgh.pa.us>
To: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: 7k records into Sort node, 4.5m out?
Date: Mon, 20 Aug 2012 11:40:24 -0400
Message-ID: <1059.1345477224@sss.pgh.pa.us> (raw )
In-Reply-To: <50314441.6050501@agliodbs.com >
References: <D2CA9292-023A-4DF4-82B8-6E99CE82CCB1@thebuild.com >
<dda48e8e4cd63cc6f98f9eca78016c05.squirrel@sq.gransy.com >
<32B51AEA-E940-40CF-BA54-C7D4E3E1F0D7@thebuild.com >
<10304.1344910305@sss.pgh.pa.us >
<623F2FF3-B79D-419A-929A-41C707DD5EA3@thebuild.com >
<16268.1345063872@sss.pgh.pa.us >
<502C0E6B.1040402@agliodbs.com >
<20520.1345067076@sss.pgh.pa.us >
<502C3DE2.9060703@agliodbs.com >
<2703.1345096911@sss.pgh.pa.us >
<50314441.6050501@agliodbs.com >
Josh Berkus <josh@agliodbs.com> writes:
> I guess what I'm really not understanding is why it's calculating a cost
> of 3.7m for the index scan, and then discarding that *entire* cost and
> not including it in the total cost of the query?
It isn't ... or at least, you've offered no evidence that it is.
It's discounting some fraction of the cost on the (apparently correct)
basis that the merge won't read that input all the way to the end.
Whether it's discounted by an appropriate fraction is hard to tell
from the information given. The actual rows count is about a quarter
the whole-scan estimate, so a multiplier of 0.25 seems right in
hindsight, and that seems to match up roughly right with the mergejoin
cost estimate --- but not knowing the actual table size, there's a lot
of uncertainty here.
regards, tom lane
view thread (13+ messages) latest in thread
Message-ID: <1059.1345477224@sss.pgh.pa.us>
Permalink: ../1059.1345477224@sss.pgh.pa.us/
Also on: postgresql.org/message-id/1059.1345477224@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-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, josh@agliodbs.com
Subject: Re: 7k records into Sort node, 4.5m out?
In-Reply-To: <1059.1345477224@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