Re: procost for to_tsvector - Mailing list pgsql-hackers

From Tom Lane
Subject Re: procost for to_tsvector
Date
Msg-id 17158.1426090040@sss.pgh.pa.us
Whole thread Raw
In response to Re: procost for to_tsvector  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: procost for to_tsvector  (Andres Freund <andres@2ndquadrant.com>)
Re: procost for to_tsvector  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
List pgsql-hackers
Andres Freund <andres@2ndquadrant.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



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Doing better at HINTing an appropriate column within errorMissingColumn()
Next
From: Andrew Dunstan
Date:
Subject: Re: mogrify and indent features for jsonb