Re: [HACKERS] procost for to_tsvector

2015-05-03 Thread Tom Lane
I wrote: > Andrew Gierth writes: >> "Tom" == Tom Lane writes: >> Tom> and some experiments of my own, but I wonder why we are only >> Tom> thinking of to_tsvector. Isn't to_tsquery, for example, just >> Tom> about as expensive? What of other text search functions? >> Making the same change for

Re: [HACKERS] procost for to_tsvector

2015-05-01 Thread Tom Lane
Andrew Gierth writes: > "Tom" == Tom Lane writes: >>> In the OP, he suggested "on the order of 100". Maybe we could just >>> go with 100. > Tom> I'm OK with that in view of <87h9trs0zm@news-spur.riddles.org.uk> > Note that the results from that post suggest 100 as a bare minimum, > higher

Re: [HACKERS] procost for to_tsvector

2015-05-01 Thread Andrew Gierth
> "Tom" == Tom Lane writes: >> In the OP, he suggested "on the order of 100". Maybe we could just >> go with 100. Tom> I'm OK with that in view of <87h9trs0zm@news-spur.riddles.org.uk> Note that the results from that post suggest 100 as a bare minimum, higher values would be quite r

Re: [HACKERS] procost for to_tsvector

2015-05-01 Thread Tom Lane
Robert Haas writes: > In the OP, he suggested "on the order of 100". Maybe we could just go with > 100. I'm OK with that in view of <87h9trs0zm@news-spur.riddles.org.uk> and some experiments of my own, but I wonder why we are only thinking of to_tsvector. Isn't to_tsquery, for example, jus

Re: [HACKERS] procost for to_tsvector

2015-05-01 Thread Andres Freund
On 2015-05-01 10:03:01 -0400, Robert Haas wrote: > Maybe we could just go with 100. +1 Greetings, Andres Freund -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] procost for to_tsvector

2015-05-01 Thread Bruce Momjian
On Fri, May 1, 2015 at 10:03:01AM -0400, Robert Haas wrote: > On Fri, May 1, 2015 at 10:01 AM, Bruce Momjian wrote: > >> Andrew did the research to support a higher value, but even 10 should > >> be an improvement over what we have now. > > > > Yes, I saw that, but I didn't see him recommend an a

Re: [HACKERS] procost for to_tsvector

2015-05-01 Thread Robert Haas
On Fri, May 1, 2015 at 10:01 AM, Bruce Momjian wrote: >> Andrew did the research to support a higher value, but even 10 should >> be an improvement over what we have now. > > Yes, I saw that, but I didn't see him recommend an actual number. Can > someone recommend a number now? Tom initially re

Re: [HACKERS] procost for to_tsvector

2015-05-01 Thread Bruce Momjian
On Fri, May 1, 2015 at 09:39:43AM -0400, Robert Haas wrote: > On Fri, May 1, 2015 at 9:13 AM, Bruce Momjian wrote: > > On Fri, May 1, 2015 at 07:57:27AM -0400, Robert Haas wrote: > >> On Thu, Apr 30, 2015 at 9:34 PM, Bruce Momjian wrote: > >> > On Wed, Mar 11, 2015 at 02:40:16PM +, Andrew G

Re: [HACKERS] procost for to_tsvector

2015-05-01 Thread Robert Haas
On Fri, May 1, 2015 at 9:13 AM, Bruce Momjian wrote: > On Fri, May 1, 2015 at 07:57:27AM -0400, Robert Haas wrote: >> On Thu, Apr 30, 2015 at 9:34 PM, Bruce Momjian wrote: >> > On Wed, Mar 11, 2015 at 02:40:16PM +, Andrew Gierth wrote: >> >> An issue that comes up regularly on IRC is that te

Re: [HACKERS] procost for to_tsvector

2015-05-01 Thread Bruce Momjian
On Fri, May 1, 2015 at 07:57:27AM -0400, Robert Haas wrote: > On Thu, Apr 30, 2015 at 9:34 PM, Bruce Momjian wrote: > > On Wed, Mar 11, 2015 at 02:40:16PM +, Andrew Gierth wrote: > >> An issue that comes up regularly on IRC is that text search queries, > >> especially on relatively modest siz

Re: [HACKERS] procost for to_tsvector

2015-05-01 Thread Robert Haas
On Thu, Apr 30, 2015 at 9:34 PM, Bruce Momjian wrote: > On Wed, Mar 11, 2015 at 02:40:16PM +, 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

Re: [HACKERS] procost for to_tsvector

2015-04-30 Thread Bruce Momjian
On Wed, Mar 11, 2015 at 02:40:16PM +, 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.

Re: [HACKERS] procost for to_tsvector

2015-03-11 Thread Jeff Janes
On Wed, Mar 11, 2015 at 2:54 PM, Andrew Gierth wrote: > Seq Scan on comments (cost=0.00..2406.18 rows=4140 width=792) (actual > time=0.601..3946.589 rows=4056 loops=1) > > Bitmap Heap Scan on comments (cost=204.09..2404.30 rows=4140 width=792) > (actual time=2.401..11.564 rows=4056 loops=1

Re: [HACKERS] procost for to_tsvector

2015-03-11 Thread Andrew Gierth
> "Tom" == Tom Lane writes: Tom> Nyet ... at least not without you actually making that argument, Tom> with numbers, rather than just handwaving. We use 100 for plpgsql Tom> and suchlike functions. I'd be OK with making it 10 just on Tom> general principles, but claiming that it's as ex

Re: [HACKERS] procost for to_tsvector

2015-03-11 Thread Andres Freund
On 2015-03-11 12:07:20 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2015-03-11 14:40:16 +, Andrew Gierth wrote: > >> ,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 m

Re: [HACKERS] procost for to_tsvector

2015-03-11 Thread Tom Lane
Andres Freund writes: > On 2015-03-11 14:40:16 +, 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 we

Re: [HACKERS] procost for to_tsvector

2015-03-11 Thread Andres Freund
Hi, On 2015-03-11 14:40:16 +, 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

[HACKERS] procost for to_tsvector

2015-03-11 Thread Andrew Gierth
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. Clearly this cost number is ludicrous. Getting the right cost estima