Re: [PERFORM] sequential scan unduly favored over text search gin index

2011-06-29 Thread Jeff Janes
On Mon, Jun 20, 2011 at 10:53 PM, Tom Lane wrote: > Sushant Sinha writes: >>> I guess you could poke the planner towards the bitmap scan by lowering >>> the random_page_cost (the default value is 4, I'd say lowering it to 2 >>> should do the trick). > >> The numbers that I gave was after setting

Re: [PERFORM] sequential scan unduly favored over text search gin index

2011-06-29 Thread Jeff Janes
On Mon, Jun 20, 2011 at 8:38 AM, Sushant Sinha wrote: > > postgres version 9.0.2 > statistics on docvector is set to 1 and as you can see the row > estimates are fine. > > lawdb=# \d docmeta1 >       Table "public.docmeta1" >   Column    |   Type    | Modifiers > -+---+

Re: [PERFORM] sequential scan unduly favored over text search gin index

2011-06-20 Thread Tom Lane
Sushant Sinha writes: >> I guess you could poke the planner towards the bitmap scan by lowering >> the random_page_cost (the default value is 4, I'd say lowering it to 2 >> should do the trick). > The numbers that I gave was after setting random_page_cost = 1.0 After > this I don't know what to d

Re: [PERFORM] sequential scan unduly favored over text search gin index

2011-06-20 Thread Sushant Sinha
> > I agree the estimates are damn precise in this case (actually the > estimates are exact). The problem is the planner thinks the seq scan is > about 30% cheaper than the bitmap index scan. > > I guess you could poke the planner towards the bitmap scan by lowering > the random_page_cost (the d

Re: [PERFORM] sequential scan unduly favored over text search gin index

2011-06-20 Thread Tomas Vondra
Dne 20.6.2011 18:04, Sushant Sinha napsal(a): > > On Mon, 2011-06-20 at 10:58 -0500, Kevin Grittner wrote: >> Sushant Sinha wrote: >> >>> I have a tsvector column docvector and a gin index on it >>> docmeta1_docvector_idx >>> >>> I have a simple query "select * from docmeta1 where docvector @@

Re: [PERFORM] sequential scan unduly favored over text search gin index

2011-06-20 Thread Jesper Krogh
On 2011-06-20 17:38, Sushant Sinha wrote: I have a tsvector column docvector and a gin index on it docmeta1_docvector_idx I have a simple query "select * from docmeta1 where docvector @@ plainto_tsquery('english', 'free');" I find that the planner chooses a sequential scan of the table even whe

Re: [PERFORM] sequential scan unduly favored over text search gin index

2011-06-20 Thread Sushant Sinha
On Mon, 2011-06-20 at 10:58 -0500, Kevin Grittner wrote: > Sushant Sinha wrote: > > > I have a tsvector column docvector and a gin index on it > > docmeta1_docvector_idx > > > > I have a simple query "select * from docmeta1 where docvector @@ > > plainto_tsquery('english', 'free');" > > > >

Re: [PERFORM] sequential scan unduly favored over text search gin index

2011-06-20 Thread Kevin Grittner
Sushant Sinha wrote: > I have a tsvector column docvector and a gin index on it > docmeta1_docvector_idx > > I have a simple query "select * from docmeta1 where docvector @@ > plainto_tsquery('english', 'free');" > > I find that the planner chooses a sequential scan of the table > even when t

[PERFORM] sequential scan unduly favored over text search gin index

2011-06-20 Thread Sushant Sinha
I have a tsvector column docvector and a gin index on it docmeta1_docvector_idx I have a simple query "select * from docmeta1 where docvector @@ plainto_tsquery('english', 'free');" I find that the planner chooses a sequential scan of the table even when the index performs orders of magnitude. I