zorgweb_solaris=> explain analyze SELECT zorgweb_solaris-> insrel.rnumber,insrel.dnumber,insrel.snumber,insrel.dir,insrel.number,medical_care_container.number,product.number zorgweb_solaris-> FROM mm_medical_care_container medical_care_container,mm_insrel zorgweb_solaris-> insrel,mm_product product WHERE medical_care_container.number=558332 AND zorgweb_solaris-> (medical_care_container.number=insrel.dnumber AND zorgweb_solaris(> product.number=insrel.snumber AND insrel.dir<>1); QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Nested Loop (cost=0.00..178.61 rows=1 width=28) (actual time=56.089..137.304 rows=1 loops=1) -> Nested Loop (cost=0.00..174.67 rows=1 width=28) (actual time=56.041..137.250 rows=1 loops=1) -> Merge Join (cost=0.00..170.73 rows=1 width=28) (actual time=55.986..137.189 rows=1 loops=1) Merge Cond: ("outer".number = "inner".number) -> Nested Loop (cost=0.00..2966.75 rows=30 width=28) (actual time=46.161..125.315 rows=2 loops=1) -> Nested Loop (cost=0.00..2848.50 rows=30 width=24) (actual time=46.108..125.205 rows=2 loops=1) -> Index Scan using mm_insrel_full_idx on mm_insrel_table (cost=0.00..2678.20 rows=30 width=20) (actual time=46.042..125.067 rows=2 loops=1) Index Cond: (dnumber = 558332) -> Index Scan using mm_medical_care_container_table_pkey on mm_medical_care_container_table (cost=0.00..5.67 rows=1 width=4) (actual time=0.048..0.049 rows=1 loops=2) Index Cond: (558332 = number) -> Index Scan using mm_object_pkey on mm_object (cost=0.00..3.93 rows=1 width=4) (actual time=0.041..0.043 rows=1 loops=2) Index Cond: (mm_object.number = "outer".snumber) -> Index Scan using mm_product_table_pkey on mm_product_table (cost=0.00..67.90 rows=1571 width=4) (actual time=0.024..9.462 rows=1571 loops=1) -> Index Scan using mm_object_pkey on mm_object (cost=0.00..3.93 rows=1 width=4) (actual time=0.043..0.045 rows=1 loops=1) Index Cond: ("outer".number = mm_object.number) -> Index Scan using mm_object_pkey on mm_object (cost=0.00..3.93 rows=1 width=4) (actual time=0.038..0.041 rows=1 loops=1) Index Cond: (number = 558332) Total runtime: 138.132 ms (18 rows)