pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: email lists <lists@darrenmackay.com>
To: pgsql-sql@postgresql.org
Subject: Re: query not using index for descending records?
Date: Sat, 31 Jan 2004 15:09:15 +1000
Message-ID: <035C9F7CE28601428BBB5B051C9F77F207678A@orion> (raw)

Hi,

| You probably don't want to do that. The DESC only applies to the 
| one expression it follows. What you want is probably: 
| explain select datetime,id from trafficlogs order by 
| datetime desc,id desc limit 20;

This is exactly what I was after - worked a treat!

Thanks.

Darren



view thread (10+ messages)

Message-ID: <035C9F7CE28601428BBB5B051C9F77F207678A@orion>
Permalink:  ../035C9F7CE28601428BBB5B051C9F77F207678A@orion/
Also on:    postgresql.org/message-id/035C9F7CE28601428BBB5B051C9F77F207678A@orion

 · 

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-sql@postgresql.org
  Cc: lists@darrenmackay.com
  Subject: Re: query not using index for descending records?
  In-Reply-To: <035C9F7CE28601428BBB5B051C9F77F207678A@orion>

* 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