Re: [PERFORM] partitioned table: differents plans, slow on some situations

2012-01-11 Thread Matteo Sgalaberni
- Original Message - > From: "Robert Haas" Hi Robert, I solved the problem by modifying the query: before:                    ORDER BY dlr.timestamp_todeliver DESC LIMIT after:                    ORDER BY sms.timestamp_todeliver DESC LIMIT modifying this, the planner changed and compu

Re: [PERFORM] partitioned table: differents plans, slow on some situations

2012-01-10 Thread Robert Haas
2011/12/30 Matteo Sgalaberni : > I'm sorry, I pasted the wrong ones, but the results are the same, here A and > B again: > > Query A > > # EXPLAIN  ANALYZE SELECT sms.id AS id_sms > >                      FROM >                       sms_messaggio AS sms, >                       sms_messaggio_dlr

Re: [PERFORM] partitioned table: differents plans, slow on some situations

2011-12-30 Thread Matteo Sgalaberni
I'm sorry, I pasted the wrong ones, but the results are the same, here A and B again: Query A # EXPLAIN ANALYZE SELECT sms.id AS id_sms FROM sms_messaggio AS sms, sms_messaggio_dlr AS dlr WHERE sms.id = d

Re: [PERFORM] partitioned table: differents plans, slow on some situations

2011-12-30 Thread Marcin Mirosław
W dniu 30.12.2011 17:01, Matteo Sgalaberni pisze: > Hi, Hello, > I have a two tables that are partitioned by month. > > I have different results for the same query (query A/query B), the only thing > that differ from A and B is the customer id. Not only: > Query A: > > SELECT sms.id AS id_sm

[PERFORM] partitioned table: differents plans, slow on some situations

2011-12-30 Thread Matteo Sgalaberni
Hi, I have a two tables that are partitioned by month. I have different results for the same query (query A/query B), the only thing that differ from A and B is the customer id. Query A: SELECT sms.id AS id_sms                                                    FROM                        sms