Re: Force specific index disuse

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Force specific index disuse
Date: 2014-05-20 17:44:02
Message-ID: 20140520174402.GI7857@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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;

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Crawford 2014-05-20 18:43:57 Re: Force specific index disuse
Previous Message Seamus Abshere 2014-05-20 16:44:49 Re: Force specific index disuse