pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marcos Borges <marcosborges@mbsi.com.br>
To: pgsql-performance@postgresql.org
Subject: SQL_CALC_FOUND_ROWS in POSTGRESQL / Some one can helpe me.
Date: Thu, 07 Dec 2006 11:19:15 -0200
Message-ID: <457814D3.1030001@mbsi.com.br> (raw)

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<div
 style="padding-left: 20px; font-size: 92%; float: right; padding-bottom: 10px;">07/12/2006&nbsp;04:31
</div>
<b>SQL_CALC_FOUND_ROWS in POSTGRESQL</b><br>
<br>
In mysqln i m using the command SQL_CALC_FOUND_ROWS in follow sintax.<br>
SELECT SQL_CALC_FOUND_ROWS name, email, tel FROM mytable WHERE name
&lt;&gt; '' LIMIT 0, 10<br>
to have the recorset data.<br>
and<br>
SELECT FOUND_ROWS();<br>
to have the total of registers found.<br>
<br>
I dont want to use the command count(*), because the performance will
fall down, depending of the quantyt of tables and "joins".<br>
<br>
The Data base postgresql have something similar ???<br>
<br>
<br>
---------------------------------------------------------------------------------------------------<br>
<br>
<div
 style="padding-left: 20px; font-size: 92%; float: right; padding-bottom: 10px;">07/12/2006&nbsp;04:31
</div>
<b>SQL_CALC_FOUND_ROWS no POSTGRESQL</b><br>
D&uacute;vida NINJA no POSTGRESQL<br>
No mysql utilizo o comando SQL_CALC_FOUND_ROWS na seguinte sintax<br>
SELECT SQL_CALC_FOUND_ROWS nome, email, telefone FROM tabela WHERE nome
&lt;&gt; '' LIMIT 0, 10<br>
para obter o meu recordset<br>
e<br>
SELECT FOUND_ROWS();<br>
para obter o total de resgitros que realmente existem em minha tabela
condicionado pelo WHERE, sem ser limitado pelo LIMIT.<br>
<br>
N&atilde;o quero usar o count(*) pois o desempenho cai dependendo da
quantidade de tabelas selecionadas e quantidade de registros.<br>
<br>
<br>
O postgreSQL possui algo similar? Caso sim pode me informar qual e
fornecer um exemplo. <br>
<br>
</body>
</html>



view thread (9+ messages)  latest in thread

Message-ID: <457814D3.1030001@mbsi.com.br>
Permalink:  ../457814D3.1030001@mbsi.com.br/
Also on:    postgresql.org/message-id/457814D3.1030001@mbsi.com.br

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: marcosborges@mbsi.com.br
  Subject: Re: SQL_CALC_FOUND_ROWS in POSTGRESQL / Some one can helpe me.
  In-Reply-To: <457814D3.1030001@mbsi.com.br>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox