Re: [PERFORM] slow query : very simple delete, 100% cpu, nearly no disk activity

2009-09-11 Thread Merlin Moncure
On Mon, Sep 7, 2009 at 5:05 AM, Vincent de Phily wrote: > On Monday 07 September 2009 03:25:23 Tom Lane wrote: >> Vincent de Phily writes: >> > I've been running this simple delete since yesterday afternoon : >> >> db=# explain delete from message where datetime < '2009-03-03'; >> >> Seq Scan on

Re: [PERFORM] View vs Stored Proc Performance

2009-09-11 Thread Merlin Moncure
On Fri, Sep 11, 2009 at 5:27 PM, Jason Tesser wrote: > Right what I was wondering is is this better done in a view? or a stored > proc?   I am guessing based on your initial response the view is better > performance.  These are the types of queries I will be doing though. > in performance terms t

Re: [PERFORM] slow query : very simple delete, 100% cpu, nearly no disk activity

2009-09-11 Thread Robert Haas
On Mon, Sep 7, 2009 at 5:05 AM, Vincent de Phily wrote: > On Monday 07 September 2009 03:25:23 Tom Lane wrote: >> Vincent de Phily writes: >> > I've been running this simple delete since yesterday afternoon : >> >> db=# explain delete from message where datetime < '2009-03-03'; >> >> Seq Scan on

Re: [PERFORM] View vs Stored Proc Performance

2009-09-11 Thread Jason Tesser
Right what I was wondering is is this better done in a view? or a stored proc? I am guessing based on your initial response the view is better performance. These are the types of queries I will be doing though. On Fri, Sep 11, 2009 at 5:01 PM, Merlin Moncure wrote: > On Fri, Sep 11, 2009 at 2

Re: [PERFORM] View vs Stored Proc Performance

2009-09-11 Thread Merlin Moncure
On Fri, Sep 11, 2009 at 2:56 PM, Jason Tesser wrote: > OK so in my case I have a Person, Email, Phone and Address table.  I want to > return the Person and an Array of the others. so my return type would be > something like Person, Email[], Phone[], Address[] > > When passed a personId. > > Are yo

Re: [PERFORM] odd iostat graph

2009-09-11 Thread Greg Smith
On Fri, 11 Sep 2009, Alan McKay wrote: Munin takes a snapshot every 5 minutes, and this graph shows it averaged over that timeframe. The default postgresql.conf puts a checkpoint every 5 minutes as well. It's not going to be as exact as Munin's time though, they'll be just a little longer th

Re: [PERFORM] odd iostat graph

2009-09-11 Thread Alan McKay
> What's the scale on the bottom there?  The label says "by week" but the way > your message is written makes me think it's actually a much smaller time > frame.  If those valleys are around around five minutes apart, those are the > checkpoints finishing; the shape of the graph is right for it to

Re: [PERFORM] odd iostat graph

2009-09-11 Thread Greg Smith
On Fri, 11 Sep 2009, Alan McKay wrote: We aren't seeing any performance problems on this per-se. But that just seems like a really odd graph to me. Can anyone explain it? In particular, how regular it is? What's the scale on the bottom there? The label says "by week" but the way your mes

Re: [PERFORM] View vs Stored Proc Performance

2009-09-11 Thread Jason Tesser
OK so in my case I have a Person, Email, Phone and Address table. I want to return the Person and an Array of the others. so my return type would be something like Person, Email[], Phone[], Address[] When passed a personId. Are you saying this is better in a view. Create a view that can return

Re: [PERFORM] odd iostat graph

2009-09-11 Thread Kevin Grittner
Alan McKay wrote: >> My guess is this is checkpoint related. > > I'll assume "checkpoint" is a PG term that I'm not yet familiar with - > will query my DBA :-) A checkpoint flushes all dirty PostgreSQL buffers to the OS and then tells the OS to write them to disk. The exact details of how t

Re: [PERFORM] odd iostat graph

2009-09-11 Thread Alan McKay
> My guess is this is checkpoint related. I'll assume "checkpoint" is a PG term that I'm not yet familiar with - will query my DBA :-) If this OS buffer cache, wouldn't that be cached an awfully long time? i.e. we're in big trouble if we get a bad crash? -- “Don't eat anything you've ever see

Re: [PERFORM] odd iostat graph

2009-09-11 Thread Scott Carey
On 9/11/09 9:58 AM, "Alan McKay" wrote: > Hey folks, > > Earlier in the week I wrote a Munin plugin that takes the "await" and > "average queue length" fields from "iostat -x" and graphs them. > > This seems rather odd to me : > > http://picasaweb.google.ca/alan.mckay/Work#5380253477470243954

Re: [PERFORM] View vs Stored Proc Performance

2009-09-11 Thread Merlin Moncure
On Fri, Sep 11, 2009 at 11:46 AM, Jason Tesser wrote: > Is it faster to use a Stored Proc that returns a Type or has Out Parameters > then a View?  Views are easier to maintain I feel.  I remember testing this > around 8.0 days and the view seemed slower with a lot of data. for the most part, a v

[PERFORM] odd iostat graph

2009-09-11 Thread Alan McKay
Hey folks, Earlier in the week I wrote a Munin plugin that takes the "await" and "average queue length" fields from "iostat -x" and graphs them. This seems rather odd to me : http://picasaweb.google.ca/alan.mckay/Work#5380253477470243954 That is Qlen. And await looks similar http://picasaweb

[PERFORM] View vs Stored Proc Performance

2009-09-11 Thread Jason Tesser
Is it faster to use a Stored Proc that returns a Type or has Out Parameters then a View? Views are easier to maintain I feel. I remember testing this around 8.0 days and the view seemed slower with a lot of data.