explain.depesz.com

PostgreSQL's explain analyze made readable

Result: fgrm : filtrando audit

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.001 58.998 ↓ 0.0 0 1

Limit (cost=224,605.71..224,605.96 rows=100 width=153) (actual time=58.998..58.998 rows=0 loops=1)

2. 0.010 58.997 ↓ 0.0 0 1

Sort (cost=224,605.71..224,719.92 rows=45,683 width=153) (actual time=58.997..58.997 rows=0 loops=1)

  • Sort Key: bill_item_parent.date, bill_item_parent.id
  • Sort Method: quicksort Memory: 25kB
3. 0.467 58.987 ↓ 0.0 0 1

Hash Join (cost=134,953.00..222,859.74 rows=45,683 width=153) (actual time=58.987..58.987 rows=0 loops=1)

  • Hash Cond: (bill_item_parent.bill_id = bill1_.id)
4. 0.001 2.967 ↓ 0.0 0 1

Hash Anti Join (cost=132,956.55..220,235.15 rows=45,683 width=145) (actual time=2.967..2.967 rows=0 loops=1)

  • Hash Cond: ((bill_item_parent.id)::text = (billitemau2_.bill_item_id)::text)
5. 0.002 2.966 ↓ 0.0 0 1

Append (cost=0.42..86,652.36 rows=58,994 width=145) (actual time=2.966..2.966 rows=0 loops=1)

6. 0.188 0.188 ↓ 0.0 0 1

Index Scan using public_bill_item_n_bill_id2_idx on bill_item_parent (cost=0.42..5,706.26 rows=8,812 width=137) (actual time=0.188..0.188 rows=0 loops=1)

  • Index Cond: (bill_id = ANY ('{656023,656022,654936,654927,654926,654925,654933,656026,654930,654929,654937,656031,656024,654928}'::bigint[]))
  • Filter: ((NOT hide) AND (NOT cobilling) AND (company_id = 426) AND ((bill_cost_type)::text = 'TELECOM'::text))
7. 2.776 2.776 ↓ 0.0 0 1

Index Scan using bill_item_426_company_id_bill_id_billing_relative_month_idx on bill_item_426 (cost=0.43..80,946.10 rows=50,182 width=146) (actual time=2.776..2.776 rows=0 loops=1)

  • Index Cond: ((company_id = 426) AND (bill_id = ANY ('{656023,656022,654936,654927,654926,654925,654933,656026,654930,654929,654937,656031,656024,654928}'::bigint[])))
  • Filter: ((NOT hide) AND (NOT cobilling) AND ((bill_cost_type)::text = 'TELECOM'::text))
8. 0.000 0.000 ↓ 0.0 0

Hash (cost=132,789.74..132,789.74 rows=13,311 width=33) (never executed)

9. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.43..132,789.74 rows=13,311 width=33) (never executed)

10. 0.000 0.000 ↓ 0.0 0

Seq Scan on audit a (cost=0.00..71.12 rows=3 width=8) (never executed)

  • Filter: ((company_id = 426) AND (carrier_id = 59) AND (year_month = 201809))
11. 0.000 0.000 ↓ 0.0 0

Index Scan using bill_item_audit_audit_id_ix on bill_item_audit billitemau2_ (cost=0.43..43,965.33 rows=27,421 width=41) (never executed)

  • Index Cond: (audit_id = a.id)
12. 20.784 55.553 ↑ 1.0 38,284 1

Hash (cost=1,516.20..1,516.20 rows=38,420 width=16) (actual time=55.553..55.553 rows=38,284 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 2307kB
13. 34.769 34.769 ↑ 1.0 38,284 1

Seq Scan on bill bill1_ (cost=0.00..1,516.20 rows=38,420 width=16) (actual time=0.013..34.769 rows=38,284 loops=1)