Re: Boosting cost estimates for some built-in functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Boosting cost estimates for some built-in functions
Date: 2009-10-18 20:45:35
Message-ID: 10334.1255898735@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Simon Riggs <simon(at)2ndQuadrant(dot)com> writes:
> On Sun, 2009-10-18 at 14:50 -0400, Tom Lane wrote:
>> I'd like to suggest boosting the built-in cost estimates for the
>> xxx_has_privilege functions to perhaps 10. to_tsquery and to_tsvector
>> maybe should be boosted even higher, but I don't have a good specific
>> number in mind.

> ISTM we should set up a test that measures the cost, of those and other
> functions.

Well, some quick testing suggests that 10x is in the right ballpark for
has_table_privilege versus a simple function such as OID equality,
and that even fairly simple cases of to_tsvector/to_tsquery can be
100x the cost of OID equality. I'm not sure if there is a "typical
case" for the latter given the wide range of possible tsearch
configurations, so trying to benchmark it with any degree of precision
might be pointless.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-10-18 21:57:12 Re: Controlling changes in plpgsql variable resolution
Previous Message Tom Lane 2009-10-18 20:07:50 Re: Controlling changes in plpgsql variable resolution