explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QRFn : test

Settings
# exclusive inclusive rows x rows loops node
1. 0.038 2,343.181 ↓ 200.0 200 1

Limit (cost=71,205.96..71,206.07 rows=1 width=32) (actual time=2,343.115..2,343.181 rows=200 loops=1)

2. 0.137 2,343.143 ↓ 3.5 700 1

GroupAggregate (cost=71,183.14..71,205.96 rows=201 width=32) (actual time=2,342.978..2,343.143 rows=700 loops=1)

  • Group Key: sv.name
  • Group Key: ()
3. 21.613 2,343.006 ↑ 5.9 707 1

Sort (cost=71,183.14..71,193.54 rows=4,162 width=32) (actual time=2,342.974..2,343.006 rows=707 loops=1)

  • Sort Key: sv.name
  • Sort Method: quicksort Memory: 478kB
4. 1.092 2,321.393 ↓ 1.5 6,099 1

Subquery Scan on sv (cost=10,015.15..70,932.94 rows=4,162 width=32) (actual time=11.555..2,321.393 rows=6,099 loops=1)

5. 0.631 2,320.301 ↓ 1.5 6,099 1

Append (cost=10,015.15..70,891.32 rows=4,162 width=1,223) (actual time=11.554..2,320.301 rows=6,099 loops=1)

6. 2.052 2,319.668 ↓ 1.5 6,099 1

Result (cost=10,015.15..70,890.29 rows=4,161 width=1,223) (actual time=11.554..2,319.668 rows=6,099 loops=1)

7. 0.551 2,317.616 ↓ 1.5 6,099 1

Append (cost=10,015.15..70,827.87 rows=4,161 width=1,215) (actual time=11.552..2,317.616 rows=6,099 loops=1)

8. 2.197 2,317.064 ↓ 1.5 6,099 1

Result (cost=10,015.15..70,827.87 rows=4,160 width=1,215) (actual time=11.552..2,317.064 rows=6,099 loops=1)

9. 0.611 2,314.867 ↓ 1.5 6,099 1

Append (cost=10,015.15..70,775.87 rows=4,160 width=1,211) (actual time=11.550..2,314.867 rows=6,099 loops=1)

10. 2.572 2,314.255 ↓ 1.5 6,099 1

Subquery Scan on *SELECT* 1 (cost=10,015.15..70,775.87 rows=4,159 width=968) (actual time=11.550..2,314.255 rows=6,099 loops=1)

11. 2,265.407 2,311.683 ↓ 1.5 6,099 1

Nested Loop (cost=10,015.15..70,723.88 rows=4,159 width=964) (actual time=11.548..2,311.683 rows=6,099 loops=1)

12. 5.181 16.106 ↓ 2.0 6,034 1

Bitmap Heap Scan on shopify_orders o (cost=10,014.72..20,288.63 rows=3,077 width=620) (actual time=11.032..16.106 rows=6,034 loops=1)

  • Recheck Cond: ((created_at >= '2019-01-01 18:30:00'::timestamp without time zone) AND (created_at <= '2019-02-01 06:18:05.33'::timestamp without time zone) AND (shop_id = 80))
  • Heap Blocks: exact=939
13. 0.205 10.925 ↓ 0.0 0 1

BitmapAnd (cost=10,014.72..10,014.72 rows=3,077 width=0) (actual time=10.925..10.925 rows=0 loops=1)

14. 1.852 1.852 ↑ 1.0 22,019 1

Bitmap Index Scan on ix_shopify_orders_created_at (cost=0.00..1,873.71 rows=22,529 width=0) (actual time=1.852..1.852 rows=22,019 loops=1)

  • Index Cond: ((created_at >= '2019-01-01 18:30:00'::timestamp without time zone) AND (created_at <= '2019-02-01 06:18:05.33'::timestamp without time zone))
15. 8.868 8.868 ↑ 1.0 128,265 1

Bitmap Index Scan on index_shopify_orders_on_shop_id (cost=0.00..8,139.22 rows=128,906 width=0) (actual time=8.868..8.868 rows=128,265 loops=1)

  • Index Cond: (shop_id = 80)
16. 30.170 30.170 ↑ 3.0 1 6,034

Index Scan using index_shopify_line_items_on_shopify_order_id on shopify_line_items l (cost=0.43..14.33 rows=3 width=220) (actual time=0.004..0.005 rows=1 loops=6,034)

  • Index Cond: (shopify_order_id = o.id)
17. 0.001 0.001 ↓ 0.0 0 1

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

18. 0.000 0.000 ↓ 0.0 0 1

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

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

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

20. 0.000 0.000 ↓ 0.0 0 1

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

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

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

22. 0.001 0.001 ↓ 0.0 0 1

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

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

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

  • One-Time Filter: false
Planning time : 1.417 ms
Execution time : 2,343.626 ms