Search Postgresql Archives

Re: should I increase default_statistics_target

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

 



Hi,

On 20 September 2012 20:49, AI Rumman <rummandba@xxxxxxxxx> wrote:
> Using explain analyze of a large query I found that in every step there are
> a lot difference between the number of rows  between actual and estimated.
> I am using default_statistics_target 200. Should I increase it?

I would keep it at default level but I would increase it per column:
ALTER TABLE <table> ALTER <column> SET STATISTICS <number>

and you can do the same for index:

ALTER TABLE <index_name> ALTER COLUMN <column> SET STATISTICS <number>

(for function indexes you need to use \d in order to see "real" column name)

Finally, you need to run analyse on that table / column

-- 
Ondrej Ivanic
(ondrej.ivanic@xxxxxxxxx)


-- 
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