pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: William Yu <wyu@talisys.com>
To: pgsql-performance@postgresql.org
Subject: Re: Forcing use of specific index
Date: Fri, 03 Jun 2005 16:22:49 -0700
Message-ID: <d7qooc$4pf$1@news.hub.org> (raw)
In-Reply-To: <20050602020528.GL26100@tobias.exoweb.net>
References: <20050602020528.GL26100@tobias.exoweb.net>

A pretty awful way is to mangle the sql statement so the other field 
logical statements are like so:

select * from mytable where 0+field = 100




Tobias Brox wrote:
> Is it any way to attempt to force the planner to use some specific index
> while creating the plan?  Other than eventually dropping all the other
> indices (which is obiously not a solution in production setting anyway)?
> 
> I have one case where I have added 16 indices to a table, many of them
> beeing partial indices.  The table itself has only 50k of rows, but are
> frequently used in heavy joins.  I imagine there can be exponential order on
> the number of alternative paths the planner must examinate as function of
> the number of indices?
> 
> It seems to me that the planner is quite often not choosing the "best"
> index, so I wonder if there is any easy way for me to check out what the
> planner think about a specific index :-)
> 



view thread (4+ messages)  latest in thread

Message-ID: <d7qooc$4pf$1@news.hub.org>
Permalink:  ../d7qooc$4pf$1@news.hub.org/
Also on:    postgresql.org/message-id/d7qooc$4pf$1@news.hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: wyu@talisys.com
  Subject: Re: Forcing use of specific index
  In-Reply-To: <d7qooc$4pf$1@news.hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox