Skip to content

Instantly share code, notes, and snippets.

@rightfold
Created November 3, 2015 13:45
Show Gist options
  • Save rightfold/fab5a363b748e0950bc2 to your computer and use it in GitHub Desktop.
Save rightfold/fab5a363b748e0950bc2 to your computer and use it in GitHub Desktop.
QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------------------------------------
HashAggregate (cost=8250.49..8253.30 rows=281 width=69)
Group Key: p.id, p.article_number, p.name
-> Hash Join (cost=810.82..8233.20 rows=988 width=69)
Hash Cond: (coi.product_revision_id = pr.id)
-> Hash Join (cost=745.36..8154.15 rows=988 width=52)
Hash Cond: (coi.order_id = coo.id)
-> Nested Loop (cost=39.20..6700.06 rows=196816 width=20)
-> Hash Join (cost=38.78..660.68 rows=131 width=8)
Hash Cond: (doi.order_id = doo.id)
-> Seq Scan on dealer_order_items doi (cost=0.00..518.70 rows=27170 width=12)
-> Hash (cost=38.70..38.70 rows=6 width=4)
-> Seq Scan on dealer_orders doo (cost=0.00..38.70 rows=6 width=4)
Filter: (date_part('year'::text, "time") = 2013::double precision)
-> Index Scan using customer_order_items_product_revision_id_idx on customer_order_items coi (cost=0.42..31.04 rows=1506 width=12)
Index Cond: (product_revision_id = doi.product_revision_id)
-> Hash (cost=705.31..705.31 rows=68 width=40)
-> Seq Scan on customer_orders coo (cost=0.00..705.31 rows=68 width=40)
Filter: (date_part('year'::text, "time") = 2013::double precision)
-> Hash (cost=60.59..60.59 rows=390 width=29)
-> Hash Join (cost=25.32..60.59 rows=390 width=29)
Hash Cond: (pr.product_id = p.id)
-> Seq Scan on product_revisions pr (cost=0.00..29.90 rows=390 width=8)
-> Hash (cost=21.81..21.81 rows=281 width=25)
-> Seq Scan on products p (cost=0.00..21.81 rows=281 width=25)
(24 rows)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment