Re: Planner selects different execution plans depending on limit

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jesper Krogh <jesper(at)krogh(dot)cc>
Cc: Bill Martin <bill(dot)martin(at)communote(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Planner selects different execution plans depending on limit
Date: 2012-09-13 14:54:19
Message-ID: 26906.1347548059@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-performance

Jesper Krogh <jesper(at)krogh(dot)cc> writes:
> On 13/09/12 16:42, Bill Martin wrote:
>> Yes, I've run the ANALYZE command. Regards, Bill Martin

> The main problem in your case is actually that you dont store the
> tsvector in the table.

Oh, duh, obviously I lack caffeine this morning.

> If you store to_tsvector('simple',content.content) in a column in
> the database and search against that instead
> then you'll allow PG to garther statistics on the column and make the
> query-planner act according to that.

He can do it without having to change his schema --- but it's the index
column, not the underlying content column, that needs its statistics
target adjusted.

regards, tom lane

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Bill Martin 2012-09-13 17:19:10 Re: Planner selects different execution plans depending on limit
Previous Message Jesper Krogh 2012-09-13 14:48:07 Re: Planner selects different execution plans depending on limit

Browse pgsql-performance by date

  From Date Subject
Next Message Bill Martin 2012-09-13 17:19:10 Re: Planner selects different execution plans depending on limit
Previous Message Jesper Krogh 2012-09-13 14:48:07 Re: Planner selects different execution plans depending on limit