Re: [PERFORM] Recommendations for partitioning?

2013-12-30 Thread Alvaro Herrera
Sergey Konoplev escribió: > On Fri, Dec 20, 2013 at 7:59 AM, Alvaro Herrera > wrote: > > Eh. Why can't you just do something like > > > > WITH moved AS ( > > DELETE FROM src WHERE .. > > RETURNING * > > ) INSERT INTO dst SELECT * FROM moved; > > Avero, I think it could be cheape

Re: [PERFORM] Recommendations for partitioning?

2013-12-30 Thread Sergey Konoplev
On Fri, Dec 20, 2013 at 7:59 AM, Alvaro Herrera wrote: > Dave Johansen escribió: >> On Thu, Dec 19, 2013 at 10:27 AM, Scott Marlowe >> wrote: > >> > That's pretty much it. What I did was to create the new month table >> > and day tables, alter my triggers to reflect this, then move the data >> >

Re: [PERFORM] Recommendations for partitioning?

2013-12-20 Thread Dave Johansen
On Fri, Dec 20, 2013 at 8:52 AM, Dave Johansen wrote: > On Thu, Dec 19, 2013 at 10:27 AM, Scott Marlowe > wrote: > >> On Thu, Dec 19, 2013 at 9:53 AM, Dave Johansen >> wrote: >> >> >> > On Sat, Dec 7, 2013 at 1:37 PM, Scott Marlowe >> > wrote: >> >> I'll add that you can use assymetric partitio

Re: [PERFORM] Recommendations for partitioning?

2013-12-20 Thread Dave Johansen
On Fri, Dec 20, 2013 at 9:18 AM, Shaun Thomas wrote: > On 12/20/2013 09:59 AM, Alvaro Herrera wrote: > > WITH moved AS ( >> DELETE FROM src WHERE .. >> RETURNING * >> ) INSERT INTO dst SELECT * FROM moved; >> > > I know that's effectively an atomic action, but I'd feel a lot more

Re: [PERFORM] Recommendations for partitioning?

2013-12-20 Thread Shaun Thomas
On 12/20/2013 09:59 AM, Alvaro Herrera wrote: WITH moved AS ( DELETE FROM src WHERE .. RETURNING * ) INSERT INTO dst SELECT * FROM moved; I know that's effectively an atomic action, but I'd feel a lot more comfortable reversing that logic so the delete is based on the results

Re: [PERFORM] Recommendations for partitioning?

2013-12-20 Thread Alvaro Herrera
Dave Johansen escribió: > On Thu, Dec 19, 2013 at 10:27 AM, Scott Marlowe > wrote: > > That's pretty much it. What I did was to create the new month table > > and day tables, alter my triggers to reflect this, then move the data > > with insert into / select from query for each old day partition.

Re: [PERFORM] Recommendations for partitioning?

2013-12-20 Thread bricklen
On Fri, Dec 20, 2013 at 7:52 AM, Dave Johansen wrote: > It would be nice if there was just a "move command", but that seems like > the type of model that we want and we'll probably move to that. I haven't been following this thread, but this comment caught my eye. Are you after the "NO INHERIT"

Re: [PERFORM] Recommendations for partitioning?

2013-12-20 Thread Dave Johansen
On Thu, Dec 19, 2013 at 10:27 AM, Scott Marlowe wrote: > On Thu, Dec 19, 2013 at 9:53 AM, Dave Johansen > wrote: > >> > > On Sat, Dec 7, 2013 at 1:37 PM, Scott Marlowe > > wrote: > >> I'll add that you can use assymetric partitioning if you tend to do a > >> lot of more fine grained queries on r

Re: [PERFORM] Recommendations for partitioning?

2013-12-19 Thread Scott Marlowe
On Thu, Dec 19, 2013 at 9:53 AM, Dave Johansen wrote: >> > On Sat, Dec 7, 2013 at 1:37 PM, Scott Marlowe > wrote: >> I'll add that you can use assymetric partitioning if you tend to do a >> lot of more fine grained queries on recent data and more big roll up >> on older ones. I.e. partition by mo

Re: [PERFORM] Recommendations for partitioning?

2013-12-19 Thread Dave Johansen
Sorry for the delay response. We had some hardware/configuration issues that appear to be solved now, so now we're starting to actually play with modifying the database. On Sat, Dec 7, 2013 at 1:29 PM, Jeff Janes wrote: > On Thu, Dec 5, 2013 at 7:36 AM, Dave Johansen wrote: > >> I'm managing a d

Re: [PERFORM] Recommendations for partitioning?

2013-12-07 Thread Scott Marlowe
On Sat, Dec 7, 2013 at 10:09 AM, desmodemone wrote: > Hi Dave, > About the number of partitions , I didn't have so much > problems with hundreds of partitions ( like 360 days in a year ). > Moreover you could bypass the overhead of trigger with a direct insert on > the partition, als

Re: [PERFORM] Recommendations for partitioning?

2013-12-07 Thread Jeff Janes
On Thu, Dec 5, 2013 at 7:36 AM, Dave Johansen wrote: > I'm managing a database that is adding about 10-20M records per day to a > table and time is a core part of most queries, > What is the nature of how the time column is used in the queries? Depending on how it is used, you might not get much

Re: [PERFORM] Recommendations for partitioning?

2013-12-07 Thread desmodemone
Hi Dave, About the number of partitions , I didn't have so much problems with hundreds of partitions ( like 360 days in a year ). Moreover you could bypass the overhead of trigger with a direct insert on the partition, also to have a parallel insert without to firing too much the trig

[PERFORM] Recommendations for partitioning?

2013-12-05 Thread Dave Johansen
I'm managing a database that is adding about 10-20M records per day to a table and time is a core part of most queries, so I've been looking into seeing if I need to start using partitioning based on the time column and I've found these general guidelines: Don't use more than about 50 paritions (