From: Tom Lane <tgl@sss.pgh.pa.us>
To: zszabo@chemaxon.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14495: Cost of comparator is not taken into account in sorting
Date: Mon, 16 Jan 2017 09:43:32 -0500
Message-ID: <5716.1484577812@sss.pgh.pa.us> (raw)
In-Reply-To: <20170116111312.1441.16240@wrigleys.postgresql.org>
References: <20170116111312.1441.16240@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
zszabo@chemaxon.com writes:
> Our problem is that the cost of sorting by the Molecule column does not take
> into account the cost of the comparison by molecule_relevance_compare() at
> all!
Yeah, cost_sort just uses cpu_operator_cost as the estimated cost per
comparison. It's unlikely anyone is going to be very excited about
changing that. It would be quite expensive to look up a function-specific
cost on every call, and cost_sort is called often enough during planning
that that expense would be a problem. Also, some call sites don't supply
enough information to do such a lookup at all; requiring them to provide
it would add more expense, and complication. So I don't really see us
adding that much overhead to support such a corner case as an
unduly-expensive sort comparator.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, zszabo@chemaxon.com
Subject: Re: BUG #14495: Cost of comparator is not taken into account in sorting
In-Reply-To: <5716.1484577812@sss.pgh.pa.us>
References: <20170116111312.1441.16240@wrigleys.postgresql.org> <5716.1484577812@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