explain.depesz.com

PostgreSQL's explain analyze made readable

Result: VvEk

Settings
# exclusive inclusive rows x rows loops node
1. 0.177 7,031.591 ↑ 1.0 1 1

Aggregate (cost=99,008.50..99,008.51 rows=1 width=32) (actual time=7,031.585..7,031.591 rows=1 loops=1)

2. 0.005 7,031.412 ↑ 1.0 1 1

Nested Loop Left Join (cost=99,007.44..99,008.48 rows=1 width=32) (actual time=7,031.404..7,031.412 rows=1 loops=1)

3. 0.050 0.050 ↑ 1.0 1 1

Seq Scan on vendor (cost=0.00..1.01 rows=1 width=4) (actual time=0.048..0.050 rows=1 loops=1)

  • Filter: (id = 1)
  • Rows Removed by Filter: 3
4. 0.044 7,031.357 ↑ 1.0 1 1

Aggregate (cost=99,007.44..99,007.45 rows=1 width=32) (actual time=7,031.352..7,031.357 rows=1 loops=1)

5. 0.002 7,031.313 ↑ 1.0 1 1

Limit (cost=99,007.42..99,007.43 rows=1 width=40) (actual time=7,031.308..7,031.313 rows=1 loops=1)

6. 27.094 7,031.311 ↑ 1,630.0 1 1

Sort (cost=99,007.42..99,011.50 rows=1,630 width=40) (actual time=7,031.307..7,031.311 rows=1 loops=1)

  • Sort Key: instance_cost.end_time DESC
  • Sort Method: top-N heapsort Memory: 83kB
7. 88.014 7,004.217 ↓ 11.8 19,215 1

Nested Loop Left Join (cost=60.51..98,999.27 rows=1,630 width=40) (actual time=0.565..7,004.217 rows=19,215 loops=1)

8. 4.663 18.018 ↓ 11.8 19,215 1

Unique (cost=0.28..739.12 rows=1,630 width=12) (actual time=0.030..18.018 rows=19,215 loops=1)

9. 2.201 13.355 ↓ 1.2 19,215 1

Custom Scan (ChunkAppend) on instance_cost (cost=0.28..698.35 rows=16,305 width=12) (actual time=0.028..13.355 rows=19,215 loops=1)

  • Order: instance_cost.end_time
  • Chunks excluded during runtime: 0
10. 3.000 3.000 ↑ 1.0 5,686 1

Index Scan Backward using _hyper_51_112_chunk_instance_cost_end_time_idx on _hyper_51_112_chunk (cost=0.28..237.36 rows=5,749 width=12) (actual time=0.010..3.000 rows=5,686 loops=1)

  • Index Cond: (end_time <= '2020-10-12 04:47:15'::timestamp without time zone)
  • Filter: (vendor.id = vendor_id)
11. 3.952 3.952 ↑ 1.0 7,552 1

Index Scan Backward using _hyper_51_113_chunk_instance_cost_end_time_idx on _hyper_51_113_chunk (cost=0.28..311.32 rows=7,552 width=12) (actual time=0.018..3.952 rows=7,552 loops=1)

  • Index Cond: (end_time <= '2020-10-12 04:47:15'::timestamp without time zone)
  • Filter: (vendor.id = vendor_id)
12. 4.202 4.202 ↓ 2.0 5,977 1

Index Only Scan Backward using _hyper_51_111_chunk_instance_cost_vendor_id_end_time_idx on _hyper_51_111_chunk (cost=0.28..149.67 rows=3,004 width=12) (actual time=0.050..4.202 rows=5,977 loops=1)

  • Index Cond: ((vendor_id = vendor.id) AND (end_time <= '2020-10-12 04:47:15'::timestamp without time zone))
  • Heap Fetches: 3,523
13. 3,324.195 6,878.970 ↑ 1.0 1 19,215

Aggregate (cost=60.23..60.24 rows=1 width=32) (actual time=0.358..0.358 rows=1 loops=19,215)

14. 130.995 3,554.775 ↓ 11.0 22 19,215

Nested Loop Left Join (cost=0.29..60.20 rows=2 width=252) (actual time=0.062..0.185 rows=22 loops=19,215)

15. 115.290 2,171.295 ↓ 11.0 22 19,215

Nested Loop (cost=0.15..59.37 rows=2 width=220) (actual time=0.058..0.113 rows=22 loops=19,215)

16. 57.645 57.645 ↓ 4.0 4 19,215

Seq Scan on node _2__be_0_node (cost=0.00..10.34 rows=1 width=4) (actual time=0.001..0.003 rows=4 loops=19,215)

  • Filter: (provider = ANY ('{amazon}'::text[]))
  • Rows Removed by Filter: 2
17. 1,228.596 1,998.360 ↑ 5.4 5 76,860

Custom Scan (ChunkAppend) on pod_cost (cost=0.15..48.76 rows=27 width=224) (actual time=0.021..0.026 rows=5 loops=76,860)

  • Chunks excluded during runtime: 4
18. 0.000 0.000 ↓ 0.0 0

Index Scan using _hyper_5_3_chunk_pod_cost_pod_id_end_time_idx on _hyper_5_3_chunk (cost=0.15..4.46 rows=1 width=224) (never executed)

  • Index Cond: (end_time = instance_cost.end_time)
  • Filter: ((instance_cost.vendor_id = vendor_id) AND (_2__be_0_node.id = node_id))
19. 0.000 0.000 ↓ 0.0 0

Index Scan using _hyper_5_16_chunk_pod_cost_pod_id_end_time_idx on _hyper_5_16_chunk (cost=0.15..4.46 rows=1 width=224) (never executed)

  • Index Cond: (end_time = instance_cost.end_time)
  • Filter: ((instance_cost.vendor_id = vendor_id) AND (_2__be_0_node.id = node_id))
20. 204.696 204.696 ↑ 2.2 5 22,744

Index Scan using _hyper_5_20_chunk_pod_cost_vendor_id_end_time_idx on _hyper_5_20_chunk (cost=0.42..13.28 rows=11 width=224) (actual time=0.005..0.009 rows=5 loops=22,744)

  • Index Cond: ((vendor_id = instance_cost.vendor_id) AND (end_time = instance_cost.end_time))
  • Filter: (_2__be_0_node.id = node_id)
  • Rows Removed by Filter: 16
21. 302.080 302.080 ↑ 2.2 5 30,208

Index Scan using _hyper_5_38_chunk_pod_cost_vendor_id_end_time_idx on _hyper_5_38_chunk (cost=0.42..16.01 rows=11 width=224) (actual time=0.006..0.010 rows=5 loops=30,208)

  • Index Cond: ((vendor_id = instance_cost.vendor_id) AND (end_time = instance_cost.end_time))
  • Filter: (_2__be_0_node.id = node_id)
  • Rows Removed by Filter: 16
22. 262.988 262.988 ↓ 1.7 5 23,908

Index Scan using _hyper_5_73_chunk_pod_cost_vendor_id_end_time_idx on _hyper_5_73_chunk (cost=0.42..10.55 rows=3 width=224) (actual time=0.007..0.011 rows=5 loops=23,908)

  • Index Cond: ((vendor_id = instance_cost.vendor_id) AND (end_time = instance_cost.end_time))
  • Filter: (_2__be_0_node.id = node_id)
  • Rows Removed by Filter: 16
23. 1,252.485 1,252.485 ↑ 1.0 1 417,495

Index Scan using pod_pkey on pod (cost=0.15..0.41 rows=1 width=36) (actual time=0.003..0.003 rows=1 loops=417,495)

  • Index Cond: (id = pod_cost.pod_id)
24.          

SubPlan (for Index Scan)

25. 0.000 0.000 ↑ 1.0 1 417,495

Result (cost=0.00..0.01 rows=1 width=32) (actual time=0.000..0.000 rows=1 loops=417,495)

26.          

SubPlan (for Aggregate)

27. 0.000 0.000 ↑ 1.0 1 417,495

Result (cost=0.00..0.01 rows=1 width=32) (actual time=0.000..0.000 rows=1 loops=417,495)

28.          

SubPlan (for Nested Loop Left Join)

29. 19.215 19.215 ↑ 1.0 1 19,215

Result (cost=0.00..0.01 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=19,215)

30.          

SubPlan (for Aggregate)

31. 0.002 0.002 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=32) (actual time=0.002..0.002 rows=1 loops=1)

Planning time : 8.262 ms
Execution time : 7,032.005 ms