Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Performance > count * perform...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 3841 of 4424
Post > Topic >>

count * performance issue

by sathiya.psql@[EMAIL PROTECTED] ("sathiya psql") Mar 6, 2008 at 11:13 AM

------=_Part_3466_2902788.1204782181940
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

count(*) tooks much time...

but with the where clause we can make this to use indexing,... what where
clause we can use??

Am using postgres 7.4 in Debian OS with 1 GB RAM,

am having a table with nearly 50 lakh records,

it has more than 15 columns, i want to count how many records are there,
it
is taking nearly 17 seconds to do that...

i know that to get a approximate count we can use
         SELECT reltuples FROM pg_class where relname = TABLENAME;

but this give approximate count, and i require exact count...

------=_Part_3466_2902788.1204782181940
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

count(*) tooks much time...<br><div class="gmail_quote"><br>but with the
where clause we can make this to use indexing,... what where clause we can
use??<br><br>Am using postgres 7.4 in Debian OS with 1 GB RAM, <br><br>am
having a table with nearly 50 lakh records, <br>

<br>it has more than 15 columns, i want to count how many records are
there, it is taking nearly 17 seconds to do that...<br><br>i know that to
get a approximate count we can
use<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SELECT reltuples
FROM pg_class where relname = TABLENAME;<br>

<br>but this give approximate count, and i require exact count...<br>
</div><br>

------=_Part_3466_2902788.1204782181940--
 




 3 Posts in Topic:
count * performance issue
sathiya.psql@[EMAIL PROTE  2008-03-06 11:13:01 
Re: count * performance issue
dmagick@[EMAIL PROTECTED]  2008-03-06 16:48:19 
Re: count * performance issue
andreas.kretschmer@[EMAIL  2008-03-06 07:08:29 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 8:45:32 CST 2008.