Re: index creation order?

Поиск
Список
Период
Сортировка
От Chester Kustarz
Тема Re: index creation order?
Дата
Msg-id Pine.BSO.4.44.0310311518100.10754-100000@detroit.arbor.net
обсуждение исходный текст
Ответ на Re: index creation order?  (Josh Berkus <josh@agliodbs.com>)
Ответы Re: index creation order?  (Rod Taylor <rbt@rbt.ca>)
Re: index creation order?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
is there any way to update the stats inside a transaction? what i have is
something like:

select count(*) from foo;
-> 0

begin;

copy foo from '/tmp/foo'; -- about 100k rows

-- run some queries on foo which perform horribly because the stats
-- are way off (100k rows v. 0 rows)

commit;


it seems that you cannot run analyze inside a transaction:

begin;
analyze foo;
ERROR:  ANALYZE cannot run inside a BEGIN/END block

i am using version 7.2.3.

any work-a-rounds? should i try updating pg_statistic manually?

On Fri, 31 Oct 2003, Josh Berkus wrote:
> Among other things, ANALYZE tells postgres how many rows are in the table.  So
> if you add a PK constraint after loading 10 million rows without ANALYZE,
> PostgreSQL is likely to think that there is only one row in the table ... and
> choose a nested loop or some other really inefficient method of checking for
> uniqueness.


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

Предыдущее
От: "scott.marlowe"
Дата:
Сообщение: Re: Pg+Linux swap use
Следующее
От: "PostgreSQL"
Дата:
Сообщение: Postgres 7.3.4 + Slackware 9.1