explain.depesz.com

PostgreSQL's explain analyze made readable

Result: drLX

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Sort (cost=51.58..51.59 rows=3 width=236) (actual rows= loops=)

  • Sort Key: "*SELECT* 1".date
2. 0.000 0.000 ↓ 0.0

Append (cost=14.74..51.53 rows=3 width=239) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Result (cost=14.74..29.55 rows=2 width=264) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Append (cost=14.74..29.55 rows=2 width=264) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 1 (cost=14.74..14.77 rows=1 width=264) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

HashAggregate (cost=14.74..14.76 rows=1 width=264) (actual rows= loops=)

  • Group Key: sales_details.saleid, sales.saledate, sales_details.uomname, sales_details.uomqty, sales_details.baseqty, sales.indexvalue, (sales_details.purchaseindex)::text, sales_details.priceunitbeforetax
7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..12.19 rows=1 width=264) (actual rows= loops=)

  • Join Filter: (sales_details.saleid = sales.indexvalue)
8. 0.000 0.000 ↓ 0.0

Seq Scan on sales_details (cost=0.00..11.13 rows=1 width=192) (actual rows= loops=)

  • Filter: (itemid = 'IT7'::text)
9. 0.000 0.000 ↓ 0.0

Seq Scan on sales (cost=0.00..1.04 rows=1 width=72) (actual rows= loops=)

  • Filter: ((NOT estimationsale) AND (vouchertype = 'Sales'::text) AND ((saledate)::date >= '2019-04-01'::date) AND ((saledate)::date <= '2020-03-31'::date))
10.          

SubPlan (forHashAggregate)

11. 0.000 0.000 ↓ 0.0

Aggregate (cost=1.25..1.26 rows=1 width=8) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Function Scan on unnest s_4 (cost=0.00..1.00 rows=100 width=8) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Aggregate (cost=1.25..1.26 rows=1 width=8) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Function Scan on unnest s_5 (cost=0.00..1.00 rows=100 width=8) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=0) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2 (cost=14.74..14.77 rows=1 width=264) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

HashAggregate (cost=14.74..14.76 rows=1 width=264) (actual rows= loops=)

  • Group Key: sales_details_1.saleid, sales_1.saledate, sales_details_1.uomname, sales_details_1.uomqty, sales_details_1.baseqty, sales_1.indexvalue, (sales_details_1.purchaseindex)::text, sales_details_1.priceunitbeforetax
18. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..12.19 rows=1 width=264) (actual rows= loops=)

  • Join Filter: (sales_details_1.saleid = sales_1.indexvalue)
19. 0.000 0.000 ↓ 0.0

Seq Scan on sales_details sales_details_1 (cost=0.00..11.13 rows=1 width=192) (actual rows= loops=)

  • Filter: (itemid = 'IT7'::text)
20. 0.000 0.000 ↓ 0.0

Seq Scan on sales sales_1 (cost=0.00..1.04 rows=1 width=72) (actual rows= loops=)

  • Filter: ((NOT estimationsale) AND (vouchertype = 'Manufacture'::text) AND ((saledate)::date >= '2019-04-01'::date) AND ((saledate)::date <= '2020-03-31'::date))
21.          

SubPlan (forHashAggregate)

22. 0.000 0.000 ↓ 0.0

Aggregate (cost=1.25..1.26 rows=1 width=8) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Function Scan on unnest s_2 (cost=0.00..1.00 rows=100 width=8) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Aggregate (cost=1.25..1.26 rows=1 width=8) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Function Scan on unnest s_3 (cost=0.00..1.00 rows=100 width=8) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Result (cost=0.00..0.01 rows=1 width=0) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 3 (cost=0.14..21.98 rows=1 width=188) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.14..21.97 rows=1 width=188) (actual rows= loops=)

29. 0.000 0.000 ↓ 0.0

Seq Scan on salesreturn_details (cost=0.00..11.25 rows=1 width=176) (actual rows= loops=)

  • Filter: (itemid = 'IT7'::text)
30. 0.000 0.000 ↓ 0.0

Index Scan using salesreturn_pkey on salesreturn (cost=0.14..8.17 rows=1 width=44) (actual rows= loops=)

  • Index Cond: (indexvalue = salesreturn_details.salereturnid)
  • Filter: (((salereturndate)::date >= '2019-04-01'::date) AND ((salereturndate)::date <= '2020-03-31'::date))
31.          

SubPlan (forNested Loop)

32. 0.000 0.000 ↓ 0.0

Aggregate (cost=1.25..1.26 rows=1 width=8) (actual rows= loops=)

33. 0.000 0.000 ↓ 0.0

Function Scan on unnest s (cost=0.00..1.00 rows=100 width=8) (actual rows= loops=)

34. 0.000 0.000 ↓ 0.0

Aggregate (cost=1.25..1.26 rows=1 width=8) (actual rows= loops=)

35. 0.000 0.000 ↓ 0.0

Function Scan on unnest s_1 (cost=0.00..1.00 rows=100 width=8) (actual rows= loops=)