How can I manually alter the statistics for a column?

Поиск
Список
Период
Сортировка
От Douglas Alan
Тема How can I manually alter the statistics for a column?
Дата
Msg-id ce6334d00906011120o68aa7507ya83980311c4e896b@mail.gmail.com
обсуждение исходный текст
Ответы Re: How can I manually alter the statistics for a column?  (Douglas Alan <darkwater42@gmail.com>)
Re: How can I manually alter the statistics for a column?  (Isak Hansen <isak.hansen@gmail.com>)
Список pgsql-general
I'd like to manually alter the statistics for a column, as for the column in question the statistics are causing Postgres to do the wrong thing for my purposes. (I.e., a Seq Scan, rather than an Index Scan.)  If someone can tell me how to achieve this, I would quite grateful.

Thanks!
|>ouglas


P.S. Actually, for this particular problem, just deleting the statistics would be fine.  I've tried doing:

alter table maindb_astobject alter column survey_id set statistics 0;

And then analyzing the column, but when "statistics"  for a column are set to 0, Postgres seems to leave the current statistics in place, which is not the right thing for me at all.  I can successfully set "statistics" to 1, but that turns out to be one statistic too many.

I've tried settings the statistics via the table "pg_stats", but that turns out to be a view, and Postgres won't allow to me to alter it.

Perhaps I can achieve the end by altering the "pg_statistic" table instead, but that table is more than a bit opaque to me.

P.P.S The Seq Scan is 2-4 orders of magnitude slower than the Index Scan.



В списке pgsql-general по дате отправления:

Предыдущее
От: Sava Chankov
Дата:
Сообщение: INSERT RETURNING rule for joined view
Следующее
От: Tom Lane
Дата:
Сообщение: Re: INSERT RETURNING rule for joined view