| From: | Andres Freund <andres(at)2ndquadrant(dot)com> |
|---|---|
| To: | Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk> |
| Cc: | pgsql-hackers(at)postgresql(dot)org |
| Subject: | Re: procost for to_tsvector |
| Date: | 2015-03-11 14:44:31 |
| Message-ID: | 20150311144431.GK12445@alap3.anarazel.de |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi,
On 2015-03-11 14:40:16 +0000, Andrew Gierth wrote:
> An issue that comes up regularly on IRC is that text search queries,
> especially on relatively modest size tables or for relatively
> non-selective words, often misplan as a seqscan based on the fact that
> to_tsvector has procost=1.
I've also seen this regularly outside IRC.
> Clearly this cost number is ludicrous.
Yea.
> 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 ;)
> ,but even without doing that, there's a strong
> argument that it should be increased to at least the order of 100.
> (With the default cpu_operator_cost that would make each to_tsvector
> call cost 0.25.)
100 sounds good to me. IIRC that's what has been proposed before.
Greetings,
Andres Freund
--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Sawada Masahiko | 2015-03-11 14:46:55 | Re: Proposal: knowing detail of config files via SQL |
| Previous Message | Andrew Gierth | 2015-03-11 14:40:16 | procost for to_tsvector |