explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bQBw

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Limit (cost=67,367.71..67,367.96 rows=100 width=650) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=67,367.71..67,472.92 rows=42,084 width=650) (actual rows= loops=)

  • Sort Key: (CASE WHEN (CASE WHEN (filemetadata.id IS NULL) THEN NULL::integer ELSE 1 END IS NOT NULL) THEN filemetadata."timestamp" ELSE NULL::timestamp with time zone END)
3. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=14,822.07..65,759.29 rows=42,084 width=650) (actual rows= loops=)

  • Join Filter: (CASE WHEN (CASE WHEN (filemetadata.id IS NULL) THEN NULL::integer ELSE 1 END IS NOT NULL) THEN filemetadata.id ELSE NULL::text END = x107.filemetadata_id)
4. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=3,442.20..16,396.76 rows=42,084 width=586) (actual rows= loops=)

  • Join Filter: (CASE WHEN (CASE WHEN (batchmetadata.id IS NULL) THEN NULL::integer ELSE 1 END IS NOT NULL) THEN batchmetadata.id ELSE NULL::text END = x110.batch_id)
5. 0.000 0.000 ↓ 0.0

Hash Full Join (cost=1,155.97..6,995.24 rows=42,084 width=449) (actual rows= loops=)

  • Hash Cond: (filemetadata.batch_id = batchmetadata.id)
6. 0.000 0.000 ↓ 0.0

Seq Scan on filemetadata (cost=0.00..1,988.84 rows=42,084 width=274) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Hash (cost=707.32..707.32 rows=12,132 width=175) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Seq Scan on batchmetadata (cost=0.00..707.32 rows=12,132 width=175) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Materialize (cost=2,286.23..8,770.25 rows=1 width=137) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=2,286.23..8,770.25 rows=1 width=137) (actual rows= loops=)

  • Hash Cond: (x110.batch_id = x111.batch_id)
  • Join Filter: (x110."timestamp" < x111."timestamp")
  • Filter: (x111.id IS NULL)
11. 0.000 0.000 ↓ 0.0

Seq Scan on batchstatus x110 (cost=0.00..1,194.88 rows=43,438 width=137) (actual rows= loops=)

  • Filter: external
12. 0.000 0.000 ↓ 0.0

Hash (cost=1,194.88..1,194.88 rows=48,988 width=49) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Seq Scan on batchstatus x111 (cost=0.00..1,194.88 rows=48,988 width=49) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Materialize (cost=11,379.87..48,731.28 rows=1 width=64) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=11,379.87..48,731.28 rows=1 width=64) (actual rows= loops=)

  • Hash Cond: (x107.filemetadata_id = x108.filemetadata_id)
  • Join Filter: (x107."timestamp" < x108."timestamp")
  • Filter: (x108.id IS NULL)
16. 0.000 0.000 ↓ 0.0

Seq Scan on filestatus x107 (cost=0.00..7,582.63 rows=170,499 width=64) (actual rows= loops=)

  • Filter: external
17. 0.000 0.000 ↓ 0.0

Hash (cost=7,582.63..7,582.63 rows=170,499 width=49) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Seq Scan on filestatus x108 (cost=0.00..7,582.63 rows=170,499 width=49) (actual rows= loops=)

  • Filter: external