From: Gregory Williamson <Gregory.Williamson@digitalglobe.com>
To: pgsql-performance@postgresql.org
Subject: FW: optimize query with a maximum(date) extraction
Date: Wed, 5 Sep 2007 05:06:43 -0600
Message-ID: <8B319E5A30FF4A48BE7EEAAF609DB233015E2AE7@COMAIL01.digitalglobe.com> (raw)
References: <302443.65402.qm@web26209.mail.ukl.yahoo.com>
<8B319E5A30FF4A48BE7EEAAF609DB233015E2AE6@COMAIL01.digitalglobe.com>
bad address kep his from going to the list on my first try ... apologies to the moderators.
-----Original Message-----
From: Gregory Williamson
Sent: Wed 9/5/2007 4:59 AM
To: JS Ubei; pgsql-performance@postgresql.org
Subject: RE: [PERFORM] optimize query with a maximum(date) extraction
In order to help others help you, you might provide the following:
table description (columns, types, indexes) (\d tablename from psql does nicely)
the same query run as "EXPLAIN ANALYZE <your query here>;"
Greg Williamson
Senior DBA
GlobeXplorer LLC, a DigitalGlobe company
Confidentiality Notice: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information and must be protected in accordance with those provisions. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
(My corporate masters made me say this.)
-----Original Message-----
From: pgsql-performance-owner@postgresql.org on behalf of JS Ubei
Sent: Wed 9/5/2007 3:53 AM
To: pgsql-performance@postgresql.org
Subject: [PERFORM] optimize query with a maximum(date) extraction
Hi all,
I need to improve a query like :
SELECT id, min(the_date), max(the_date) FROM my_table GROUP BY id;
Stupidly, I create a B-tree index on my_table(the_date), witch is logically not used in my query, because it's not with a constant ? isn't it ?
I know that I can't create a function index with an aggregative function.
How I can do ?
thanks,
jsubei
_____________________________________________________________________________
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail
---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings
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: Gregory.Williamson@digitalglobe.com
Subject: Re: FW: optimize query with a maximum(date) extraction
In-Reply-To: <8B319E5A30FF4A48BE7EEAAF609DB233015E2AE7@COMAIL01.digitalglobe.com>
References: <302443.65402.qm@web26209.mail.ukl.yahoo.com> <8B319E5A30FF4A48BE7EEAAF609DB233015E2AE6@COMAIL01.digitalglobe.com> <8B319E5A30FF4A48BE7EEAAF609DB233015E2AE7@COMAIL01.digitalglobe.com>
* 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