Re: Random resultset retrieving -> performance bottleneck

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Random resultset retrieving -> performance bottleneck
Дата
Msg-id 20020802070832.Y39893-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на Random resultset retrieving -> performance bottleneck  (Cédric Dufour <cedric.dufour@freesurf.ch>)
Список pgsql-sql
On Thu, 1 Aug 2002, [iso-8859-1] C�dric Dufour wrote:

> *****
> * 2.
> *****
> BEGIN;
> SET CONSTRAINTS ALL DEFERRED;
> CREATE TEMP TABLE tmp_Large AS SELECT * FROM tb_Table;
> DELETE FROM tb_Large; -- won't work; RI violation on foreign key
> 'tb_Foo(FK_Large)'
> INSERT INTO tb_Large SELECT * FROM tb_Table ORDER BY Random;
> DROP TABLE tmp_Large;
> COMMIT;
>
> -> Would preserve oids, constraints and indexes... BUT DELETE IS IMPOSSIBLE,
> BECAUSE REFERENTIAL INTEGRITY IS VIOLATED ON FOREIGN KEY 'FK_Large' IN TABLE
> 'tb_Foo', despite the SET CONSTRAINTS ALL DEFERRED clause

Yeah, there's been a bug that should now be patched for upcoming 7.3
that caused this to fail.  I believe you should be able to find the
patch if you search -patches since it was pretty recent.  It might take a
little work to patch to a previous version, but it shouldn't be too hard.

Failing that, you can turn off all triggers (look at the output of
a data only pg_dump for queries to turn off/on trigger).



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

Предыдущее
От: Cédric Dufour (Cogito Ergo Soft)
Дата:
Сообщение: Re: How to optimize SQL query ?
Следующее
От: "Rajesh Kumar Mallah."
Дата:
Сообщение: possible bug in \df+