perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Issac Goldstand <>
Subject Re: Database transaction across multiple web requests
Date Sun, 02 Apr 2006 12:29:04 GMT

Frank Wiles wrote:
> On Fri, 31 Mar 2006 14:47:37 +0200
> Issac Goldstand <> wrote:
>> Granted, I use a few MySQL features for this; I'm not sure if LIMIT
>> exists in postgresql, and I'm fairly sure that the SQL_CALC_FOUND_ROWS
>> directive (which will return the total rows in a select statement
>> regardless of the LIMIT directives) doesn't...
>   PostgreSQL has LIMIT... it's a SQL standard.  And I don't really see
>   why you would need SQL_CALC_FOUND_ROWS unless you where going to
>   show the total number of pages.  For simple Next/Previous paging
>   you just keep going until you fall off the end. 
>   If you need to get a count you can just do a count() on a particular
>   column without the LIMIT and get a total. 

Not the total number of pages per se, but numbered result pages.  And if
there are, say, left joins (or other operations which prevent being able
to do count() on a nice clean index) involved, it's usually cheaper to
do CALC_FOUND_ROWS on the one operation, rather than having to run the
complex filtering operation again in a second SQL statement (for COUNT())


View raw message