explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Jxbs

Settings
# exclusive inclusive rows x rows loops node
1. 527.377 49,518.277 ↑ 1.0 1 1

Aggregate (cost=3,469,581.21..3,469,581.22 rows=1 width=8) (actual time=49,518.277..49,518.277 rows=1 loops=1)

2. 4,337.036 48,990.900 ↑ 8.3 1,389,951 1

GroupAggregate (cost=2,838,434.60..3,326,138.80 rows=11,475,393 width=194) (actual time=37,580.915..48,990.900 rows=1,389,951 loops=1)

  • Group Key: ((salary_events.created_at)::date), salary_events.payment_id, salary_events.user_id, salary_events.location_id, salary_events.export_id, salary_events.salary_kind_id, locations.name, users.first_name, users.last_name, salary_kinds.name, salary_events.status
3. 14,125.498 44,653.864 ↑ 3.3 3,529,662 1

Sort (cost=2,838,434.60..2,867,123.08 rows=11,475,393 width=82) (actual time=37,580.885..44,653.864 rows=3,529,662 loops=1)

  • Sort Key: ((salary_events.created_at)::date), salary_events.payment_id, salary_events.user_id, salary_events.location_id, salary_events.export_id, salary_events.salary_kind_id, locations.name, users.first_name, users.last_name, salary_kinds.name, salary_events.status
  • Sort Method: external merge Disk: 265648kB
4. 4,193.330 30,528.366 ↑ 3.3 3,529,662 1

Hash Right Join (cost=385,079.72..943,709.20 rows=11,475,393 width=82) (actual time=26,312.715..30,528.366 rows=3,529,662 loops=1)

  • Hash Cond: (transactions_billing_record_price_factors.salary_event_id = salary_events.id)
5. 29.167 29.167 ↑ 469.2 24,457 1

Index Only Scan using transactions_billing_record_price_factors_salary_event_idx on transactions_billing_record_price_factors (cost=0.29..206,195.15 rows=11,475,393 width=4) (actual time=0.057..29.167 rows=24,457 loops=1)

  • Heap Fetches: 24457
6. 4,258.896 26,305.869 ↓ 1.1 3,529,662 1

Hash (cost=296,825.84..296,825.84 rows=3,250,768 width=90) (actual time=26,305.869..26,305.869 rows=3,529,662 loops=1)

  • Buckets: 1048576 Batches: 8 Memory Usage: 55513kB
7. 4,043.917 22,046.973 ↓ 1.1 3,529,662 1

Hash Join (cost=443.78..296,825.84 rows=3,250,768 width=90) (actual time=9.532..22,046.973 rows=3,529,662 loops=1)

  • Hash Cond: (salary_events.location_id = locations.id)
8. 10,971.522 18,002.888 ↓ 1.1 3,529,662 1

Hash Join (cost=436.37..252,120.37 rows=3,250,768 width=79) (actual time=9.344..18,002.888 rows=3,529,662 loops=1)

  • Hash Cond: (salary_events.salary_kind_id = salary_kinds.id)
  • Join Filter: (((salary_events.payment_id)::text ~~* '%1%'::text) OR ((salary_events.created_at)::text ~~* '%1%'::text) OR (((users.first_name)::text || COALESCE((' '::text || (users.last_name)::text), ''::text)) ~~* '%1%'::text) OR ((salary_kinds.name)::text ~~* '%1%'::text))
9. 5,096.275 7,031.353 ↓ 1.1 3,529,662 1

Hash Join (cost=435.26..126,152.00 rows=3,250,768 width=57) (actual time=9.213..7,031.353 rows=3,529,662 loops=1)

  • Hash Cond: (salary_events.user_id = users.id)
10. 1,925.944 1,925.944 ↓ 1.1 3,529,662 1

Seq Scan on salary_events (cost=0.00..81,018.68 rows=3,250,768 width=41) (actual time=0.006..1,925.944 rows=3,529,662 loops=1)

11. 3.590 9.134 ↓ 1.0 5,168 1

Hash (cost=370.67..370.67 rows=5,167 width=20) (actual time=9.134..9.134 rows=5,168 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 336kB
12. 5.544 5.544 ↓ 1.0 5,168 1

Seq Scan on users (cost=0.00..370.67 rows=5,167 width=20) (actual time=0.012..5.544 rows=5,168 loops=1)

13. 0.009 0.013 ↑ 1.0 5 1

Hash (cost=1.05..1.05 rows=5 width=26) (actual time=0.013..0.013 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
14. 0.004 0.004 ↑ 1.0 5 1

Seq Scan on salary_kinds (cost=0.00..1.05 rows=5 width=26) (actual time=0.002..0.004 rows=5 loops=1)

15. 0.064 0.168 ↑ 1.0 107 1

Hash (cost=6.07..6.07 rows=107 width=15) (actual time=0.168..0.168 rows=107 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
16. 0.104 0.104 ↑ 1.0 107 1

Seq Scan on locations (cost=0.00..6.07 rows=107 width=15) (actual time=0.009..0.104 rows=107 loops=1)