Re: Query planner always has exactly half of the rows in the table as "plan rows" with new GIST operator class - Mailing list pgsql-general

From Tom Lane
Subject Re: Query planner always has exactly half of the rows in the table as "plan rows" with new GIST operator class
Date
Msg-id 3462.1320086509@sss.pgh.pa.us
Whole thread Raw
In response to Query planner always has exactly half of the rows in the table as "plan rows" with new GIST operator class  (Adrian Schreyer <ams214@cam.ac.uk>)
List pgsql-general
Adrian Schreyer <ams214@cam.ac.uk> writes:
> I have added a GIST operator class to a custom data type in
> PostgreSQL. The index returns the correct results and the build speed
> is fairly good as well. There is one problem however that is
> presumably linked to the picksplit function (?) - the query planner
> always returns half  of all the rows in the table as (after vacuum)
> "Plan Rows".

Uh, no, picksplit is not where your problem is.  You need to provide a
selectivity estimation function for your indexable operator.  It sounds
like you don't have one at all, and restriction_selectivity() is
defaulting to 0.5.

            regards, tom lane

pgsql-general by date:

Previous
From: Adrian Schreyer
Date:
Subject: Query planner always has exactly half of the rows in the table as "plan rows" with new GIST operator class
Next
From: Tarlika Elisabeth Schmitz
Date:
Subject: Re: [PL/pgSQL] function call