Re: [PERFORM] SQL_CALC_FOUND_ROWS in POSTGRESQL / Some one can

2006-12-10 Thread Andreas Kostyrka
* Chris <[EMAIL PROTECTED]> [061211 07:01]: > select SQL_CALC_FOUND_ROWS userid, username, password from users limit 10; > > will do: > > select userid, username, password from users limit 10; > > and calculate this: > > select userid, username, password from users; > > and tell you how many r

Re: [PERFORM] SQL_CALC_FOUND_ROWS in POSTGRESQL / Some one can

2006-12-10 Thread Chris
Mark Kirkwood wrote: Chris wrote: It's the same as doing a select count(*) type query using the same clauses, but all in one query instead of two. It doesn't return any extra rows on top of the limit query so it's better than using pg_numrows which runs the whole query and returns it to php

Re: [PERFORM] SQL_CALC_FOUND_ROWS in POSTGRESQL / Some one can

2006-12-10 Thread Mark Kirkwood
Chris wrote: It's the same as doing a select count(*) type query using the same clauses, but all in one query instead of two. It doesn't return any extra rows on top of the limit query so it's better than using pg_numrows which runs the whole query and returns it to php (in this example).

Re: [PERFORM] SQL_CALC_FOUND_ROWS in POSTGRESQL / Some one can

2006-12-10 Thread Tom Lane
Chris <[EMAIL PROTECTED]> writes: > Their docs explain it: > http://dev.mysql.com/doc/refman/4.1/en/information-functions.html > See "FOUND_ROWS()" Sounds like a pretty ugly crock ... The functionality as described is to let you fetch only the first N rows, and then still find out the total numbe

Re: [PERFORM] SQL_CALC_FOUND_ROWS in POSTGRESQL / Some one can

2006-12-10 Thread Chris
Joshua D. Drake wrote: On Mon, 2006-12-11 at 14:33 +1100, Chris wrote: Marcos Borges wrote: 07/12/2006 04:31 *SQL_CALC_FOUND_ROWS in POSTGRESQL* In mysqln i m using the command SQL_CALC_FOUND_ROWS in follow sintax. SELECT SQL_CALC_FOUND_ROWS name, email, tel FROM mytable WHERE name <> '' LIMI