Re: cannot get stable function to use index - Mailing list pgsql-general

From Tom Lane
Subject Re: cannot get stable function to use index
Date
Msg-id 20564.1451500547@sss.pgh.pa.us
Whole thread Raw
In response to Re: cannot get stable function to use index  (Andy Colson <andy@squeakycode.net>)
Responses Re: cannot get stable function to use index  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Andy Colson <andy@squeakycode.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


pgsql-general by date:

Previous
From: Andy Colson
Date:
Subject: Re: cannot get stable function to use index
Next
From: Tom Lane
Date:
Subject: Re: cannot get stable function to use index