Skip site navigation (1) Skip section navigation (2)

Re: Full text search with ORDER BY performance issue

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>, Krade <krade(at)krade(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Full text search with ORDER BY performance issue
Date: 2009-07-29 15:29:46
Message-ID: 18985.1248881386@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> Hmm, good point.  It seems like it would be useful to force the
> planner into use the other plan and get EXPLAIN ANALYZE output for
> that for comparison purposes, but off the top of my head I don't know
> how to do that.

The standard way is

	begin;
	drop index index_you_dont_want_used;
	explain problem-query;
	rollback;

Ain't transactional DDL wonderful?

(If this is a production system, you do have to worry about the DROP
transiently locking the table; but if you put the above in a script
rather than doing it by hand, it should be fast enough to not be a big
problem.)

			regards, tom lane

In response to

Responses

pgsql-performance by date

Next:From: Robert HaasDate: 2009-07-29 15:37:14
Subject: Re: Full text search with ORDER BY performance issue
Previous:From: Robert HaasDate: 2009-07-29 15:13:34
Subject: Re: Full text search with ORDER BY performance issue

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group