Re: [PERFORM] Low perfomance SUM and Group by large databse

2010-07-02 Thread Robert Haas
On Tue, Jun 29, 2010 at 7:59 AM, Sergio Charpinel Jr. wrote: > One more question about two specifics query behavior: If I add "AND (ip_dst > = x.x.x.x)", it uses another plan and take a much more time. In both of > them, I'm using WHERE clause. Why this behavior? With either query, the planner is

Re: [PERFORM] Low perfomance SUM and Group by large databse

2010-06-29 Thread Sergio Charpinel Jr.
Hi, One more question about two specifics query behavior: If I add "AND (ip_dst = x.x.x.x)", it uses another plan and take a much more time. In both of them, I'm using WHERE clause. Why this behavior? => explain analyze SELECT ip_src, port_src, ip_dst, port_dst, tcp_flags, ip_proto, bytes, packet

Re: [PERFORM] Low perfomance SUM and Group by large databse

2010-06-23 Thread Sergio Charpinel Jr.
Craig, Russel, I appreciate your help. Thanks. 2010/6/22 Russell Smith > On 22/06/10 00:42, Sergio Charpinel Jr. wrote: > > Hi, > > > [snip] > > > > => explain analyze SELECT ip_src, port_src, ip_dst, port_dst, > > tcp_flags, ip_proto,SUM("bytes"),SUM("packets"),SUM("flows") FROM > > "acct_201

Re: [PERFORM] Low perfomance SUM and Group by large databse

2010-06-22 Thread Russell Smith
On 22/06/10 00:42, Sergio Charpinel Jr. wrote: > Hi, > [snip] > > => explain analyze SELECT ip_src, port_src, ip_dst, port_dst, > tcp_flags, ip_proto,SUM("bytes"),SUM("packets"),SUM("flows") FROM > "acct_2010_25" WHERE "stamp_inserted">='2010-06-20 10:10' AND > "stamp_inserted"<'2010-06-21 10:10' G

Re: [PERFORM] Low perfomance SUM and Group by large databse

2010-06-21 Thread Craig Ringer
On 21/06/10 22:42, Sergio Charpinel Jr. wrote: > Hi, > > I'm getting low performance on SUM and GROUP BY queries. > How can I improve my database to perform such queries. >-> Sort (cost=3499863.27..3523695.89 rows=9533049 > width=50) (actual time=165468.022..168908.828 rows=9494