explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5yQd

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 741.982 ↓ 4.5 3,676 1

Finalize GroupAggregate (cost=20,887.87..20,994.07 rows=817 width=79) (actual time=716.098..741.982 rows=3,676 loops=1)

  • Group Key: (flows.path[3]), nodes.name, nodes.geo_id, node_properties.is_domestic_consumption, flows.year
2. 0.000 743.131 ↓ 15.2 10,323 1

Gather Merge (cost=20,887.87..20,975.70 rows=680 width=79) (actual time=716.085..743.131 rows=10,323 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 30.936 2,093.133 ↓ 10.1 3,441 3

Partial GroupAggregate (cost=19,887.84..19,897.19 rows=340 width=79) (actual time=683.682..697.711 rows=3,441 loops=3)

  • Group Key: (flows.path[3]), nodes.name, nodes.geo_id, node_properties.is_domestic_consumption, flows.year
4. 148.578 2,062.197 ↓ 51.1 17,368 3

Sort (cost=19,887.84..19,888.69 rows=340 width=79) (actual time=683.510..687.399 rows=17,368 loops=3)

  • Sort Key: (flows.path[3]), nodes.name, nodes.geo_id, node_properties.is_domestic_consumption, flows.year
  • Sort Method: quicksort Memory: 2184kB
5. 81.852 1,913.619 ↓ 51.1 17,368 3

Nested Loop (cost=1.01..19,873.55 rows=340 width=79) (actual time=1.199..637.873 rows=17,368 loops=3)

6. 31.849 737.583 ↓ 51.2 17,368 3

Nested Loop (cost=0.58..9,923.40 rows=339 width=128) (actual time=0.510..245.861 rows=17,368 loops=3)

7. 68.197 495.774 ↓ 39.7 17,497 3

Nested Loop (cost=0.29..9,743.10 rows=441 width=68) (actual time=0.439..165.258 rows=17,497 loops=3)

8. 217.617 217.617 ↓ 19.9 17,497 3

Parallel Seq Scan on partitioned_flows_1 flows (cost=0.00..7,865.45 rows=881 width=63) (actual time=0.346..72.539 rows=17,497 loops=3)

  • Filter: ((context_id = 1) AND (29138 = path[6]))
  • Rows Removed by Filter: 123487
9. 209.960 209.960 ↑ 1.0 1 52,490

Index Scan using index_node_properties_on_node_id on node_properties (cost=0.29..2.13 rows=1 width=5) (actual time=0.004..0.004 rows=1 loops=52,490)

  • Index Cond: (node_id = (flows.path)[3])
  • Filter: (NOT is_domestic_consumption)
10. 209.960 209.960 ↑ 1.0 1 52,490

Index Scan using nodes_pkey on nodes (cost=0.29..0.41 rows=1 width=68) (actual time=0.004..0.004 rows=1 loops=52,490)

  • Index Cond: (id = node_properties.node_id)
  • Filter: (NOT is_unknown)
  • Rows Removed by Filter: 0
11. 1,094.184 1,094.184 ↑ 1.0 1 52,104

Index Scan using index_partitioned_flow_quants_1_on_flow_id on partitioned_flow_quants_1 (cost=0.43..29.34 rows=1 width=12) (actual time=0.017..0.021 rows=1 loops=52,104)

  • Index Cond: (flow_id = flows.id)
  • Filter: (quant_id = 1)
  • Rows Removed by Filter: 7