Re: temporarily deactivate an index

Поиск
Список
Период
Сортировка
От Jaime Casanova
Тема Re: temporarily deactivate an index
Дата
Msg-id c2d9e70e0806080655t52aab50s8eed0d75675b8117@mail.gmail.com
обсуждение исходный текст
Ответ на Re: temporarily deactivate an index  ("Scott Marlowe" <scott.marlowe@gmail.com>)
Ответы Re: temporarily deactivate an index
Список pgsql-general
On Sun, Jun 8, 2008 at 1:34 AM, Scott Marlowe <scott.marlowe@gmail.com> wrote:
> On Sat, Jun 7, 2008 at 5:16 PM, Viktor Rosenfeld
> <rosenfel@informatik.hu-berlin.de> wrote:
>>>
>>> Try this:
>>>
>>> begin;
>>> drop indexname;
>>> explain analyze select ...;
>>> rollback;
>>
>> That works, but I'm still looking for another way to deactivate the index.
>>  The reason being, that my query load is randomly generated by a Java
>> program and I don't want to go and change the SQL compiler.
>
> Sorry, I'm out of ideas.  I mean, you can turn off all indexes with
> set enable_indexscan=off but there's no other way to do it cheaply and
> in such a fine grained way.
>

with "enable_indexscan=off" you're not turning indexes off but putting
a high cost in using them... the effect, most of the time, is that
indexes will not be used but you can't be sure...

the better solution was the first one: dropping the index inside a
transaction, execute the explain analyze of the query and rollback the
transaction

--
regards,
Jaime Casanova
Soporte y capacitación de PostgreSQL
Guayaquil - Ecuador
Cel. (593) 87171157

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

Предыдущее
От: Oliver Kohll
Дата:
Сообщение: libpq.so.4
Следующее
От: "Scott Marlowe"
Дата:
Сообщение: Re: temporarily deactivate an index