Search Postgresql Archives

Re: Why is the wrong index used? (with "gist" index)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Christian Hammers <ch@xxxxxxxxxxxx> writes:
> Just because I added a "LIMIT 1" to the following query, PostgreSQL decided to
> use a different index which gives a far worse performance :-(

The problem is the off-by-four-orders-of-magnitude rowcount estimate
(20949 rows estimated to match, only 2 actually do).  You need to get
that to be closer to reality.  I'm not sure if increasing the statistics
target would help --- it depends on whether the prefix extension has any
non-dummy selectivity estimation support.  If not, you might want to
consider switching to a more-fully-supported data type.

			regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux