explain.depesz.com

PostgreSQL's explain analyze made readable

Result: pOem

Settings
# exclusive inclusive rows x rows loops node
1. 982.188 6,950.080 ↑ 3.5 265,048 1

Sort (cost=882,116.81..884,414.47 rows=919,065 width=753) (actual time=6,751.356..6,950.080 rows=265,048 loops=1)

  • Sort Key: events_archive.date
  • Sort Method: external merge Disk: 176,760kB
2. 177.441 5,967.892 ↑ 3.5 265,048 1

Hash Left Join (cost=7,875.69..483,231.30 rows=919,065 width=753) (actual time=78.377..5,967.892 rows=265,048 loops=1)

  • Hash Cond: ((events_archive.uid)::text = (eo.event_uid)::text)
3. 162.198 5,751.419 ↑ 2.1 237,354 1

Hash Left Join (cost=3,172.18..431,175.19 rows=508,826 width=687) (actual time=38.572..5,751.419 rows=237,354 loops=1)

  • Hash Cond: ((events_archive.uid)::text = (em.event_uid)::text)
4. 134.721 5,551.667 ↑ 2.1 237,354 1

Hash Join (cost=14.06..426,681.33 rows=508,826 width=535) (actual time=0.229..5,551.667 rows=237,354 loops=1)

  • Hash Cond: (events_archive.organization_id = org.id)
5. 26.787 5,416.743 ↑ 3.2 237,354 1

Append (cost=0.00..424,631.50 rows=759,442 width=217) (actual time=0.009..5,416.743 rows=237,354 loops=1)

6. 16.375 16.375 ↑ 1.0 67,548 1

Seq Scan on events_archive (cost=0.00..3,283.48 rows=67,548 width=263) (actual time=0.008..16.375 rows=67,548 loops=1)

7. 29.895 5,373.581 ↑ 4.1 169,806 1

Subquery Scan on "*SELECT* 2" (cost=376,374.91..421,348.02 rows=691,894 width=213) (actual time=3,966.835..5,373.581 rows=169,806 loops=1)

8. 990.435 5,343.686 ↑ 4.1 169,806 1

GroupAggregate (cost=376,374.91..414,429.08 rows=691,894 width=221) (actual time=3,966.833..5,343.686 rows=169,806 loops=1)

  • Group Key: o.event_uid, o.chain_hash, o.date_from, o.organization_id, o.init_point_id, o.is_imported, o.is_fbs, o.autorepeat_hash
9. 1,911.962 4,353.251 ↑ 1.0 666,902 1

Sort (cost=376,374.91..378,104.65 rows=691,894 width=157) (actual time=3,966.790..4,353.251 rows=666,902 loops=1)

  • Sort Key: o.event_uid, o.chain_hash, o.date_from, o.organization_id, o.init_point_id, o.is_imported, o.is_fbs, o.autorepeat_hash
  • Sort Method: external merge Disk: 116,184kB
10. 196.519 2,441.289 ↑ 1.0 666,902 1

Hash Join (cost=4,533.98..254,867.03 rows=691,894 width=157) (actual time=33.574..2,441.289 rows=666,902 loops=1)

  • Hash Cond: (o.point_to_id = pt.id)
11. 236.472 2,228.233 ↑ 1.0 666,902 1

Hash Join (cost=2,266.99..250,783.66 rows=691,894 width=157) (actual time=16.269..2,228.233 rows=666,902 loops=1)

  • Hash Cond: (o.point_from_id = p.id)
12. 1,976.337 1,976.337 ↑ 1.0 666,902 1

Seq Scan on org_schedule_calendar o (cost=0.00..246,700.29 rows=691,894 width=157) (actual time=0.095..1,976.337 rows=666,902 loops=1)

  • Filter: (is_active AND (event_uid IS NOT NULL) AND (init_point_id IS NOT NULL) AND (date_from >= (CURRENT_TIMESTAMP - '30 days'::interval)))
  • Rows Removed by Filter: 1,694,592
13. 7.478 15.424 ↑ 1.4 35,784 1

Hash (cost=1,640.33..1,640.33 rows=50,133 width=8) (actual time=15.424..15.424 rows=35,784 loops=1)

  • Buckets: 65,536 Batches: 1 Memory Usage: 1,910kB
14. 7.946 7.946 ↑ 1.4 35,784 1

Seq Scan on valid_point p (cost=0.00..1,640.33 rows=50,133 width=8) (actual time=0.007..7.946 rows=35,784 loops=1)

  • Filter: (NOT is_deleted)
15. 7.256 16.537 ↑ 1.4 35,784 1

Hash (cost=1,640.33..1,640.33 rows=50,133 width=8) (actual time=16.537..16.537 rows=35,784 loops=1)

  • Buckets: 65,536 Batches: 1 Memory Usage: 1,910kB
16. 9.281 9.281 ↑ 1.4 35,784 1

Seq Scan on valid_point pt (cost=0.00..1,640.33 rows=50,133 width=8) (actual time=0.012..9.281 rows=35,784 loops=1)

  • Filter: (NOT is_deleted)
17. 0.096 0.203 ↓ 1.0 138 1

Hash (cost=12.38..12.38 rows=134 width=317) (actual time=0.203..0.203 rows=138 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 57kB
18. 0.107 0.107 ↓ 1.0 138 1

Seq Scan on organization org (cost=0.00..12.38 rows=134 width=317) (actual time=0.006..0.107 rows=138 loops=1)

  • Filter: (NOT is_deleted)
  • Rows Removed by Filter: 4
19. 25.866 37.554 ↑ 1.0 80,337 1

Hash (cost=2,153.61..2,153.61 rows=80,361 width=152) (actual time=37.554..37.554 rows=80,337 loops=1)

  • Buckets: 131,072 Batches: 1 Memory Usage: 11,427kB
20. 11.688 11.688 ↑ 1.0 80,337 1

Seq Scan on event_meta em (cost=0.00..2,153.61 rows=80,361 width=152) (actual time=0.006..11.688 rows=80,337 loops=1)

21. 26.329 39.032 ↓ 1.0 103,526 1

Hash (cost=3,416.56..3,416.56 rows=102,956 width=58) (actual time=39.032..39.032 rows=103,526 loops=1)

  • Buckets: 131,072 Batches: 1 Memory Usage: 11,539kB
22. 12.703 12.703 ↓ 1.0 103,526 1

Seq Scan on event_orders eo (cost=0.00..3,416.56 rows=102,956 width=58) (actual time=0.010..12.703 rows=103,526 loops=1)

Planning time : 1.364 ms
Execution time : 7,129.293 ms