explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1Jdp

Settings
# exclusive inclusive rows x rows loops node
1. 1,557.821 8,997.851 ↓ 0.0 0 1

Merge Anti Join (cost=2,026,979.32..2,259,115.56 rows=7,526,931 width=9) (actual time=8,997.851..8,997.851 rows=0 loops=1)

  • Merge Cond: ((t.device_id = pd.device_id) AND (t.user_id = pd.user_id))
2. 2,312.082 3,088.319 ↑ 4.5 2,220,771 1

Sort (cost=1,656,847.65..1,681,937.42 rows=10,035,908 width=9) (actual time=2,424.432..3,088.319 rows=2,220,771 loops=1)

  • Sort Key: t.device_id, t.user_id
  • Sort Method: external merge Disk: 41248kB
3. 776.237 776.237 ↑ 4.5 2,220,771 1

Seq Scan on tmp_user_device t (cost=0.00..146,710.40 rows=10,035,908 width=9) (actual time=29.738..776.237 rows=2,220,771 loops=1)

  • Filter: (is_implicit IS NOT NULL)
4. 1,058.487 4,351.711 ↓ 1.0 2,571,103 1

Materialize (cost=370,131.67..382,538.80 rows=2,481,426 width=8) (actual time=2,223.186..4,351.711 rows=2,571,103 loops=1)

5. 2,613.434 3,293.224 ↓ 1.0 2,571,103 1

Sort (cost=370,131.67..376,335.24 rows=2,481,426 width=8) (actual time=2,223.183..3,293.224 rows=2,571,103 loops=1)

  • Sort Key: pd.device_id, pd.user_id
  • Sort Method: external merge Disk: 45224kB
6. 679.790 679.790 ↓ 1.0 2,571,103 1

Seq Scan on permissions_device pd (cost=0.00..38,712.26 rows=2,481,426 width=8) (actual time=0.011..679.790 rows=2,571,103 loops=1)