From: Daniel Caune <daniel.caune@ubisoft.com>
To: pgsql-sql@postgresql.org
Subject: CREATE INDEX with order clause
Date: Wed, 1 Feb 2006 10:46:03 -0500
Message-ID: <1E293D3FF63A3740B10AD5AAD88535D20171B758@UBIMAIL1.ubisoft.org> (raw)
Hi,
I would like to create an index on a table, specifying an order clause
for one of the columns.
CREATE INDEX IDX_GSLOG_EVENT_PLAYER_EVENT_TIME_DESC
ON GSLOG_EVENT(PLAYER_USERNAME,
EVENT_NAME,
EVENT_DATE_CREATED DESC);
which is not a valid, as the order clause DESC is not supported. Such
as index would improve performance of query like:
SELECT GAME_CLIENT_VERSION
FROM GSLOG_EVENT
WHERE PLAYER_USERNAME = ?
AND EVENT_NAME = ?
AND EVENT_DATE_CREATED < ?
ORDER BY EVENT_DATE_CREATED DESC
LIMIT 1
Actually, I'm not sure that is useful; perhaps PostgreSQL handles pretty
well such query using an index such as:
CREATE INDEX IDX_GSLOG_EVENT_PLAYER_EVENT_TIME_DESC
ON GSLOG_EVENT(PLAYER_USERNAME,
EVENT_NAME,
EVENT_DATE_CREATED);
Any idea?
--
Daniel CAUNE
Ubisoft Online Technology
(514) 4090 2040 ext. 5418
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-sql@postgresql.org
Cc: daniel.caune@ubisoft.com
Subject: Re: CREATE INDEX with order clause
In-Reply-To: <1E293D3FF63A3740B10AD5AAD88535D20171B758@UBIMAIL1.ubisoft.org>
References: <1E293D3FF63A3740B10AD5AAD88535D20171B758@UBIMAIL1.ubisoft.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