Re: [GENERAL] LIMIT Question

2008-02-29 Thread Gurjeet Singh
On Fri, Feb 29, 2008 at 7:20 PM, Sam Mason <[EMAIL PROTECTED]> wrote: > On Fri, Feb 29, 2008 at 05:28:29PM +0530, Gurjeet Singh wrote: > > On Fri, Feb 29, 2008 at 3:55 PM, Martijn van Oosterhout < > [EMAIL PROTECTED]> wrote: > > > Except if you have an index on the column you're ordering by. Then

Re: [GENERAL] LIMIT Question

2008-02-29 Thread Sam Mason
On Fri, Feb 29, 2008 at 05:28:29PM +0530, Gurjeet Singh wrote: > On Fri, Feb 29, 2008 at 3:55 PM, Martijn van Oosterhout <[EMAIL PROTECTED]> > wrote: > > Except if you have an index on the column you're ordering by. Then the > > server can really return the first row quickly. > > Quickly for sure

Re: [GENERAL] LIMIT Question

2008-02-29 Thread Gurjeet Singh
On Fri, Feb 29, 2008 at 3:55 PM, Martijn van Oosterhout <[EMAIL PROTECTED]> wrote: > On Fri, Feb 29, 2008 at 02:53:05PM +0530, Gurjeet Singh wrote: > > In my opinion (without looking at the code), if you have a > grouping-function > > or ORDER BY or GROUP BY clause, then yes, the whole query has t

Re: [GENERAL] LIMIT Question

2008-02-29 Thread Martijn van Oosterhout
On Fri, Feb 29, 2008 at 02:53:05PM +0530, Gurjeet Singh wrote: > In my opinion (without looking at the code), if you have a grouping-function > or ORDER BY or GROUP BY clause, then yes, the whole query has to be executed > to show the first row of the result-set. But if the query doesn't have any >

Re: [GENERAL] LIMIT Question

2008-02-29 Thread Gurjeet Singh
In my opinion (without looking at the code), if you have a grouping-function or ORDER BY or GROUP BY clause, then yes, the whole query has to be executed to show the first row of the result-set. But if the query doesn't have any of these clauses, then the DB has the ability to send back the first r

Re: [GENERAL] LIMIT Question

2008-02-28 Thread Scott Marlowe
On Thu, Feb 28, 2008 at 3:20 PM, Terry Lee Tucker <[EMAIL PROTECTED]> wrote: > When one uses LIMIT, as in LIMIT 1, is the entire query executed on the server > side, but only one record returned? > > > --

[GENERAL] LIMIT Question

2008-02-28 Thread Terry Lee Tucker
When one uses LIMIT, as in LIMIT 1, is the entire query executed on the server side, but only one record returned? PostgreSQL 7.4.19 on i686-redhat-linux-gnu, compiled by GCC gcc (GCC) 3.4.6

RE: [GENERAL] LIMIT QUESTION

1999-04-29 Thread The Hermit Hacker
though, haven't > found any problems yet. > > Thanks > > Martin > > -Original Message- > ·ol : José Soares <[EMAIL PROTECTED]> > ˆ¶æ : Chris Bitmead <[EMAIL PROTECTED]> > CC : Martin Wong <[EMAIL PROTECTED]>; [EMAIL PROTECTED] > <[

Re: [GENERAL] LIMIT QUESTION

1999-04-29 Thread José Soares
Martin Wong ha scritto: > Sorry for the previous posting. The following worked. > > BTW, this affects just this database or throughout the entire postgresql > server? > Only current_session; > > And, how does one reset this variable to max? > RESET QUERY_LIMIT; ___

RE: [GENERAL] LIMIT QUESTION

1999-04-29 Thread Margarita Barvinok
This is from the Tutorial for version 6.4 of PostgreSQL. SET - Set run-time parameters for session SET variable { TO | = } { 'value' | DEFAULT } SET TIME ZONE { 'timezone' | LOCAL }; QUERY_LIMIT Sets the number of rows returned by a query. Value Maximum number of rows

RE: [GENERAL] LIMIT QUESTION

1999-04-29 Thread Martin Wong
TECTED] <[EMAIL PROTECTED]> “úŽž : 1999”N4ŒŽ30“ú 0:01 Œ–¼ : Re: [GENERAL] LIMIT QUESTION This works in 6.4.2: set QUERY_LIMIT TO '10'; or set QUERY_LIMIT = '10'; On Thu, 29 Apr 1999, [iso-8859-1] José Soares wrote: > > Use SET QUERY_L

RE: [GENERAL] LIMIT QUESTION

1999-04-29 Thread Martin Wong
;[EMAIL PROTECTED]>; [EMAIL PROTECTED] <[EMAIL PROTECTED]> “úŽž : 1999”N4ŒŽ30“ú 0:01 Œ–¼ : Re: [GENERAL] LIMIT QUESTION >Chris Bitmead ha scritto: > >> Only PostgreSQL 6.5 Beta supports LIMIT. >> >> > I've an elementary question. What's wrong with the follo

Re: [GENERAL] LIMIT QUESTION

1999-04-28 Thread Chris Bitmead
Only PostgreSQL 6.5 Beta supports LIMIT. > I've an elementary question. What's wrong with the following : > > dbtest=> select * from testusers limit 10; > ERROR: parser: parse error at or near "10" > dbtest=> select version(); > version > ---

RE: [GENERAL] LIMIT QUESTION

1999-04-28 Thread Michael J Davis
I think "limit" is new with version 6.5. -Original Message- From: Martin Wong [SMTP:[EMAIL PROTECTED]] Sent: Wednesday, April 28, 1999 8:07 PM To: [EMAIL PROTECTED] Subject: [GENERAL] LIMIT QUESTION Hi,

[GENERAL] LIMIT QUESTION

1999-04-28 Thread Martin Wong
Hi, I've an elementary question. What's wrong with the following : dbtest=> select * from testusers limit 10; ERROR: parser: parse error at or near "10" dbtest=> select version(); version - PostgreSQL 6.4.2 on i586-pc-linux-gnu, compi