Re: [PERFORM] Query performance issue

2011-08-31 Thread Sushant Sinha
Where is the query? And also paste the \d to show the tables and indexes. -Sushant. On Wed, 2011-08-31 at 14:30 +0530, Jayadevan M wrote: > Hello all, > I have a query which takes about 20 minutes to execute and retrieves > 2000-odd records. The explain for the query is pasted here > http://exp

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 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 @@ &

[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