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 > Re: count * per...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 3852 of 4424
Post > Topic >>

Re: count * performance issue

by sathiya.psql@[EMAIL PROTECTED] ("sathiya psql") Mar 6, 2008 at 12:36 PM

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

                                                          QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=205756.95..205756.95 rows=1 width=0) (actual time=
114675.042..114675.042 rows=1 loops=1)
   ->  Seq Scan on call_log  (cost=0.00..193224.16 rows=5013112 width=0)
(actual time=11.754..91429.594 rows=5061619 loops=1)
         Filter: (call_id > 0)
 Total runtime: 114699.797 ms
(4 rows)


it is now taking 114 seconds, i think because of load in my system.... any
way will you explain., what is this COST, actual time and other stuffs....

On Thu, Mar 6, 2008 at 12:27 PM, A. Kretschmer <
andreas.kretschmer@[EMAIL PROTECTED]
> wrote:

> am  Thu, dem 06.03.2008, um 12:17:55 +0530 mailte sathiya psql
folgendes:
> > TRIGGER i can use if i want the count of the whole table, but i
require
> for
> > some of the rows with WHERE condition....
> >
> > so how to do that ???
>
> Okay, in this case a TRIGGER are a bad idea. You can use an INDEX on
> this row. Can you show us the output for a EXPLAIN ANALYSE SELECT
> count(*) from <your_table> WHERE <your_row> = ... ?
>
>
> Andreas
> --
> Andreas Kretschmer
> Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
> GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net
>
> --
> Sent via pgsql-performance mailing list
(pgsql-performance@[EMAIL PROTECTED]
)
> To make changes to your subscription:
>
>
http://mail.postgresql.org/mj/mj_wwwusr?domain=postgresql.org&extra=pgsql-performance
>

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

<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
QUERY
PLAN<br>------------------------------------------------------------------------------------------------------------------------------<br>&nbsp;Aggregate&nbsp;
(cost=205756.95..205756.95 rows=1 width=0) (actual
time=114675.042..114675.042 rows=1 loops=1)<br>
&nbsp;&nbsp; -&gt;&nbsp; Seq Scan on call_log&nbsp; (cost=0.00..193224.16
rows=5013112 width=0) (actual time=11.754..91429.594 rows=5061619
loops=1)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Filter:
(call_id &gt; 0)<br>&nbsp;Total runtime: 114699.797 ms<br>(4
rows)<br><br><br>
it is now taking 114 seconds, i think because of load in my system.... any
way will you explain., what is this COST, actual time and other
stuffs....<br><br><div class="gmail_quote">On Thu, Mar 6, 2008 at 12:27
PM, A. Kretschmer &lt;<a
href="mailto:andreas.kretschmer@[EMAIL PROTECTED]
">andreas.kretschmer@[EMAIL PROTECTED]
>&gt;
wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204,
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">am &nbsp;Thu,
dem 06.03.2008, um 12:17:55 +0530 mailte sathiya psql folgendes:<br>
<div class="Ih2E3d">&gt; TRIGGER i can use if i want the count of the
whole table, but i require for<br>
&gt; some of the rows with WHERE condition....<br>
&gt;<br>
&gt; so how to do that ???<br>
<br>
</div>Okay, in this case a TRIGGER are a bad idea. You can use an INDEX
on<br>
this row. Can you show us the output for a EXPLAIN ANALYSE SELECT<br>
count(*) from &lt;your_table&gt; WHERE &lt;your_row&gt; = ... ?<br>
<div><div></div><div class="Wj3C7c"><br>
<br>
Andreas<br>
--<br>
Andreas Kretschmer<br>
Kontakt: &nbsp;Heynitz: 035242/47150, &nbsp; D1: 0160/7141639 (mehr: -&gt;
Header)<br>
GnuPG-ID: &nbsp; 0x3FFF606C, privat 0x7F4584DA &nbsp; <a
href="http://wwwkeys.de.pgp.net"
target="_blank">http://wwwkeys.de.pgp.net</a><br>
<br>
--<br>
Sent via pgsql-performance mailing list (<a
href="mailto:pgsql-performance@[EMAIL PROTECTED]
">pgsql-performance@[EMAIL PROTECTED]
>)<br>
To make changes to your subscription:<br>
<a
href="http://mail.postgresql.org/mj/mj_wwwusr?domain=postgresql.org&amp;extra=pgsql-performance"
target="_blank">http://mail.postgresql.org/mj/mj_wwwusr?domain=postgresql.org&amp;extra=pgsql-performance</a><br>
</div></div></blockquote></div><br>

------=_Part_3616_12861576.1204787208144--
 




 2 Posts in Topic:
Re: count * performance issue
sathiya.psql@[EMAIL PROTE  2008-03-06 12:36:48 
Re: count * performance issue
andreas.kretschmer@[EMAIL  2008-03-06 08:18:15 

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 9:09:00 CST 2008.