explain.depesz.com

PostgreSQL's explain analyze made readable

Result: STPr

Settings
# exclusive inclusive rows x rows loops node
1. 168,582.275 168,582.609 ↑ 1.0 1 1

Aggregate (cost=65,571,738,708.61..65,571,738,708.62 rows=1 width=24) (actual time=168,582.609..168,582.609 rows=1 loops=1)

  • -> Hash Join (cost=106,225.05..40335049772.54 rows=3,364,891,858,142 width=24) (actual time=5,849.864..90622.370 rows=
  • Hash Cond: (users_1.id = quantity_1.uid)
  • -> Hash Join (cost=53,336.05..40608191.84 rows=3,368,256,743 width=20) (actual time=3,708.352..3795.221 rows=93
  • Hash Cond: (users_2.id = quantity_2.uid)
  • -> Nested Loop (cost=447.05..83245.35 rows=3,371,625 width=16) (actual time=2.773..1713.488 rows=975 l
  • -> Hash Join (cost=247.05..40802.90 rows=14,985 width=8) (actual time=1.327..1711.241 rows=975
  • Hash Cond: (quantity.uid = users.id)
  • -> Foreign Scan on quantity (cost=100.00..35506.00 rows=1,000,000 width=12) (actual time=0
  • -> Materialize (cost=200.00..297.70 rows=225 width=8) (actual time=0.002..0.002 rows=1 loops=9
  • -> Nested Loop (cost=200.00..296.58 rows=225 width=8) (actual time=1.443..1.445 rows=1 l
  • -> Hash (cost=35,506.00..35506.00 rows=1,000,000 width=12) (actual time=1,985.359..1985.359 rows=1,000,000
  • Buckets: 131,072 Batches: 16 Memory Usage: 3,737kB
  • -> Foreign Scan on quantity quantity_2 (cost=100.00..35506.00 rows=1,000,000 width=12) (actual t
  • -> Hash (cost=35,506.00..35506.00 rows=1,000,000 width=12) (actual time=1,898.008..1898.008 rows=1,000,000 loops
  • Buckets: 131,072 Batches: 16 Memory Usage: 3,727kB
  • -> Foreign Scan on quantity quantity_1 (cost=100.00..35506.00 rows=1,000,000 width=12) (actual time=0.
2. 0.334 0.334 ↑ 15.0 1 1

Hash (cost=146.86..146.86 rows=15 width=4) (actual time=0.334..0.334 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
  • -> Foreign Scan on users (cost=100.00..146.86 rows=15 width=4) (actual time=0.332.
  • -> Foreign Scan on users users_1 (cost=100.00..146.86 rows=15 width=4) (actual tim
  • -> Materialize (cost=100.00..146.94 rows=15 width=4) (actual time=1.125..1.126 row
  • -> Foreign Scan on users users_2 (cost=100.00..146.86 rows=15 width=4) (actu
Planning time : 0.678 ms
Execution time : 168,585.110 ms