explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 91uX

Settings
# exclusive inclusive rows x rows loops node
1. 0.014 1,325.806 ↑ 1.0 41 1

Limit (cost=66,562.35..66,567.20 rows=41 width=7,009) (actual time=1,321.436..1,325.806 rows=41 loops=1)

2. 13.580 1,325.792 ↑ 21,860.4 41 1

Gather Merge (cost=66,562.35..172,621.79 rows=896,277 width=7,009) (actual time=1,321.432..1,325.792 rows=41 loops=1)

  • Workers Planned: 3
  • Workers Launched: 3
3. 69.081 1,312.212 ↑ 8,787.0 34 4 / 4

Sort (cost=65,562.31..66,309.20 rows=298,759 width=7,009) (actual time=1,312.210..1,312.212 rows=34 loops=4)

  • Sort Key: t1.date DESC, t1.id
  • Sort Method: top-N heapsort Memory: 36kB
  • Worker 0: Sort Method: top-N heapsort Memory: 34kB
  • Worker 1: Sort Method: top-N heapsort Memory: 31kB
  • Worker 2: Sort Method: top-N heapsort Memory: 32kB
4. 95.616 1,243.131 ↑ 1.3 231,666 4 / 4

Hash Join (cost=8,255.33..56,065.43 rows=298,759 width=7,009) (actual time=32.388..1,243.131 rows=231,666 loops=4)

  • Hash Cond: (t2.account_type_id = t3.id)
5. 93.557 1,147.483 ↑ 1.3 231,666 4 / 4

Hash Join (cost=8,254.24..54,449.17 rows=298,759 width=7,017) (actual time=32.304..1,147.483 rows=231,666 loops=4)

  • Hash Cond: (t6.user_group_id = t7.id)
6. 96.079 1,053.910 ↑ 1.3 231,666 4 / 4

Hash Join (cost=8,253.11..53,109.85 rows=298,759 width=7,025) (actual time=32.278..1,053.910 rows=231,666 loops=4)

  • Hash Cond: (t8.account_type_id = t9.id)
7. 99.589 957.827 ↑ 1.3 231,666 4 / 4

Hash Join (cost=8,252.02..51,493.60 rows=298,759 width=7,033) (actual time=32.263..957.827 rows=231,666 loops=4)

  • Hash Cond: (t10.user_group_id = t11.id)
8. 158.197 858.234 ↑ 1.3 231,666 4 / 4

Parallel Hash Join (cost=8,250.88..50,154.28 rows=298,759 width=7,041) (actual time=32.249..858.234 rows=231,666 loops=4)

  • Hash Cond: (t8.user_id = t10.id)
  • Join Filter: ((t1.from_id = ANY ('{1,2,3}'::bigint[])) OR (t1.to_id = ANY ('{1,2,3}'::bigint[])) OR ((t6.user_group_id = ANY ('{4,5,7}'::bigint[])) AND (t2.account_type_id = '4'::bigint)) OR ((t10.user_group_id = ANY ('{4,5,7}'::bigint[])) AND (t8.account_type_id = '4'::bigint)))
9. 143.588 694.661 ↑ 1.3 231,666 4 / 4

Hash Join (cost=5,546.44..46,665.32 rows=298,759 width=7,041) (actual time=26.658..694.661 rows=231,666 loops=4)

  • Hash Cond: (t1.to_id = t8.id)
  • Join Filter: (((t1.subclass)::text <> 'SCHEDULED_PAYMENT'::text) OR (t8.user_id <> '1'::bigint) OR t1.show_to_receiver)
10. 116.546 540.649 ↑ 1.3 231,666 4 / 4

Parallel Hash Join (cost=4,127.19..44,461.68 rows=298,759 width=7,025) (actual time=15.583..540.649 rows=231,666 loops=4)

  • Hash Cond: (t2.user_id = t6.id)
11. 156.880 420.151 ↑ 1.3 231,666 4 / 4

Hash Join (cost=1,422.75..40,972.90 rows=298,759 width=7,025) (actual time=11.507..420.151 rows=231,666 loops=4)

  • Hash Cond: (t1.from_id = t2.id)
  • Join Filter: (((t2.user_id = '1'::bigint) OR ((t1.authorization_type)::text <> 'OPERATOR'::text)) AND (((t1.subclass)::text <> 'TICKET'::text) OR (t2.user_id IS NULL) OR (t2.user_id <> '1'::bigint)))
12. 106.080 255.098 ↑ 1.3 231,666 4 / 4

Hash Join (cost=3.50..38,769.21 rows=298,759 width=7,009) (actual time=3.144..255.098 rows=231,666 loops=4)

  • Hash Cond: (t1.type_id = t0.id)
13. 148.937 148.937 ↑ 1.3 231,666 4 / 4

Parallel Seq Scan on transactions t1 (cost=0.00..34,657.78 rows=298,759 width=7,009) (actual time=3.034..148.937 rows=231,666 loops=4)

  • Filter: (((authorization_status)::text = ANY ('{NA,AUTHORIZED}'::text[])) AND ((subclass)::text = ANY ('{PAYMENT,ORDER_PAYMENT,IMPORT,CHARGEBACK}'::text[])))
  • Rows Removed by Filter: 8,485
14. 0.009 0.081 ↑ 1.0 10 4 / 4

Hash (cost=3.38..3.38 rows=10 width=8) (actual time=0.081..0.081 rows=10 loops=4)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
15. 0.006 0.072 ↑ 1.0 10 4 / 4

Nested Loop (cost=1.09..3.38 rows=10 width=8) (actual time=0.063..0.072 rows=10 loops=4)

  • Join Filter: (t4.currency_id = t5.id)
16. 0.028 0.028 ↑ 1.0 1 4 / 4

Seq Scan on currencies t5 (cost=0.00..1.01 rows=1 width=8) (actual time=0.027..0.028 rows=1 loops=4)

  • Filter: (network_id = '1'::bigint)
17. 0.021 0.038 ↑ 1.0 10 4 / 4

Hash Join (cost=1.09..2.24 rows=10 width=16) (actual time=0.030..0.038 rows=10 loops=4)

  • Hash Cond: (t0.from_account_type_id = t4.id)
18. 0.006 0.006 ↑ 1.0 10 4 / 4

Seq Scan on transfer_types t0 (cost=0.00..1.10 rows=10 width=16) (actual time=0.006..0.006 rows=10 loops=4)

19. 0.004 0.011 ↑ 1.0 4 4 / 4

Hash (cost=1.04..1.04 rows=4 width=16) (actual time=0.011..0.011 rows=4 loops=4)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
20. 0.007 0.007 ↑ 1.0 4 4 / 4

Seq Scan on account_types t4 (cost=0.00..1.04 rows=4 width=16) (actual time=0.006..0.007 rows=4 loops=4)

21. 3.643 8.173 ↑ 1.0 32,900 4 / 4

Hash (cost=1,008.00..1,008.00 rows=32,900 width=24) (actual time=8.173..8.173 rows=32,900 loops=4)

  • Buckets: 65,536 Batches: 1 Memory Usage: 2,312kB
22. 4.530 4.530 ↑ 1.0 32,900 4 / 4

Seq Scan on accounts t2 (cost=0.00..1,008.00 rows=32,900 width=24) (actual time=0.008..4.530 rows=32,900 loops=4)

23. 1.459 3.952 ↑ 2.4 8,225 4 / 4

Parallel Hash (cost=2,462.53..2,462.53 rows=19,353 width=16) (actual time=3.952..3.952 rows=8,225 loops=4)

  • Buckets: 65,536 Batches: 1 Memory Usage: 2,112kB
24. 2.493 2.493 ↑ 2.4 8,225 4 / 4

Parallel Seq Scan on users t6 (cost=0.00..2,462.53 rows=19,353 width=16) (actual time=0.289..2.493 rows=8,225 loops=4)

25. 4.793 10.424 ↑ 1.0 32,900 4 / 4

Hash (cost=1,008.00..1,008.00 rows=32,900 width=24) (actual time=10.424..10.424 rows=32,900 loops=4)

  • Buckets: 65,536 Batches: 1 Memory Usage: 2,312kB
26. 5.631 5.631 ↑ 1.0 32,900 4 / 4

Seq Scan on accounts t8 (cost=0.00..1,008.00 rows=32,900 width=24) (actual time=0.078..5.631 rows=32,900 loops=4)

27. 1.986 5.376 ↑ 2.4 8,225 4 / 4

Parallel Hash (cost=2,462.53..2,462.53 rows=19,353 width=16) (actual time=5.376..5.376 rows=8,225 loops=4)

  • Buckets: 65,536 Batches: 1 Memory Usage: 2,144kB
28. 3.390 3.390 ↑ 2.4 8,225 4 / 4

Parallel Seq Scan on users t10 (cost=0.00..2,462.53 rows=19,353 width=16) (actual time=0.260..3.390 rows=8,225 loops=4)

29. 0.002 0.004 ↑ 1.0 6 4 / 4

Hash (cost=1.06..1.06 rows=6 width=8) (actual time=0.003..0.004 rows=6 loops=4)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
30. 0.002 0.002 ↑ 1.0 6 4 / 4

Seq Scan on groups t11 (cost=0.00..1.06 rows=6 width=8) (actual time=0.001..0.002 rows=6 loops=4)

31. 0.002 0.004 ↑ 1.0 4 4 / 4

Hash (cost=1.04..1.04 rows=4 width=8) (actual time=0.004..0.004 rows=4 loops=4)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
32. 0.002 0.002 ↑ 1.0 4 4 / 4

Seq Scan on account_types t9 (cost=0.00..1.04 rows=4 width=8) (actual time=0.002..0.002 rows=4 loops=4)

33. 0.003 0.016 ↑ 1.0 6 4 / 4

Hash (cost=1.06..1.06 rows=6 width=8) (actual time=0.016..0.016 rows=6 loops=4)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
34. 0.013 0.013 ↑ 1.0 6 4 / 4

Seq Scan on groups t7 (cost=0.00..1.06 rows=6 width=8) (actual time=0.012..0.013 rows=6 loops=4)

35. 0.003 0.032 ↑ 1.0 4 4 / 4

Hash (cost=1.04..1.04 rows=4 width=8) (actual time=0.031..0.032 rows=4 loops=4)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
36. 0.029 0.029 ↑ 1.0 4 4 / 4

Seq Scan on account_types t3 (cost=0.00..1.04 rows=4 width=8) (actual time=0.028..0.029 rows=4 loops=4)

Planning time : 16.217 ms
Execution time : 1,326.298 ms