pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Hiroshi Inoue <Inoue@tpf.co.jp>
Cc: Peter Eisentraut <peter_e@gmx.net>
Cc: Stoyan Genov <genov@digsys.bg>
Cc: Dirk Lutzebaeck <lutzeb@aeccom.com>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] Howto to force NULL rows at the bottom ?
Date: Sun, 5 Dec 1999 22:34:20 -0500 (EST)
Message-ID: <199912060334.WAA25609@candle.pha.pa.us> (raw)
In-Reply-To: <14623.944449707@sss.pgh.pa.us>

> I am not sure how we can resolve this.  btree cannot easily work
> differently than it does --- we could make either choice for where nulls
> appear in the index, but once we've done that we have no real choice
> about what ORDER BY on the index will do, in either direction.  So
> it seems that we really do need to make nulls sort differently in
> ASC and DESC sorts.  But the explicit-sort routine has no idea whether
> ASC or DESC is involved ... indeed can't, because we may have a
> "USING operator" clause in there and no ASC or DESC anywhere.  Shall
> explicit-sort try to guess whether the operator it's given represents
> the fore or aft direction of a btree index?  The operator might not be
> one that is btree-indexable at all, so I don't see how that can work.

We are pretty cheezy about using > and < for ORDER BY.  Any chance to
look up the actual comparison symbol from the cache and do something
based on "<" or ">"?  Do we have a pg_operator oid or something else
there?  If it is not one of those, we can just order them
however we want to.

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



view thread (12+ messages)  latest in thread

Message-ID: <199912060334.WAA25609@candle.pha.pa.us>
Permalink:  ../199912060334.WAA25609@candle.pha.pa.us/
Also on:    postgresql.org/message-id/199912060334.WAA25609@candle.pha.pa.us

 · 

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 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: pgman@candle.pha.pa.us, tgl@sss.pgh.pa.us, Inoue@tpf.co.jp, peter_e@gmx.net, genov@digsys.bg, lutzeb@aeccom.com
  Subject: Re: [SQL] Howto to force NULL rows at the bottom ?
  In-Reply-To: <199912060334.WAA25609@candle.pha.pa.us>
  References: <14623.944449707@sss.pgh.pa.us> <199912060334.WAA25609@candle.pha.pa.us>

* 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