From: Kevin Schroeder <mirage@mirageworks.com>
To: pgsql-performance@postgresql.org
Subject: Query problem fixed
Date: Thu, 29 May 2003 09:09:23 -0500
Message-ID: <006d01c325eb$eb72fdf0$0200a8c0@WORKSTATION> (raw)
I figured out how to make the query faster. There should be a mailing list
set up for wasted questions since I always seem to figure out the problem
after I've bugged everyone for help.
In the query
select row_key, column1, column2, column3, column4, column5 from table1
where column6 = 1 order by column3 desc limit 21;
I changed the index to
message_index btree (column3, column6)
rather than
message_index btree (column6, column3, column7)
Since the data was being ordered by column3 it seems to have sped the query
up to 1 ms from 6000ms by making column 3 the first part of the index rather
than the second.
Kevin
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: mirage@mirageworks.com
Subject: Re: Query problem fixed
In-Reply-To: <006d01c325eb$eb72fdf0$0200a8c0@WORKSTATION>
References: <006d01c325eb$eb72fdf0$0200a8c0@WORKSTATION>
* 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