Re: Problems with genetic optimizer - Mailing list pgsql-general

From Tom Lane
Subject Re: Problems with genetic optimizer
Date
Msg-id 26614.972430003@sss.pgh.pa.us
Whole thread Raw
In response to Problems with genetic optimizer  (Peter Keller <peter.keller@bvv.bayern.de>)
List pgsql-general
Peter Keller <peter.keller@bvv.bayern.de> writes:
> I generated a table with a column type 'box', inserted some values and
> created an index (ops_box) on that column, run a vacuum and looked with
> the command EXPLAIN if the select will use the index.
> And the result was very astonishing:
> if I had inserted 120000 elements postgres will _NOT_ use the index, if
> I had inserted 100000 elements postgres will use the index!

Hmm.  The system's knowledge of selectivities for R-tree indexes is
essentially nil; perhaps someone will be motivated to improve that
someday.  In the meantime, the entirely bogus numbers returned by
src/backend/utils/adt/geo_selfuncs.c are supposed to be small enough
to ensure that R-trees are used if available.  What was your test
query exactly, and what do you get from EXPLAIN with and without
forcing enable_seqscan off?

            regards, tom lane

pgsql-general by date:

Previous
From: Larry Rosenman
Date:
Subject: Re: Re: PL/Perl compilation error
Next
From: Tom Lane
Date:
Subject: Re: How do I find out the version number