explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7qzb

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

Sort (cost=66.30..66.56 rows=103 width=206) (actual rows= loops=)

  • Sort Key: purchase.invoicedate
2. 0.000 0.000 ↓ 0.0

Append (cost=0.00..61.83 rows=103 width=214) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Result (cost=0.00..38.24 rows=3 width=158) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Append (cost=0.00..38.24 rows=3 width=158) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..12.54 rows=1 width=158) (actual rows= loops=)

  • Join Filter: (purchase_details.purchaseid = purchase.indexvalue)
6. 0.000 0.000 ↓ 0.0

Seq Scan on purchase_details (cost=0.00..11.50 rows=1 width=118) (actual rows= loops=)

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

Seq Scan on purchase (cost=0.00..1.02 rows=1 width=72) (actual rows= loops=)

  • Filter: ((vouchertype = 'Purchase'::text) AND ((invoicedate)::date >= '2019-04-01'::date) AND ((invoicedate)::date <= '2020-03-31'::date))
8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..12.84 rows=1 width=158) (actual rows= loops=)

  • Join Filter: (purchase_details_1.purchaseid = purchase_1.indexvalue)
9. 0.000 0.000 ↓ 0.0

Seq Scan on purchase_details purchase_details_1 (cost=0.00..11.80 rows=1 width=118) (actual rows= loops=)

  • Filter: ((itemid = 'IT7'::text) AND (vouchertype = 'Manufacture'::text))
10. 0.000 0.000 ↓ 0.0

Seq Scan on purchase purchase_1 (cost=0.00..1.02 rows=1 width=72) (actual rows= loops=)

  • Filter: ((vouchertype = 'Manufacture'::text) AND ((invoicedate)::date >= '2019-04-01'::date) AND ((invoicedate)::date <= '2020-03-31'::date))
11. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..12.84 rows=1 width=158) (actual rows= loops=)

  • Join Filter: (purchase_details_2.purchaseid = purchase_2.indexvalue)
12. 0.000 0.000 ↓ 0.0

Seq Scan on purchase_details purchase_details_2 (cost=0.00..11.80 rows=1 width=118) (actual rows= loops=)

  • Filter: ((itemid = 'IT7'::text) AND (vouchertype = 'By Product'::text))
13. 0.000 0.000 ↓ 0.0

Seq Scan on purchase purchase_2 (cost=0.00..1.02 rows=1 width=72) (actual rows= loops=)

  • Filter: ((vouchertype = 'Manufacture'::text) AND ((invoicedate)::date >= '2019-04-01'::date) AND ((invoicedate)::date <= '2020-03-31'::date))
14. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 4 (cost=0.14..23.58 rows=100 width=216) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.14..22.58 rows=100 width=216) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Seq Scan on purchasereturn_details (cost=0.00..11.38 rows=1 width=176) (actual rows= loops=)

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

Index Scan using purchasereturn_pkey on purchasereturn (cost=0.14..8.17 rows=1 width=72) (actual rows= loops=)

  • Index Cond: (indexvalue = purchasereturn_details.purchasereturnid)
  • Filter: (((purchasereturndate)::date >= '2019-04-01'::date) AND ((purchasereturndate)::date <= '2020-03-31'::date))
18.          

SubPlan (forNested Loop)

19. 0.000 0.000 ↓ 0.0

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

20. 0.000 0.000 ↓ 0.0

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

21. 0.000 0.000 ↓ 0.0

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

22. 0.000 0.000 ↓ 0.0

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