explain.depesz.com

PostgreSQL's explain analyze made readable

Result: km8r

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

Limit (cost=30,215.39..30,215.40 rows=1 width=255) (actual rows= loops=)

2.          

Initplan (for Limit)

3. 0.000 0.000 ↓ 0.0

Index Scan using idx_employee_empid on employee (cost=0.42..8.44 rows=1 width=4) (actual rows= loops=)

  • Index Cond: ((employeeid)::text = 'CGI9998'::text)
4. 0.000 0.000 ↓ 0.0

Sort (cost=30,206.95..30,206.96 rows=1 width=255) (actual rows= loops=)

  • Sort Key: pbh.total, pbh.billid
5. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,159.79..30,206.94 rows=1 width=255) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=3,159.37..30,198.50 rows=1 width=255) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Nested Loop Semi Join (cost=3,159.37..30,197.02 rows=1 width=255) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=3,159.09..30,196.07 rows=1 width=259) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=3,158.80..30,187.75 rows=1 width=255) (actual rows= loops=)

  • Hash Cond: (i.contractid = pbh.infoid)
10. 0.000 0.000 ↓ 0.0

Seq Scan on inventories i (cost=0.00..24,272.89 rows=200,440 width=2,486) (actual rows= loops=)

  • Filter: (status = 0)
11. 0.000 0.000 ↓ 0.0

Hash (cost=3,158.79..3,158.79 rows=1 width=255) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on paidbillshistory pbh (cost=2,525.82..3,158.79 rows=1 width=255) (actual rows= loops=)

  • Recheck Cond: (((costcenterno)::text = ANY ('{CA002-1001-10012-140,""}'::text[])) AND ((costcenterno)::text = 'CA002-1001-10012-140'::text) AND (invoicedate >= '2019-11-01'::date) AND (invoicedate < '2019-1 (...)
  • Filter: ((vendorid > '-1'::integer) AND (typeid = 3) AND (glid = 322) AND (directbilling = 1))
13. 0.000 0.000 ↓ 0.0

BitmapAnd (cost=2,525.82..2,525.82 rows=162 width=0) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on pbh_costcenterno (cost=0.00..143.07 rows=3,796 width=0) (actual rows= loops=)

  • Index Cond: (((costcenterno)::text = ANY ('{CA002-1001-10012-140,""}'::text[])) AND ((costcenterno)::text = 'CA002-1001-10012-140'::text))
15. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on pbh_invoicedate (cost=0.00..2,382.50 rows=113,407 width=0) (actual rows= loops=)

  • Index Cond: ((invoicedate >= '2019-11-01'::date) AND (invoicedate < '2019-12-02'::date))
16. 0.000 0.000 ↓ 0.0

Index Only Scan using costcenter_pkey on costcenter cc (cost=0.29..8.31 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (costcenterid = pbh.costcenterid)
17. 0.000 0.000 ↓ 0.0

Index Scan using cc_employeecostcenter_ind on employeecostcenter ecc (cost=0.28..0.62 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (costcenterid = cc.costcenterid)
  • Filter: (employeeid = $0)
18. 0.000 0.000 ↓ 0.0

Seq Scan on servicetypes st (cost=0.00..1.46 rows=1 width=4) (actual rows= loops=)

  • Filter: (typeid = 3)
19. 0.000 0.000 ↓ 0.0

Index Only Scan using idx_employee_empid on employee e (cost=0.42..8.44 rows=1 width=9) (actual rows= loops=)

  • Index Cond: (employeeid = (pbh.username)::text)