Re: [PERFORM] horizontal partition

2005-02-06 Thread Gaetano Mendola
Tom Lane wrote: Josh Berkus writes: The issue here is that the planner is capable of "pushing down" the WHERE criteria into the first view, but not into the second, "nested" view, and so postgres materializes the UNIONed data set before perfoming the join. Thing is, I seem to recall that this p

Re: [PERFORM] horizontal partition

2005-02-03 Thread Gaetano Mendola
Josh Berkus wrote: Gaetano, I did in that way just to not use postgresql specific feature. I can give it a try and I let you know, however the question remain, why the index usage is lost if used in that way ? Because PostgreSQL is materializing the entire UNION data set in the subselect. What

Re: [PERFORM] horizontal partition

2005-02-02 Thread Tom Lane
Josh Berkus writes: > The issue here is that the planner is capable of "pushing down" the WHERE > criteria into the first view, but not into the second, "nested" view, and so > postgres materializes the UNIONed data set before perfoming the join. > Thing is, I seem to recall that this particula

Re: [PERFORM] horizontal partition

2005-02-02 Thread Josh Berkus
Klint, > This is how I interpret it (if anyone wants to set me straight or > improve on it feel free) > > Views are implemented as rules. > > Rules are pretty much just a macro to the query builder. When it sees > the view, it replaces it with the implementation of the view. Right so far. > > W

Re: [PERFORM] horizontal partition

2005-02-02 Thread Klint Gore
On Thu, 03 Feb 2005 02:10:15 +0100, Gaetano Mendola <[EMAIL PROTECTED]> wrote: > why the index usage is lost if used in that way ? This is how I interpret it (if anyone wants to set me straight or improve on it feel free) Views are implemented as rules. Rules are pretty much just a macro to th

Re: [PERFORM] horizontal partition

2005-02-02 Thread Josh Berkus
Gaetano, > I did in that way just to not use postgresql specific feature. > I can give it a try and I let you know, however the question remain, > why the index usage is lost if used in that way ? Because PostgreSQL is materializing the entire UNION data set in the subselect. What Postgres ver

Re: [PERFORM] horizontal partition

2005-02-02 Thread Gaetano Mendola
Josh Berkus wrote: Gaetano, I have a big table with ~ 10 Milion rows, and is a very pain administer it, so after years I convinced my self to partition it and replace the table usage ( only for reading ) with a view. Now my user_logs table is splitted in 4: user_logs user_logs_2002 user_logs_2003

Re: [PERFORM] horizontal partition

2005-02-02 Thread Josh Berkus
Gaetano, > I have a big table with ~ 10 Milion rows, and is a very > pain administer it, so after years I convinced my self > to partition it and replace the table usage ( only for reading ) > with a view. > > Now my user_logs table is splitted in 4: > > user_logs > user_logs_2002 > user_logs_2003

[PERFORM] horizontal partition

2005-02-01 Thread Gaetano Mendola
Hi all, I have a big table with ~ 10 Milion rows, and is a very pain administer it, so after years I convinced my self to partition it and replace the table usage ( only for reading ) with a view. Now my user_logs table is splitted in 4: user_logs user_logs_2002 user_logs_2003 user_logs_2004 and th