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