pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: Madison Kelly <linux@alteeve.com>
Cc: Tobias Brox <tobias@nordicbet.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Index ot being used
Date: Sun, 12 Jun 2005 12:37:32 -0500
Message-ID: <20050612173732.GA28838@wolff.to> (raw)
In-Reply-To: <42AC42CB.8050703@alteeve.com>
References: <1825.216.209.137.1.1118419819.squirrel@mail.alteeve.com>
	<20050610155535.GO8451@tobias.nordicbet.com>
	<42AC42CB.8050703@alteeve.com>

On Sun, Jun 12, 2005 at 10:12:27 -0400,
  Madison Kelly <linux@alteeve.com> wrote:
> Indexes:
>     "file_info_7_display_idx" btree (file_type, file_parent_dir, file_name)

>   Here is my full query:
> 
> tle-bu=> EXPLAIN ANALYZE SELECT file_name, file_parent_dir, file_type 
> FROM file_info_7 WHERE file_type='d' ORDER BY file_parent_dir ASC, 
> file_name ASC;
>                                                          QUERY PLAN
> -----------------------------------------------------------------------------------------------------------------------------

This is a case where postgres's planner can't make a deduction needed for
it to realize that the index can be used. Try rewriting the query as:

SELECT file_name, file_parent_dir, file_type 
  FROM file_info_7 WHERE file_type='d'
  ORDER BY file_type ASC, file_parent_dir ASC, file_name ASC;



view thread (31+ messages)  latest in thread

Message-ID: <20050612173732.GA28838@wolff.to>
Permalink:  ../20050612173732.GA28838@wolff.to/
Also on:    postgresql.org/message-id/20050612173732.GA28838@wolff.to

 · 

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: bruno@wolff.to, linux@alteeve.com, tobias@nordicbet.com
  Subject: Re: Index ot being used
  In-Reply-To: <20050612173732.GA28838@wolff.to>

* 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