Re: [SQL] Interest query plan

2003-10-07 Thread Tomasz Myrta
I have also another good example for a slow left join work. Can I do it better? explain analyze select * from a_doc D join A_SKLAD S ON(D.IDS=S.IDS_DOC) join A_MED M ON(S.IDS_MED=M.IDS) where d .date_op >= 9600 and d.date_op <= 9700; -> Seq Scan on a_doc d (cost=0.00..13145.43 ro

Re: [SQL] Interest query plan

2003-10-07 Thread pginfo
I have also another good example for a slow left join work. Can I do it better? explain analyze select * from a_doc D join A_SKLAD S ON(D.IDS=S.IDS_DOC) join A_MED M ON(S.IDS_MED=M.IDS) where d .date_op >= 9600 and d.date_op <= 9700; QUER

Re: [SQL] Interest query plan

2003-10-07 Thread pginfo
explain analyze select * from a_doc D left outer join A_SKLAD S ON(D.IDS=S.IDS_DOC) left join A_MED M ON(S.IDS_MED=M.IDS) where d.IDS='SOF_700060'; QUERY PLAN --

Re: [SQL] Interest query plan

2003-10-07 Thread Tomasz Myrta
Hi all, I am running pg 7.3.1. My query is very simple but pg generates not the best possible plan for me: analyze select * from a_doc D left outer join (A_SKLAD S join A_MED M ON(S.IDS_MED=M.IDS) )on( d.IDS=s.IDS_DOC) where d.IDS='SOF_700060'; What about: select * from a_doc D left join A_SKLA

[SQL] Interest query plan

2003-10-07 Thread pginfo
Hi all, I am running pg 7.3.1. My query is very simple but pg generates not the best possible plan for me: analyze select * from a_doc D left outer join (A_SKLAD S join A_MED M ON(S.IDS_MED=M.IDS) )on( d.IDS=s.IDS_DOC) where d.IDS='SOF_700060'; The plan is: -