explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6pfM

Settings
# exclusive inclusive rows x rows loops node
1. 148.821 1,896.114 ↓ 0.0 0 1

Insert on api_historicreport (cost=135.20..17,035.71 rows=10,000 width=16) (actual time=1,896.114..1,896.114 rows=0 loops=1)

2. 1.857 1,747.293 ↑ 1.0 10,000 1

Subquery Scan on *SELECT* (cost=135.20..17,035.71 rows=10,000 width=16) (actual time=58.743..1,747.293 rows=10,000 loops=1)

3. 0.929 1,745.436 ↑ 1.0 10,000 1

Limit (cost=135.20..16,910.71 rows=10,000 width=12) (actual time=58.741..1,745.436 rows=10,000 loops=1)

4. 30.665 1,744.507 ↑ 38,000.1 10,000 1

Merge Anti Join (cost=135.20..637,470,434.70 rows=380,000,636 width=12) (actual time=58.740..1,744.507 rows=10,000 loops=1)

  • Merge Cond: (api_report.id = api_historicreport_1.id)
5. 1,709.067 1,709.067 ↑ 21,235.8 20,038 1

Index Scan using api_report_pkey on api_report (cost=0.57..632,825,468.63 rows=425,522,212 width=12) (actual time=0.016..1,709.067 rows=20,038 loops=1)

  • Index Cond: (id > 336814279)
6. 4.775 4.775 ↑ 7,892.8 10,039 1

Index Only Scan using api_historicreport_pkey on api_historicreport api_historicreport_1 (cost=0.57..2,932,393.35 rows=79,236,214 width=8) (actual time=0.016..4.775 rows=10,039 loops=1)

  • Index Cond: (id > 336814279)
  • Heap Fetches: 10000
Planning time : 1.146 ms
Execution time : 1,896.512 ms