Re: Limit clause not using index

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Limit clause not using index
Дата
Msg-id 17468.1119388807@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Limit clause not using index  (Tobias Brox <tobias@nordicbet.com>)
Ответы Re: Limit clause not using index  (Tobias Brox <tobias@nordicbet.com>)
Список pgsql-performance
Tobias Brox <tobias@nordicbet.com> writes:
> [John A Meinel - Tue at 10:14:24AM -0500]
>> I believe if you drop the indexes inside a transaction, they will still
>> be there for other queries, and if you rollback instead of commit, you
>> won't lose anything.

> Has anyone tested this?

Certainly.  Bear in mind though that DROP INDEX will acquire exclusive
lock on the index's table, so until you roll back, no other transaction
will be able to touch the table at all.  So the whole thing may be a
nonstarter in a production database anyway :-(.  You can probably get
away with
    BEGIN;
    DROP INDEX ...
    EXPLAIN ...
    ROLLBACK;
if you fire it from a script rather than by hand --- but EXPLAIN
ANALYZE might be a bad idea ...

            regards, tom lane

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

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: Limit clause not using index
Следующее
От: PFC
Дата:
Сообщение: Re: Querying 19million records very slowly