explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xrDB

Settings
# exclusive inclusive rows x rows loops node
1. 0.179 781.927 ↑ 1.8 2,823 1

Limit (cost=236,559.40..236,596.90 rows=5,000 width=8) (actual time=676.641..781.927 rows=2,823 loops=1)

2. 40.081 781.748 ↑ 438.2 2,823 1

Unique (cost=236,559.40..245,837.09 rows=1,237,026 width=8) (actual time=676.640..781.748 rows=2,823 loops=1)

3. 261.123 741.667 ↑ 2.2 558,884 1

Sort (cost=236,559.40..239,651.96 rows=1,237,026 width=8) (actual time=676.639..741.667 rows=558,884 loops=1)

  • Sort Key: u.user_id, u.organisation_id
  • Sort Method: external merge Disk: 9904kB
4. 34.235 480.544 ↑ 2.2 558,884 1

Append (cost=0.41..94,466.49 rows=1,237,026 width=8) (actual time=0.020..480.544 rows=558,884 loops=1)

5. 0.419 26.356 ↑ 1.0 5,000 1

Limit (cost=0.41..2,461.03 rows=5,000 width=8) (actual time=0.020..26.356 rows=5,000 loops=1)

6. 5.268 25.937 ↑ 246.2 5,000 1

Nested Loop (cost=0.41..605,780.04 rows=1,230,950 width=8) (actual time=0.020..25.937 rows=5,000 loops=1)

7. 0.581 0.581 ↑ 257.9 5,022 1

Seq Scan on temp_data d (cost=0.00..37,059.05 rows=1,295,005 width=17) (actual time=0.003..0.581 rows=5,022 loops=1)

8. 20.088 20.088 ↑ 1.0 1 5,022

Index Scan using users_username_key on users u (cost=0.41..0.44 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=5,022)

  • Index Cond: ((username)::text = (d.username)::text)
9. 283.656 419.953 ↑ 2.2 553,884 1

Hash Join (cost=2,737.03..79,635.19 rows=1,232,026 width=8) (actual time=22.110..419.953 rows=553,884 loops=1)

  • Hash Cond: ((d_1.username)::text = (u_1.email)::text)
10. 114.435 114.435 ↓ 1.0 1,295,563 1

Seq Scan on temp_data d_1 (cost=0.00..37,059.05 rows=1,295,005 width=17) (actual time=0.002..114.435 rows=1,295,563 loops=1)

11. 9.757 21.862 ↑ 1.0 42,065 1

Hash (cost=2,189.79..2,189.79 rows=43,779 width=34) (actual time=21.862..21.862 rows=42,065 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 3245kB
12. 12.105 12.105 ↓ 1.0 43,823 1

Seq Scan on users u_1 (cost=0.00..2,189.79 rows=43,779 width=34) (actual time=0.004..12.105 rows=43,823 loops=1)

Planning time : 0.563 ms
Execution time : 784.286 ms