Re: procost for to_tsvector

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: procost for to_tsvector
Date: 2015-03-11 16:07:20
Message-ID: 17158.1426090040@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> On 2015-03-11 14:40:16 +0000, Andrew Gierth wrote:
>> Getting the right cost estimate would obviously mean taking the cost of
>> detoasting into account

> Well, that's not done in other cases where you could either, so there's
> precedence for being inaccurate ;)

If we were to charge something for detoasting, that would be a separate
matter anyway IMO, not something to try to sneak into function costs.
(Essentially, what we ought to consider is that a Var isn't zero-cost
if it refers to a column with a large fraction of toasted entries.
But that's a matter for a different patch.)

>> ,but even without doing that, there's a strong
>> argument that it should be increased to at least the order of 100.

Nyet ... at least not without you actually making that argument, with
numbers, rather than just handwaving. We use 100 for plpgsql and suchlike
functions. I'd be OK with making it 10 just on general principles, but
claiming that it's as expensive as a plpgsql function requires evidence.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2015-03-11 16:08:25 Re: mogrify and indent features for jsonb
Previous Message Robert Haas 2015-03-11 14:58:41 Re: Doing better at HINTing an appropriate column within errorMissingColumn()