explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 12Ne : cc-fix

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

Limit (cost=182,646.46..182,646.46 rows=1 width=254) (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=182,638.02..182,638.02 rows=1 width=254) (actual rows= loops=)

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

Nested Loop Left Join (cost=3,167.22..182,638.01 rows=1 width=254) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=3,166.79..182,633.56 rows=1 width=254) (actual rows= loops=)

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

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

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

Hash (cost=3,166.78..3,166.78 rows=1 width=254) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2,866.59..3,166.78 rows=1 width=254) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Nested Loop Semi Join (cost=2,866.59..3,165.32 rows=1 width=254) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2,866.31..3,164.36 rows=1 width=258) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on paidbillshistory pbh (cost=2,866.02..3,156.04 rows=1 width=254) (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,866.02..2,866.02 rows=73 width=0) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on pbh_costcenterno (cost=0.00..291.67 rows=3,456 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,574.10 rows=61,367 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.45 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..4.44 rows=1 width=9) (actual rows= loops=)

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