pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PFC <lists@boutiquenumerique.com>
To: Szűcs Gábor <surrano@gmail.com>
To: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: where+orderby+limit not (always) using appropriate index?
Date: Wed, 18 May 2005 17:06:51 +0200
Message-ID: <op.sqy79pi8th1vuj@localhost> (raw)
In-Reply-To: <428B5179.6060202@gmail.com>
References: <428B5179.6060202@gmail.com>



> SELECT o FROM t WHERE i = 1 ORDER BY o LIMIT 1;

	use :
	ORDER BY i, o

	If you have a multicol index and want to order on it, you should help the  
planner by ORDERing BY all of the columns in the index...
	It bit me a few times ;)



view thread (3+ messages)  latest in thread

Message-ID: <op.sqy79pi8th1vuj@localhost>
Permalink:  ../op.sqy79pi8th1vuj@localhost/
Also on:    postgresql.org/message-id/op.sqy79pi8th1vuj@localhost

 · 

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: lists@boutiquenumerique.com, surrano@gmail.com
  Subject: Re: where+orderby+limit not (always) using appropriate index?
  In-Reply-To: <op.sqy79pi8th1vuj@localhost>

* 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