Re: cannot get stable function to use index

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andy Colson <andy(at)squeakycode(dot)net>
Cc: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: cannot get stable function to use index
Date: 2015-12-30 18:35:47
Message-ID: 20564.1451500547@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Andy Colson <andy(at)squeakycode(dot)net> writes:
> No, that's not right, the table was empty. I rebuilt the table as it
> was before, here are all three queries again:

Ah, thanks for the more solid data.

> -> Bitmap Index Scan on search_key (cost=0.00..63623.00 rows=1 width=0) (actual time=4.996..4.996 rows=1 loops=1)
> Index Cond: (search_vec @@ to_tsquery('213 & E & 13 & ST & N:*'::text))

> -> Bitmap Index Scan on search_key (cost=0.00..23.00 rows=1 width=0) (actual time=4.057..4.057 rows=1 loops=1)
> Index Cond: (search_vec @@ to_tsquery('213 & E & 13 & ST & N'::text))

This says there's only about a 25% runtime penalty for the partial match,
at least on your example, compared to the planner's estimate of 2700x
penalty :-(. Definitely need to fix that.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2015-12-30 19:07:08 Re: cannot get stable function to use index
Previous Message Andy Colson 2015-12-30 18:02:27 Re: cannot get stable function to use index