Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 183769FA040 for ; Thu, 7 Dec 2006 09:19:35 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 65931-05 for ; Thu, 7 Dec 2006 09:19:24 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from canada.nswebhost.com (canada.nswebhost.com [66.246.218.207]) by postgresql.org (Postfix) with ESMTP id 17A569F938C for ; Thu, 7 Dec 2006 09:19:28 -0400 (AST) Received: from c953c1b5.virtua.com.br ([201.83.193.181]:1126 helo=[192.168.0.85]) by canada.nswebhost.com with esmtpa (Exim 4.52) id 1GsJ9m-00049c-Aa for pgsql-performance@postgresql.org; Thu, 07 Dec 2006 08:19:25 -0500 Message-ID: <457814D3.1030001@mbsi.com.br> Date: Thu, 07 Dec 2006 11:19:15 -0200 From: Marcos Borges Reply-To: marcosborges@mbsi.com.br User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: SQL_CALC_FOUND_ROWS in POSTGRESQL / Some one can helpe me. Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-ClamAntiVirus-Scanner: This mail is clean X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - canada.nswebhost.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - mbsi.com.br X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.096 tagged_above=0 required=5 tests=AWL, BAYES_50, HTML_30_40, HTML_MESSAGE, MIME_HTML_ONLY, UPPERCASE_25_50 X-Spam-Level: X-Archive-Number: 200612/174 X-Sequence-Number: 22230
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 <> '' LIMIT 0, 10
to have the recorset data.
and
SELECT FOUND_ROWS();
to have the total of registers found.

I dont want to use the command count(*), because the performance will fall down, depending of the quantyt of tables and "joins".

The Data base postgresql have something similar ???


---------------------------------------------------------------------------------------------------

07/12/2006 04:31
SQL_CALC_FOUND_ROWS no POSTGRESQL
Dúvida NINJA no POSTGRESQL
No mysql utilizo o comando SQL_CALC_FOUND_ROWS na seguinte sintax
SELECT SQL_CALC_FOUND_ROWS nome, email, telefone FROM tabela WHERE nome <> '' LIMIT 0, 10
para obter o meu recordset
e
SELECT FOUND_ROWS();
para obter o total de resgitros que realmente existem em minha tabela condicionado pelo WHERE, sem ser limitado pelo LIMIT.

Não quero usar o count(*) pois o desempenho cai dependendo da quantidade de tabelas selecionadas e quantidade de registros.


O postgreSQL possui algo similar? Caso sim pode me informar qual e fornecer um exemplo.