[PERFORM] Re: need to repeat the same condition on joined tables in order to choose the proper plan

2011-06-14 Thread Robert Klemme
On 14.06.2011 18:29, Tom Lane wrote: Svetlin Manavski writes: I am really surprised to see that the planner needs me to explicitly specify the same condition twice like this: SD.detectorid = SS.detectorid and SD.sessionid = SS.id and SD.detectorid = 1 and SD.sessionid>= 1

Re: [PERFORM] need to repeat the same condition on joined tables in order to choose the proper plan

2011-06-14 Thread Tom Lane
Svetlin Manavski writes: > I am really surprised to see that the planner needs me to explicitly specify > the same condition twice like this: > SD.detectorid = SS.detectorid > and SD.sessionid = SS.id > and SD.detectorid = 1 > and SD.sessionid >= 10010::INT8 and SD.session

[PERFORM] need to repeat the same condition on joined tables in order to choose the proper plan

2011-06-14 Thread Svetlin Manavski
Hi performance gurus, One of the reasons I prefer PostgreSQL is because it does not implement hints. However I have a situation which seems like I am forced to use a hint-like statement: I have 2 tables in PostgreSQL 9.0: tcpsessions - about 4 Mrows in lab, hundreds of Mrows in production primar