explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QZIbR

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

Limit (cost=185,029.01..185,029.02 rows=1 width=256) (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=185,020.58..185,020.58 rows=1 width=256) (actual rows= loops=)

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

Nested Loop Left Join (cost=11.76..185,020.57 rows=1 width=256) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=11.34..185,012.12 rows=1 width=256) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=11.34..185,010.65 rows=1 width=256) (actual rows= loops=)

  • Join Filter: (pbh.infoid = i.contractid)
8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=11.34..3,765.95 rows=1 width=256) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Nested Loop (cost=10.91..66.91 rows=15 width=8) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

HashAggregate (cost=10.62..10.75 rows=13 width=4) (actual rows= loops=)

  • Group Key: ecc.costcenterid
11. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on employeecostcenter ecc (cost=4.39..10.58 rows=15 width=4) (actual rows= loops=)

  • Recheck Cond: (employeeid = $0)
12. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on empcc_emp_idx (cost=0.00..4.39 rows=15 width=0) (actual rows= loops=)

  • Index Cond: (employeeid = $0)
13. 0.000 0.000 ↓ 0.0

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

  • Index Cond: (costcenterid = ecc.costcenterid)
14. 0.000 0.000 ↓ 0.0

Index Scan using pbh_costcenterid on paidbillshistory pbh (cost=0.43..246.59 rows=1 width=256) (actual rows= loops=)

  • Index Cond: (costcenterid = cc.costcenterid)
  • Filter: (((costcenterno)::text = ANY ('{CA002-1001-10012-140,""}'::text[])) AND (invoicedate >= '2019-11-01'::date) AND (invoicedate < '2019-12-02'::date) AND (vendorid > '-1'::integer) AND ((costcenterno)::text = 'CA0 (...)
15. 0.000 0.000 ↓ 0.0

Seq Scan on inventories i (cost=0.00..176,675.74 rows=203,065 width=2,486) (actual rows= loops=)

  • Filter: (status = 0)
16. 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)
17. 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)