Paul Malan wrote:
>> Yes. It also reminds me why I dislike the graphical execution
>> plans from MS SQL Server :-)
> 
> How does one get a view other than the graphical representation?  I
> poked around a bit but didn't know what to look for...

http://www.sql-server-performance.com/query_execution_plan_analysis.asp

But the problem is both with 'MS SQL server' and with 
'graphical'. I created a dummy database with the same schema as 
your database (except for the indexes) and got the following 
execution plan in PostgreSQL:

Unique  (cost=4.09..4.12 rows=1 width=60) (actual time=0.38..0.38 
rows=1 loops=1)
   ->  Sort  (cost=4.09..4.09 rows=1 width=60) (actual 
time=0.38..0.38 rows=1 loops=1)
         Sort Key: t.tkt_code, t.tkt_date, t.truck_code, t.po, 
t.truck_net_wgt, t.hler_code, o.proj_code, o.cust_job_num, 
o.cust_code, o.order_code, k.curr_driv_empl_code, l.prod_descr
         ->  Nested Loop  (cost=0.00..4.08 rows=1 width=60) 
(actual time=0.18..0.19 rows=1 loops=1)
               Join Filter: ("outer".order_code = "inner".order_code)
               ->  Nested Loop  (cost=0.00..3.06 rows=1 width=52) 
(actual time=0.14..0.15 rows=1 loops=1)
                     Join Filter: ("outer".truck_code = 
"inner".truck_code)
                     ->  Nested Loop  (cost=0.00..2.03 rows=1 
width=44) (actual time=0.10..0.10 rows=1 loops=1)
                           Join Filter: ("outer".order_code = 
"inner".order_code)
                           ->  Seq Scan on tick t 
(cost=0.00..1.01 rows=1 width=28) (actual time=0.04..0.04 rows=1 
loops=1)
                           ->  Seq Scan on ordr o 
(cost=0.00..1.01 rows=1 width=16) (actual time=0.03..0.03 rows=1 
loops=1)
                     ->  Seq Scan on truc k  (cost=0.00..1.01 
rows=1 width=8) (actual time=0.03..0.03 rows=1 loops=1)
               ->  Seq Scan on ordl l  (cost=0.00..1.01 rows=1 
width=8) (actual time=0.03..0.03 rows=1 loops=1)

This execution plan has a much higher information density and can 
still be read without any mouse hovering.

The graphical tools for PostgreSQL have an equally low 
information density: 
http://sources.redhat.com/rhdb/tools/rhdb_explain_0501_01.png


> I implemented your latest version of the query and it actually
> returned in the same amount of time as your version previous, to the
> second.

Did the execution plan change?

Jochem

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:189155
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to