SELECT TOP %d PERCENT, or SELECT ... LIMIT %d PERCENT ?

From: Grzegorz Jaskiewicz <gj(at)pointblue(dot)com(dot)pl>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: SELECT TOP %d PERCENT, or SELECT ... LIMIT %d PERCENT ?
Date: 2008-10-12 12:44:45
Message-ID: 05A4CFF2-E348-4967-A769-25F8F0AE998E@pointblue.com.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

so I wonder, quite few times ppl asked me about my-word database TOP %
PERCENT (and I guess ms-word db has it too).
Now that postgres has limit(subselect) - postgresql can do the same
thing. But, using a count(*) in subselects isn't very efficient. The
backend gets information from limit X, so I figure it shouldn't be a
very big deal to add LIMIT %d PERCENT , and pass it on as percentage,
instead of just number of rows.
I can give it a go and try to implement it myself, but wanted to ask
here first for opinion on syntax (I have no idea what would be right
syntax by sql standards), and how keen would you guys be on accepting
such patch.

thanks.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hitoshi Harada 2008-10-12 12:54:03 Re: SELECT TOP %d PERCENT, or SELECT ... LIMIT %d PERCENT ?
Previous Message Robert Haas 2008-10-12 12:28:07 Re: recursive query crash