Am 17.01.2013 um 13:54 schrieb Mark Felder:

> OS: FreeBSD 9.1, PostgreSQL 9.2.2, and the database is on ZFS with 
> compression=on and atime=off. I do have an SSD being used for L2ARC.
That's pretty fast.
How many spindles are in use by the db?
I'm getting with fbsd 8.2, pg 9.2.2 on ufs2:
---
operations=# select count(*) as c, count(rfc822size), count(m.id),              
                                                                                
                                                                                
            coalesce(sum(rfc822size::bigint),0)::bigint/1024 as s               
                                                                                
                                                                                
                        from messages m                                         
                                                                                
                                                                                
                                    join mailbox_messages mm on 
(m.id=mm.message)                                                               
                                                                                
                                                                join mailboxes 
mb on (mm.mailbox=mb.id)                                                        
                                                                                
                                                                              
where mb.owner=24;
   c   | count | count |    s    
-------+-------+-------+---------
 10342 | 10342 | 10342 | 2801173
(1 row)

Time: 441,530 ms
operations=# select count(*) as c, count(rfc822size), count(m.id),              
                                                                                
                                                                                
            coalesce(sum(rfc822size::bigint),0)::bigint/1024 as s               
                                                                                
                                                                                
                        from messages m                                         
                                                                                
                                                                                
                                    join mailbox_messages mm on 
(m.id=mm.message)                                                               
                                                                                
                                                                join mailboxes 
mb on (mm.mailbox=mb.id)                                                        
                                                                                
                                                                              
where mb.owner=3;
   c    | count  | count  |    s    
--------+--------+--------+---------
 415753 | 415753 | 415753 | 7216821
(1 row)

Time: 1556,691 ms
---

Axel
---
PGP-Key:29E99DD6  ☀ +49 151 2300 9283  ☀ computing @ chaos claudius

Reply via email to