Re: [BUGS] BUG #14495: Cost of comparator is not taken into account in sorting - Mailing list pgsql-bugs

From Tom Lane
Subject Re: [BUGS] BUG #14495: Cost of comparator is not taken into account in sorting
Date
Msg-id 5716.1484577812@sss.pgh.pa.us
Whole thread Raw
In response to [BUGS] BUG #14495: Cost of comparator is not taken into account in sorting  (zszabo@chemaxon.com)
List pgsql-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

pgsql-bugs by date:

Previous
From: nikolay.nikitin@infowatch.com
Date:
Subject: [BUGS] BUG #14499: pg_dump error on the table with 512M or bigger byteavalues
Next
From: Kyotaro HORIGUCHI
Date:
Subject: Re: [BUGS] Bug in Physical Replication Slots (at least 9.5)?