Re: Why does the query planner use two full indexes, when a dedicated partial index exists? (solved?)

Поиск
Список
Период
Сортировка
От John Rouillard
Тема Re: Why does the query planner use two full indexes, when a dedicated partial index exists? (solved?)
Дата
Msg-id 20121224204252.GG7039@renesys.com
обсуждение исходный текст
Ответ на Re: Why does the query planner use two full indexes, when a dedicated partial index exists? (solved?)  (Richard Neill <rn214@richardneill.org>)
Ответы Re: Why does the query planner use two full indexes, when a dedicated partial index exists? (solved?)
Список pgsql-performance
On Mon, Dec 24, 2012 at 06:37:11PM +0000, Richard Neill wrote:
> [...]
> So... problem solved for me: I just have to reindex every few hours.
> BUT, this suggests a few remaining things:
> [...]
> 2. Is there any way to force the planner to use (or ignore) a
> specific index, for testing purposes, short of actually dropping the
> index?
> This would be very useful for debugging, especially given that query
> plans can only really be fully tested on production systems, and
> that dropping indexes is rather a bad thing to do when live
> operation is simultaneously happening on that server!

I believe that:

  BEGIN;
  drop index ....
  explain analyze ...
  explain analyze ...
  ROLLBACK;

will do what you want. IIUC Postgres allows DDL within transactions
and thus be rolled back and the operations within the transaction
aren't visible to your other queries running outside the transaction.

  http://wiki.postgresql.org/wiki/Transactional_DDL_in_PostgreSQL:_A_Competitive_Analysis

and

  http://www.postgresql.org/docs/9.2/static/sql-dropindex.html

--
                -- rouilj

John Rouillard       System Administrator
Renesys Corporation  603-244-9084 (cell)  603-643-9300 x 111


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

Предыдущее
От: Charles Gomes
Дата:
Сообщение: Re: Performance on Bulk Insert to Partitioned Table
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: Why does the query planner use two full indexes, when a dedicated partial index exists?