explain.depesz.com

PostgreSQL's explain analyze made readable

Result: SfTL : test

Settings
# exclusive inclusive rows x rows loops node
1. 0.169 12,974.232 ↓ 500.0 500 1

Limit (cost=862,468.89..862,468.90 rows=1 width=36) (actual time=12,974.029..12,974.232 rows=500 loops=1)

2. 137.175 12,974.063 ↓ 500.0 500 1

Sort (cost=862,468.89..862,468.90 rows=1 width=36) (actual time=12,974.028..12,974.063 rows=500 loops=1)

  • Sort Key: tmp."Order Name", tmp.order_discr
  • Sort Method: top-N heapsort Memory: 65kB
3. 24.387 12,836.888 ↓ 105,389.0 105,389 1

Subquery Scan on tmp (cost=862,465.87..862,468.88 rows=1 width=36) (actual time=12,757.152..12,836.888 rows=105,389 loops=1)

4. 163.045 12,812.501 ↓ 105,389.0 105,389 1

HashAggregate (cost=862,465.87..862,468.87 rows=1 width=40) (actual time=12,757.151..12,812.501 rows=105,389 loops=1)

  • Group Key: "*SELECT* 1".name
  • Filter: (CASE WHEN (GROUPING("*SELECT* 1".name) = 0) THEN 1 ELSE 0 END = 1)
5. 13.511 12,649.456 ↑ 19.5 106,869 1

Append (cost=1,000.85..831,171.46 rows=2,086,294 width=1,223) (actual time=12.120..12,649.456 rows=106,869 loops=1)

6. 59.616 12,635.943 ↑ 19.5 106,869 1

Result (cost=1,000.85..820,739.97 rows=2,086,293 width=1,223) (actual time=12.119..12,635.943 rows=106,869 loops=1)

7. 12.362 12,576.327 ↑ 19.5 106,869 1

Append (cost=1,000.85..789,445.57 rows=2,086,293 width=1,215) (actual time=12.115..12,576.327 rows=106,869 loops=1)

8. 51.578 12,563.964 ↑ 19.5 106,869 1

Result (cost=1,000.85..779,014.10 rows=2,086,292 width=1,215) (actual time=12.115..12,563.964 rows=106,869 loops=1)

9. 14.766 12,512.386 ↑ 19.5 106,869 1

Append (cost=1,000.85..752,935.45 rows=2,086,292 width=1,211) (actual time=12.111..12,512.386 rows=106,869 loops=1)

10. 58.303 12,497.618 ↑ 19.5 106,869 1

Subquery Scan on *SELECT* 1 (cost=1,000.85..742,503.99 rows=2,086,291 width=1,006) (actual time=12.111..12,497.618 rows=106,869 loops=1)

11. 0.000 12,439.315 ↑ 19.5 106,869 1

Gather (cost=1,000.85..716,425.35 rows=2,086,291 width=1,002) (actual time=12.107..12,439.315 rows=106,869 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
12. 53.326 12,445.950 ↑ 24.4 35,623 3 / 3

Nested Loop (cost=0.85..506,796.25 rows=869,288 width=1,002) (actual time=13.541..12,445.950 rows=35,623 loops=3)

13. 5.726 6,455.710 ↑ 1.3 35,130 3 / 3

Parallel Append (cost=0.42..57,171.90 rows=45,045 width=674) (actual time=5.741..6,455.710 rows=35,130 loops=3)

14. 3,721.169 3,721.169 ↑ 1.8 15,000 3 / 3

Parallel Index Scan using shopify_orders_2019_06_09_on_shop_id on shopify_orders_2019_06_09 o_3 (cost=0.42..25,809.83 rows=27,545 width=779) (actual time=1.967..3,721.169 rows=15,000 loops=3)

  • Index Cond: (shop_id = 80)
  • Filter: ((created_at >= '2019-01-01 00:00:00'::timestamp without time zone) AND (created_at <= '2019-09-28 22:59:59'::timestamp without time zone))
15. 1,406.265 1,406.265 ↑ 1.2 14,824 2 / 3

Parallel Index Scan using shopify_orders_2019_03_06_on_shop_id on shopify_orders_2019_03_06 o_2 (cost=0.42..14,263.99 rows=17,684 width=588) (actual time=5.108..2,109.397 rows=14,824 loops=2)

  • Index Cond: (shop_id = 80)
  • Filter: ((created_at >= '2019-01-01 00:00:00'::timestamp without time zone) AND (created_at <= '2019-09-28 22:59:59'::timestamp without time zone))
16. 937.532 937.532 ↓ 1.6 17,946 1 / 3

Parallel Index Scan using shopify_orders_2019_09_12_on_shop_id on shopify_orders_2019_09_12 o_4 (cost=0.42..8,735.81 rows=10,962 width=610) (actual time=0.559..2,812.595 rows=17,946 loops=1)

  • Index Cond: (shop_id = 80)
  • Filter: ((created_at >= '2019-01-01 00:00:00'::timestamp without time zone) AND (created_at <= '2019-09-28 22:59:59'::timestamp without time zone))
17. 385.018 385.018 ↓ 1.7 12,795 1 / 3

Parallel Index Scan using shopify_orders_2019_01_03_on_shop_id on shopify_orders_2019_01_03 o_1 (cost=0.42..8,137.05 rows=7,401 width=584) (actual time=3.155..1,155.055 rows=12,795 loops=1)

  • Index Cond: (shop_id = 80)
  • Filter: ((created_at >= '2019-01-01 00:00:00'::timestamp without time zone) AND (created_at <= '2019-09-28 22:59:59'::timestamp without time zone))
18. 0.000 0.000 ↓ 0.0 0 1 / 3

Parallel Seq Scan on shopify_orders o (cost=0.00..0.00 rows=1 width=644) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: ((created_at >= '2019-01-01 00:00:00'::timestamp without time zone) AND (created_at <= '2019-09-28 22:59:59'::timestamp without time zone) AND (shop_id = 80))
19. 5,936.914 5,936.914 ↑ 19.0 1 105,389 / 3

Index Scan using index_shopify_line_items_on_shopify_order_id on shopify_line_items l (cost=0.43..9.74 rows=19 width=253) (actual time=0.163..0.169 rows=1 loops=105,389)

  • Index Cond: (shopify_order_id = o_3.id)
20. 0.001 0.002 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2 (cost=0.00..0.01 rows=1 width=1,136) (actual time=0.002..0.002 rows=0 loops=1)

21. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.00..0.00 rows=0 width=1,128) (actual time=0.001..0.001 rows=0 loops=1)

  • One-Time Filter: false
22. 0.000 0.001 ↓ 0.0 0 1

Subquery Scan on *SELECT* 3 (cost=0.00..0.01 rows=1 width=1,191) (actual time=0.001..0.001 rows=0 loops=1)

23. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.00..0.00 rows=0 width=1,183) (actual time=0.001..0.001 rows=0 loops=1)

  • One-Time Filter: false
24. 0.001 0.002 ↓ 0.0 0 1

Subquery Scan on *SELECT* 4 (cost=0.00..0.03 rows=1 width=1,199) (actual time=0.002..0.002 rows=0 loops=1)

25. 0.001 0.001 ↓ 0.0 0 1

HashAggregate (cost=0.00..0.01 rows=1 width=1,187) (actual time=0.001..0.001 rows=0 loops=1)

  • Group Key: id
26. 0.000 0.000 ↓ 0.0 0 1

Result (cost=0.00..0.00 rows=0 width=80) (actual time=0.000..0.000 rows=0 loops=1)

  • One-Time Filter: false
Planning time : 67.660 ms
Execution time : 12,977.065 ms