Re: Force specific index disuse

Поиск
Список
Период
Сортировка
От Steve Crawford
Тема Re: Force specific index disuse
Дата
Msg-id 537BA38F.4070806@pinpointresearch.com
обсуждение исходный текст
Ответ на Re: Force specific index disuse  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: Force specific index disuse  (Steve Crawford <scrawford@pinpointresearch.com>)
Re: Force specific index disuse  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Force specific index disuse  (David G Johnston <david.g.johnston@gmail.com>)
Re: Force specific index disuse  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: Force specific index disuse  (Jeff Janes <jeff.janes@gmail.com>)
Список pgsql-general
On 05/20/2014 10:44 AM, Alvaro Herrera wrote:
> Steve Crawford wrote:
>> Is there a way to force a specific index to be removed from
>> consideration in planning a single query?
>>
>> Specifically, on a 60-million-row table I have an index that is a
>> candidate for removal. I have identified the sets of nightly queries
>> that use the index but before dropping it I would like to run
>> EXPLAIN and do timing tests on the queries to see the impact of not
>> having that index available and rewrite the query to efficiently use
>> other indexes if necessary.
> If you can afford to lock the table for a while, the easiest is
>
> BEGIN;
> DROP INDEX bothersome_idx;
> EXPLAIN your_query;
> ROLLBACK;
>
Interesting. But what do you mean by "a while?" Does the above keep the
index intact (brief lock) or does it have to rebuild it on rollback?

What would happen if you did:
BEGIN;
DROP INDEX bothersome_idx;
INSERT INTO indexed_table...;
ROLLBACK;

Cheers,
Steve



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

Предыдущее
От: Steve Crawford
Дата:
Сообщение: Re: Force specific index disuse
Следующее
От: Steve Crawford
Дата:
Сообщение: Re: Force specific index disuse