Return-Path: owner-postman
Received: from localhost.Berkeley.EDU (localhost.Berkeley.EDU [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.9/8.6.3) with SMTP id QAA07851 for postgres-redist; Sat, 17 Sep 1994 16:49:27 -0700
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199409172349.QAA07851@nobozo.CS.Berkeley.EDU>
X-Authentication-Warning: nobozo.CS.Berkeley.EDU: Host localhost.Berkeley.EDU didn't use HELO protocol
Sender: owner-postman@postgres.Berkeley.EDU
X-Return-Path: owner-postman
Received: from colin.muc.de (root@colin.muc.de [193.174.4.1]) by nobozo.CS.Berkeley.EDU (8.6.9/8.6.3) with SMTP id QAA07841 for <postgres@nobozo.CS.Berkeley.EDU>; Sat, 17 Sep 1994 16:49:19 -0700
Received: from dl6rai by colin.muc.de with UUCP id <25585(2)>; Sun, 18 Sep 1994 01:49:04 +0200
Received: by dl6rai.muc.de (Smail3.1.28.1 #6)
	id m0qlkES-0009C9C; Fri, 16 Sep 94 20:50 GMT
Message-Id: <m0qlkES-0009C9C@dl6rai.muc.de>
From: root@DL6RAI.MUC.DE (Bernhard Buettner)
Subject: Last 'n' records?
To: postgres@postgres.Berkeley.EDU
Date: Fri, 16 Sep 1994 22:50:08 +0200
X-Mailer: ELM [version 2.4 PL21]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Length: 980       
Resent-To: postgres-redist@postgres.Berkeley.EDU
Resent-Date: Sat, 17 Sep 94 16:49:27 -0700
Resent-XMts: smtp

Hello Postgres experts,

I am currently developing amateur radio software utilizig Postgres 
with a friend. The application is going to be used as an on-line 
database run under packet radio. The database contains data records 
which are being entered by many different users and the growth is about 
10,000 records/month.

A problem arises with the fact that very often a user wants to 
retrieve "the last 'n'" records of the database. Reading through
the manual, I could not find an operator to do this. At this time,
the query is realised as follows:

     retrieve portal P unique (data.all) sort by date using >
     fetch 5 in P

This will take the whole relation, sort it by date and then retrieve
the last 5 (0.01%). This cannot be the solution, but we can't find
any better. Any hints, ideas?

Greetings, 

Ben
-- 
[] Bernhard Buettner (Ben)
[]      Mail: Am Brunnen 18, 85551 Kirchheim, Germany
[]  Internet: root@dl6rai.muc.de
[]    Packet: DL6RAI @ DB0AAB.#BAY.DEU.EU

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU"

   If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================
