explain.depesz.com

PostgreSQL's explain analyze made readable

Result: WbcH

Settings
# exclusive inclusive rows x rows loops node
1. 2.512 47,927.729 ↑ 1.0 25 1

Limit (cost=2,558,892.30..2,580,335.67 rows=25 width=465) (actual time=47,797.699..47,927.729 rows=25 loops=1)

2. 2.273 47,925.217 ↑ 247.6 25 1

Result (cost=2,558,892.30..7,867,411.03 rows=6,189 width=465) (actual time=47,797.672..47,925.217 rows=25 loops=1)

3. 68.998 47,793.044 ↑ 247.6 25 1

Sort (cost=2,558,892.30..2,558,907.78 rows=6,189 width=417) (actual time=47,792.844..47,793.044 rows=25 loops=1)

  • Sort Key: (GREATEST('0'::bigint, (((0 - ((products_productconfiguration.stock - products_productconfiguration.quantity_on_sales_orders) - COALESCE((SubPlan 11), '0'::bigint))) + COALESCE((SubPlan 12), '0'::bigint)) - COALESCE((SubPlan 13), '0'::bigint)))) DESC, (LEAST(GREATEST('0'::bigint, (0 - ((products_productconfiguration.stock - products_productconfiguration.quantity_on_sales_orders) - COALESCE((SubPlan 14), '0'::bigint)))), ((COALESCE((SubPlan 15), '0'::bigint) - COALESCE((SubPlan 16), '0'::bigint)) - COALESCE((SubPlan 17), '0'::bigint)))) DESC, (((COALESCE((SubPlan 8), '0'::bigint) - COALESCE((SubPlan 9), '0'::bigint)) - COALESCE((SubPlan 10), '0'::bigint))) DESC
  • Sort Method: top-N heapsort Memory: 47kB
4. 746.069 47,724.046 ↑ 1.0 6,189 1

Hash Join (cost=141.12..2,558,717.65 rows=6,189 width=417) (actual time=43.910..47,724.046 rows=6,189 loops=1)

  • Hash Cond: (products_productconfiguration.product_id = products_product.id)
5. 52.152 52.152 ↑ 1.0 6,189 1

Seq Scan on products_productconfiguration (cost=0.00..182.89 rows=6,189 width=101) (actual time=0.013..52.152 rows=6,189 loops=1)

6. 19.244 37.961 ↑ 1.0 2,183 1

Hash (cost=113.83..113.83 rows=2,183 width=288) (actual time=37.947..37.961 rows=2,183 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 739kB
7. 18.717 18.717 ↑ 1.0 2,183 1

Seq Scan on products_product (cost=0.00..113.83 rows=2,183 width=288) (actual time=0.011..18.717 rows=2,183 loops=1)

8.          

SubPlan (for Hash Join)

9. 160.914 1,126.398 ↓ 0.0 0 6,189

Limit (cost=15.47..15.48 rows=1 width=18) (actual time=0.172..0.182 rows=0 loops=6,189)

10. 136.158 965.484 ↓ 0.0 0 6,189

Sort (cost=15.47..15.48 rows=1 width=18) (actual time=0.155..0.156 rows=0 loops=6,189)

  • Sort Key: u0_7.sort, u0_7.id
  • Sort Method: quicksort Memory: 25kB
11. 111.402 829.326 ↓ 0.0 0 6,189

WindowAgg (cost=4.30..15.46 rows=1 width=18) (actual time=0.133..0.134 rows=0 loops=6,189)

12. 321.789 717.924 ↓ 0.0 0 6,189

Nested Loop (cost=4.30..15.45 rows=1 width=14) (actual time=0.094..0.116 rows=0 loops=6,189)

  • Join Filter: (u0_7.purchase_order_id = u2_5.id)
  • Rows Removed by Join Filter: 3
13. 136.158 216.615 ↑ 3.0 1 6,189

Bitmap Heap Scan on purchase_orders_purchaseorderline u0_7 (cost=4.30..13.78 rows=3 width=18) (actual time=0.029..0.035 rows=1 loops=6,189)

  • Recheck Cond: (product_configuration_id = products_productconfiguration.id)
  • Heap Blocks: exact=3200
14. 80.457 80.457 ↑ 3.0 1 6,189

Bitmap Index Scan on purchase_orders_purchaseor_product_configuration_id_49e3c618 (cost=0.00..4.30 rows=3 width=0) (actual time=0.012..0.013 rows=1 loops=6,189)

  • Index Cond: (product_configuration_id = products_productconfiguration.id)
15. 175.524 179.520 ↓ 3.0 6 3,264

Materialize (cost=0.00..1.59 rows=2 width=4) (actual time=0.008..0.055 rows=6 loops=3,264)

16. 3.996 3.996 ↓ 3.0 6 1

Seq Scan on purchase_orders_purchaseorder u2_5 (cost=0.00..1.58 rows=2 width=4) (actual time=0.021..3.996 rows=6 loops=1)

  • Filter: ((status)::text = ANY ('{CONFIRMED,ACCEPTED}'::text[]))
  • Rows Removed by Filter: 40
17. 111.402 798.381 ↓ 0.0 0 6,189

Limit (cost=15.36..15.37 rows=1 width=20) (actual time=0.128..0.129 rows=0 loops=6,189)

18. 117.591 686.979 ↓ 0.0 0 6,189

Sort (cost=15.36..15.37 rows=1 width=20) (actual time=0.111..0.111 rows=0 loops=6,189)

  • Sort Key: u0_8.box, u0_8.sort, u0_8.id
  • Sort Method: quicksort Memory: 25kB
19. 99.024 569.388 ↓ 0.0 0 6,189

WindowAgg (cost=4.30..15.35 rows=1 width=20) (actual time=0.092..0.092 rows=0 loops=6,189)

20. 200.370 470.364 ↓ 0.0 0 6,189

Nested Loop (cost=4.30..15.34 rows=1 width=16) (actual time=0.075..0.076 rows=0 loops=6,189)

  • Join Filter: (u0_8.shipment_id = u2_6.id)
  • Rows Removed by Join Filter: 1
21. 136.158 210.426 ↑ 3.0 1 6,189

Bitmap Heap Scan on shipments_shipmentline u0_8 (cost=4.30..13.84 rows=3 width=20) (actual time=0.029..0.034 rows=1 loops=6,189)

  • Recheck Cond: (product_configuration_id = products_productconfiguration.id)
  • Heap Blocks: exact=3409
22. 74.268 74.268 ↑ 3.0 1 6,189

Bitmap Index Scan on shipments_shipmentline_product_configuration_id_cc58e44d (cost=0.00..4.30 rows=3 width=0) (actual time=0.012..0.012 rows=1 loops=6,189)

  • Index Cond: (product_configuration_id = products_productconfiguration.id)
23. 59.129 59.568 ↑ 2.0 1 3,723

Materialize (cost=0.00..1.41 rows=2 width=4) (actual time=0.008..0.016 rows=1 loops=3,723)

24. 0.439 0.439 ↑ 2.0 1 1

Seq Scan on shipments_shipment u2_6 (cost=0.00..1.40 rows=2 width=4) (actual time=0.018..0.439 rows=1 loops=1)

  • Filter: ((status)::text = ANY ('{SENT,RECEIVED}'::text[]))
  • Rows Removed by Filter: 31
25. 173.292 13,009.278 ↓ 0.0 0 6,189

Limit (cost=23.79..23.79 rows=1 width=20) (actual time=2.090..2.102 rows=0 loops=6,189)

26. 129.969 12,835.986 ↓ 0.0 0 6,189

Sort (cost=23.79..23.79 rows=1 width=20) (actual time=2.073..2.074 rows=0 loops=6,189)

  • Sort Key: u0_9.box, u0_9.sort, u0_9.id
  • Sort Method: quicksort Memory: 25kB
27. 123.780 12,706.017 ↓ 0.0 0 6,189

WindowAgg (cost=4.72..23.78 rows=1 width=20) (actual time=2.051..2.053 rows=0 loops=6,189)

28. 167.919 12,582.237 ↓ 0.0 0 6,189

Nested Loop (cost=4.72..23.76 rows=1 width=16) (actual time=1.838..2.033 rows=0 loops=6,189)

29. 222.763 12,359.433 ↑ 1.0 1 6,189

Nested Loop (cost=4.58..23.59 rows=1 width=20) (actual time=1.452..1.997 rows=1 loops=6,189)

30. 4,418.946 12,056.172 ↑ 1.0 1 6,189

Nested Loop (cost=4.30..15.28 rows=1 width=20) (actual time=1.430..1.948 rows=1 loops=6,189)

  • Join Filter: (u0_9.shipment_id = u4_1.id)
  • Rows Removed by Join Filter: 18
31. 1,689.597 1,689.597 ↓ 31.0 31 6,189

Seq Scan on shipments_shipment u4_1 (cost=0.00..1.40 rows=1 width=4) (actual time=0.011..0.273 rows=31 loops=6,189)

  • Filter: ((status)::text = 'PROCESSED'::text)
  • Rows Removed by Filter: 1
32. 4,029.039 5,947.629 ↑ 3.0 1 191,859

Bitmap Heap Scan on shipments_shipmentline u0_9 (cost=4.30..13.84 rows=3 width=24) (actual time=0.026..0.031 rows=1 loops=191,859)

  • Recheck Cond: (product_configuration_id = products_productconfiguration.id)
  • Heap Blocks: exact=105679
33. 1,918.590 1,918.590 ↑ 3.0 1 191,859

Bitmap Index Scan on shipments_shipmentline_product_configuration_id_cc58e44d (cost=0.00..4.30 rows=3 width=0) (actual time=0.010..0.010 rows=1 loops=191,859)

  • Index Cond: (product_configuration_id = products_productconfiguration.id)
34. 80.498 80.498 ↑ 1.0 1 3,659

Index Scan using purchase_orders_purchaseorderline_pkey on purchase_orders_purchaseorderline u2_7 (cost=0.28..8.30 rows=1 width=8) (actual time=0.013..0.022 rows=1 loops=3,659)

  • Index Cond: (id = u0_9.purchase_order_line_id)
35. 54.885 54.885 ↓ 0.0 0 3,659

Index Scan using purchase_orders_purchaseorder_pkey on purchase_orders_purchaseorder u3_1 (cost=0.14..0.16 rows=1 width=4) (actual time=0.012..0.015 rows=0 loops=3,659)

  • Index Cond: (id = u2_7.purchase_order_id)
  • Filter: ((status)::text = 'ACCEPTED'::text)
  • Rows Removed by Filter: 1
36. 117.591 1,559.628 ↓ 0.0 0 6,189

Limit (cost=132.38..132.39 rows=1 width=18) (actual time=0.250..0.252 rows=0 loops=6,189)

37. 129.969 1,442.037 ↓ 0.0 0 6,189

Sort (cost=132.38..132.39 rows=1 width=18) (actual time=0.233..0.233 rows=0 loops=6,189)

  • Sort Key: u0_10.sort, u0_10.id
  • Sort Method: quicksort Memory: 25kB
38. 99.024 1,312.068 ↓ 0.0 0 6,189

WindowAgg (cost=28.31..132.37 rows=1 width=18) (actual time=0.212..0.212 rows=0 loops=6,189)

39. 531.058 1,213.044 ↓ 0.0 0 6,189

Hash Join (cost=28.31..132.36 rows=1 width=14) (actual time=0.184..0.196 rows=0 loops=6,189)

  • Hash Cond: (u0_10.order_id = u2_8.id)
40. 594.144 680.790 ↑ 3.9 8 6,189

Bitmap Heap Scan on orders_orderline u0_10 (cost=4.53..108.45 rows=31 width=18) (actual time=0.031..0.110 rows=8 loops=6,189)

  • Recheck Cond: (product_configuration_id = products_productconfiguration.id)
  • Heap Blocks: exact=41811
41. 86.646 86.646 ↑ 3.9 8 6,189

Bitmap Index Scan on orders_orderline_product_configuration_id_a423a83d (cost=0.00..4.52 rows=31 width=0) (actual time=0.014..0.014 rows=8 loops=6,189)

  • Index Cond: (product_configuration_id = products_productconfiguration.id)
42. 0.000 1.196 ↑ 1.0 23 1

Hash (cost=23.50..23.50 rows=23 width=4) (actual time=0.471..1.196 rows=23 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
43. 1.198 1.198 ↑ 1.0 23 1

Index Scan using orders_orde_status_c6dd84_idx on orders_order u2_8 (cost=0.28..23.50 rows=23 width=4) (actual time=0.024..1.198 rows=23 loops=1)

  • Index Cond: ((status)::text = ANY ('{PRE_ORDER,DRAFT,CONFIRMED}'::text[]))
44. 173.292 12,928.821 ↓ 0.0 0 6,189

Limit (cost=23.79..23.79 rows=1 width=20) (actual time=2.077..2.089 rows=0 loops=6,189)

45. 129.969 12,755.529 ↓ 0.0 0 6,189

Sort (cost=23.79..23.79 rows=1 width=20) (actual time=2.060..2.061 rows=0 loops=6,189)

  • Sort Key: u0_11.box, u0_11.sort, u0_11.id
  • Sort Method: quicksort Memory: 25kB
46. 117.591 12,625.560 ↓ 0.0 0 6,189

WindowAgg (cost=4.72..23.78 rows=1 width=20) (actual time=2.038..2.040 rows=0 loops=6,189)

47. 167.919 12,507.969 ↓ 0.0 0 6,189

Nested Loop (cost=4.72..23.76 rows=1 width=16) (actual time=1.826..2.021 rows=0 loops=6,189)

48. 220.233 12,285.165 ↑ 1.0 1 6,189

Nested Loop (cost=4.58..23.59 rows=1 width=20) (actual time=1.441..1.985 rows=1 loops=6,189)

49. 4,350.867 11,988.093 ↑ 1.0 1 6,189

Nested Loop (cost=4.30..15.28 rows=1 width=20) (actual time=1.420..1.937 rows=1 loops=6,189)

  • Join Filter: (u0_11.shipment_id = u4_2.id)
  • Rows Removed by Join Filter: 18
50. 1,689.597 1,689.597 ↓ 31.0 31 6,189

Seq Scan on shipments_shipment u4_2 (cost=0.00..1.40 rows=1 width=4) (actual time=0.011..0.273 rows=31 loops=6,189)

  • Filter: ((status)::text = 'PROCESSED'::text)
  • Rows Removed by Filter: 1
51. 4,029.039 5,947.629 ↑ 3.0 1 191,859

Bitmap Heap Scan on shipments_shipmentline u0_11 (cost=4.30..13.84 rows=3 width=24) (actual time=0.026..0.031 rows=1 loops=191,859)

  • Recheck Cond: (product_configuration_id = products_productconfiguration.id)
  • Heap Blocks: exact=105679
52. 1,918.590 1,918.590 ↑ 3.0 1 191,859

Bitmap Index Scan on shipments_shipmentline_product_configuration_id_cc58e44d (cost=0.00..4.30 rows=3 width=0) (actual time=0.010..0.010 rows=1 loops=191,859)

  • Index Cond: (product_configuration_id = products_productconfiguration.id)
53. 76.839 76.839 ↑ 1.0 1 3,659

Index Scan using purchase_orders_purchaseorderline_pkey on purchase_orders_purchaseorderline u2_9 (cost=0.28..8.30 rows=1 width=8) (actual time=0.012..0.021 rows=1 loops=3,659)

  • Index Cond: (id = u0_11.purchase_order_line_id)
54. 54.885 54.885 ↓ 0.0 0 3,659

Index Scan using purchase_orders_purchaseorder_pkey on purchase_orders_purchaseorder u3_2 (cost=0.14..0.16 rows=1 width=4) (actual time=0.012..0.015 rows=0 loops=3,659)

  • Index Cond: (id = u2_9.purchase_order_id)
  • Filter: ((status)::text = 'ACCEPTED'::text)
  • Rows Removed by Filter: 1
55. 167.103 1,126.398 ↓ 0.0 0 6,189

Limit (cost=15.47..15.48 rows=1 width=18) (actual time=0.171..0.182 rows=0 loops=6,189)

56. 129.969 959.295 ↓ 0.0 0 6,189

Sort (cost=15.47..15.48 rows=1 width=18) (actual time=0.154..0.155 rows=0 loops=6,189)

  • Sort Key: u0_12.sort, u0_12.id
  • Sort Method: quicksort Memory: 25kB
57. 117.591 829.326 ↓ 0.0 0 6,189

WindowAgg (cost=4.30..15.46 rows=1 width=18) (actual time=0.132..0.134 rows=0 loops=6,189)

58. 321.789 711.735 ↓ 0.0 0 6,189

Nested Loop (cost=4.30..15.45 rows=1 width=14) (actual time=0.093..0.115 rows=0 loops=6,189)

  • Join Filter: (u0_12.purchase_order_id = u2_10.id)
  • Rows Removed by Join Filter: 3
59. 129.969 210.426 ↑ 3.0 1 6,189

Bitmap Heap Scan on purchase_orders_purchaseorderline u0_12 (cost=4.30..13.78 rows=3 width=18) (actual time=0.029..0.034 rows=1 loops=6,189)

  • Recheck Cond: (product_configuration_id = products_productconfiguration.id)
  • Heap Blocks: exact=3200
60. 80.457 80.457 ↑ 3.0 1 6,189

Bitmap Index Scan on purchase_orders_purchaseor_product_configuration_id_49e3c618 (cost=0.00..4.30 rows=3 width=0) (actual time=0.012..0.013 rows=1 loops=6,189)

  • Index Cond: (product_configuration_id = products_productconfiguration.id)
61. 175.286 179.520 ↓ 3.0 6 3,264

Materialize (cost=0.00..1.59 rows=2 width=4) (actual time=0.008..0.055 rows=6 loops=3,264)

62. 4.234 4.234 ↓ 3.0 6 1

Seq Scan on purchase_orders_purchaseorder u2_10 (cost=0.00..1.58 rows=2 width=4) (actual time=0.015..4.234 rows=6 loops=1)

  • Filter: ((status)::text = ANY ('{CONFIRMED,ACCEPTED}'::text[]))
  • Rows Removed by Filter: 40
63. 117.591 1,528.683 ↓ 0.0 0 6,189

Limit (cost=132.38..132.39 rows=1 width=18) (actual time=0.245..0.247 rows=0 loops=6,189)

64. 117.591 1,411.092 ↓ 0.0 0 6,189

Sort (cost=132.38..132.39 rows=1 width=18) (actual time=0.228..0.228 rows=0 loops=6,189)

  • Sort Key: u0_13.sort, u0_13.id
  • Sort Method: quicksort Memory: 25kB
65. 99.024 1,293.501 ↓ 0.0 0 6,189

WindowAgg (cost=28.31..132.37 rows=1 width=18) (actual time=0.209..0.209 rows=0 loops=6,189)

66. 530.861 1,194.477 ↓ 0.0 0 6,189

Hash Join (cost=28.31..132.36 rows=1 width=14) (actual time=0.182..0.193 rows=0 loops=6,189)

  • Hash Cond: (u0_13.order_id = u2_11.id)
67. 581.766 662.223 ↑ 3.9 8 6,189

Bitmap Heap Scan on orders_orderline u0_13 (cost=4.53..108.45 rows=31 width=18) (actual time=0.030..0.107 rows=8 loops=6,189)

  • Recheck Cond: (product_configuration_id = products_productconfiguration.id)
  • Heap Blocks: exact=41811
68. 80.457 80.457 ↑ 3.9 8 6,189

Bitmap Index Scan on orders_orderline_product_configuration_id_a423a83d (cost=0.00..4.52 rows=31 width=0) (actual time=0.013..0.013 rows=8 loops=6,189)

  • Index Cond: (product_configuration_id = products_productconfiguration.id)
69. 0.395 1.393 ↑ 1.0 23 1

Hash (cost=23.50..23.50 rows=23 width=4) (actual time=0.398..1.393 rows=23 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
70. 0.998 0.998 ↑ 1.0 23 1

Index Scan using orders_orde_status_c6dd84_idx on orders_order u2_11 (cost=0.28..23.50 rows=23 width=4) (actual time=0.016..0.998 rows=23 loops=1)

  • Index Cond: ((status)::text = ANY ('{PRE_ORDER,DRAFT,CONFIRMED}'::text[]))
71. 154.725 1,064.508 ↓ 0.0 0 6,189

Limit (cost=15.47..15.48 rows=1 width=18) (actual time=0.163..0.172 rows=0 loops=6,189)

72. 123.780 909.783 ↓ 0.0 0 6,189

Sort (cost=15.47..15.48 rows=1 width=18) (actual time=0.146..0.147 rows=0 loops=6,189)

  • Sort Key: u0_14.sort, u0_14.id
  • Sort Method: quicksort Memory: 25kB
73. 117.591 786.003 ↓ 0.0 0 6,189

WindowAgg (cost=4.30..15.46 rows=1 width=18) (actual time=0.125..0.127 rows=0 loops=6,189)

74. 281.391 668.412 ↓ 0.0 0 6,189

Nested Loop (cost=4.30..15.45 rows=1 width=14) (actual time=0.086..0.108 rows=0 loops=6,189)

  • Join Filter: (u0_14.purchase_order_id = u2_12.id)
  • Rows Removed by Join Filter: 3
75. 136.158 204.237 ↑ 3.0 1 6,189

Bitmap Heap Scan on purchase_orders_purchaseorderline u0_14 (cost=4.30..13.78 rows=3 width=18) (actual time=0.027..0.033 rows=1 loops=6,189)

  • Recheck Cond: (product_configuration_id = products_productconfiguration.id)
  • Heap Blocks: exact=3200
76. 68.079 68.079 ↑ 3.0 1 6,189

Bitmap Index Scan on purchase_orders_purchaseor_product_configuration_id_49e3c618 (cost=0.00..4.30 rows=3 width=0) (actual time=0.011..0.011 rows=1 loops=6,189)

  • Index Cond: (product_configuration_id = products_productconfiguration.id)
77. 178.488 182.784 ↓ 3.0 6 3,264

Materialize (cost=0.00..1.59 rows=2 width=4) (actual time=0.008..0.056 rows=6 loops=3,264)

78. 4.296 4.296 ↓ 3.0 6 1

Seq Scan on purchase_orders_purchaseorder u2_12 (cost=0.00..1.58 rows=2 width=4) (actual time=0.012..4.296 rows=6 loops=1)

  • Filter: ((status)::text = ANY ('{CONFIRMED,ACCEPTED}'::text[]))
  • Rows Removed by Filter: 40
79. 111.402 786.003 ↓ 0.0 0 6,189

Limit (cost=15.36..15.37 rows=1 width=20) (actual time=0.126..0.127 rows=0 loops=6,189)

80. 111.402 674.601 ↓ 0.0 0 6,189

Sort (cost=15.36..15.37 rows=1 width=20) (actual time=0.109..0.109 rows=0 loops=6,189)

  • Sort Key: u0_15.box, u0_15.sort, u0_15.id
  • Sort Method: quicksort Memory: 25kB
81. 105.213 563.199 ↓ 0.0 0 6,189

WindowAgg (cost=4.30..15.35 rows=1 width=20) (actual time=0.090..0.091 rows=0 loops=6,189)

82. 197.904 457.986 ↓ 0.0 0 6,189

Nested Loop (cost=4.30..15.34 rows=1 width=16) (actual time=0.074..0.074 rows=0 loops=6,189)

  • Join Filter: (u0_15.shipment_id = u2_13.id)
  • Rows Removed by Join Filter: 1
83. 136.158 204.237 ↑ 3.0 1 6,189

Bitmap Heap Scan on shipments_shipmentline u0_15 (cost=4.30..13.84 rows=3 width=20) (actual time=0.028..0.033 rows=1 loops=6,189)

  • Recheck Cond: (product_configuration_id = products_productconfiguration.id)
  • Heap Blocks: exact=3409
84. 68.079 68.079 ↑ 3.0 1 6,189

Bitmap Index Scan on shipments_shipmentline_product_configuration_id_cc58e44d (cost=0.00..4.30 rows=3 width=0) (actual time=0.011..0.011 rows=1 loops=6,189)

  • Index Cond: (product_configuration_id = products_productconfiguration.id)
85. 55.310 55.845 ↑ 2.0 1 3,723

Materialize (cost=0.00..1.41 rows=2 width=4) (actual time=0.008..0.015 rows=1 loops=3,723)

86. 0.535 0.535 ↑ 2.0 1 1

Seq Scan on shipments_shipment u2_13 (cost=0.00..1.40 rows=2 width=4) (actual time=0.016..0.535 rows=1 loops=1)

  • Filter: ((status)::text = ANY ('{SENT,RECEIVED}'::text[]))
  • Rows Removed by Filter: 31
87. 173.292 12,959.766 ↓ 0.0 0 6,189

Limit (cost=23.79..23.79 rows=1 width=20) (actual time=2.082..2.094 rows=0 loops=6,189)

88. 123.780 12,786.474 ↓ 0.0 0 6,189

Sort (cost=23.79..23.79 rows=1 width=20) (actual time=2.066..2.066 rows=0 loops=6,189)

  • Sort Key: u0_16.box, u0_16.sort, u0_16.id
  • Sort Method: quicksort Memory: 25kB
89. 123.780 12,662.694 ↓ 0.0 0 6,189

WindowAgg (cost=4.72..23.78 rows=1 width=20) (actual time=2.044..2.046 rows=0 loops=6,189)

90. 165.389 12,538.914 ↓ 0.0 0 6,189

Nested Loop (cost=4.72..23.76 rows=1 width=16) (actual time=1.831..2.026 rows=0 loops=6,189)

91. 220.233 12,322.299 ↑ 1.0 1 6,189

Nested Loop (cost=4.58..23.59 rows=1 width=20) (actual time=1.448..1.991 rows=1 loops=6,189)

92. 4,388.001 12,025.227 ↑ 1.0 1 6,189

Nested Loop (cost=4.30..15.28 rows=1 width=20) (actual time=1.426..1.943 rows=1 loops=6,189)

  • Join Filter: (u0_16.shipment_id = u4_3.id)
  • Rows Removed by Join Filter: 18
93. 1,689.597 1,689.597 ↓ 31.0 31 6,189

Seq Scan on shipments_shipment u4_3 (cost=0.00..1.40 rows=1 width=4) (actual time=0.011..0.273 rows=31 loops=6,189)

  • Filter: ((status)::text = 'PROCESSED'::text)
  • Rows Removed by Filter: 1
94. 4,029.039 5,947.629 ↑ 3.0 1 191,859

Bitmap Heap Scan on shipments_shipmentline u0_16 (cost=4.30..13.84 rows=3 width=24) (actual time=0.026..0.031 rows=1 loops=191,859)

  • Recheck Cond: (product_configuration_id = products_productconfiguration.id)
  • Heap Blocks: exact=105679
95. 1,918.590 1,918.590 ↑ 3.0 1 191,859

Bitmap Index Scan on shipments_shipmentline_product_configuration_id_cc58e44d (cost=0.00..4.30 rows=3 width=0) (actual time=0.010..0.010 rows=1 loops=191,859)

  • Index Cond: (product_configuration_id = products_productconfiguration.id)
96. 76.839 76.839 ↑ 1.0 1 3,659

Index Scan using purchase_orders_purchaseorderline_pkey on purchase_orders_purchaseorderline u2_14 (cost=0.28..8.30 rows=1 width=8) (actual time=0.012..0.021 rows=1 loops=3,659)

  • Index Cond: (id = u0_16.purchase_order_line_id)
97. 51.226 51.226 ↓ 0.0 0 3,659

Index Scan using purchase_orders_purchaseorder_pkey on purchase_orders_purchaseorder u3_3 (cost=0.14..0.16 rows=1 width=4) (actual time=0.011..0.014 rows=0 loops=3,659)

  • Index Cond: (id = u2_14.purchase_order_id)
  • Filter: ((status)::text = 'ACCEPTED'::text)
  • Rows Removed by Filter: 1
98.          

SubPlan (for Result)

99. 1.450 12.750 ↑ 1.0 1 25

Limit (cost=108.60..108.61 rows=1 width=8) (actual time=0.461..0.510 rows=1 loops=25)

100. 5.000 11.300 ↑ 31.0 1 25

Sort (cost=108.60..108.68 rows=31 width=8) (actual time=0.445..0.452 rows=1 loops=25)

  • Sort Key: u0.created_at DESC
  • Sort Method: top-N heapsort Memory: 25kB
101. 5.650 6.300 ↑ 1.4 22 25

Bitmap Heap Scan on orders_orderline u0 (cost=4.53..108.45 rows=31 width=8) (actual time=0.038..0.252 rows=22 loops=25)

  • Recheck Cond: (product_configuration_id = products_productconfiguration.id)
  • Heap Blocks: exact=451
102. 0.650 0.650 ↑ 1.4 22 25

Bitmap Index Scan on orders_orderline_product_configuration_id_a423a83d (cost=0.00..4.52 rows=31 width=0) (actual time=0.019..0.026 rows=22 loops=25)

  • Index Cond: (product_configuration_id = products_productconfiguration.id)
103. 0.775 2.350 ↓ 0.0 0 25

Limit (cost=16.32..16.33 rows=1 width=8) (actual time=0.083..0.094 rows=0 loops=25)

104. 0.700 1.575 ↓ 0.0 0 25

Sort (cost=16.32..16.33 rows=4 width=8) (actual time=0.062..0.063 rows=0 loops=25)

  • Sort Key: u0_1.created_at DESC
  • Sort Method: quicksort Memory: 25kB
105. 0.550 0.875 ↓ 0.0 0 25

Bitmap Heap Scan on shopify_shopifyorderline u0_1 (cost=4.31..16.30 rows=4 width=8) (actual time=0.030..0.035 rows=0 loops=25)

  • Recheck Cond: (product_configuration_id = products_productconfiguration.id)
  • Heap Blocks: exact=8
106. 0.325 0.325 ↓ 0.0 0 25

Bitmap Index Scan on shopify_shopifyorderline_product_configuration_id_b991504c (cost=0.00..4.31 rows=4 width=0) (actual time=0.011..0.013 rows=0 loops=25)

  • Index Cond: (product_configuration_id = products_productconfiguration.id)
107. 0.950 13.925 ↓ 0.0 0 25

Limit (cost=132.38..132.39 rows=1 width=18) (actual time=0.539..0.557 rows=0 loops=25)

108. 0.500 12.975 ↓ 0.0 0 25

Sort (cost=132.38..132.39 rows=1 width=18) (actual time=0.518..0.519 rows=0 loops=25)

  • Sort Key: u0_2.sort, u0_2.id
  • Sort Method: quicksort Memory: 25kB
109. 0.475 12.475 ↓ 0.0 0 25

WindowAgg (cost=28.31..132.37 rows=1 width=18) (actual time=0.496..0.499 rows=0 loops=25)

110. 5.363 12.000 ↓ 0.0 0 25

Hash Join (cost=28.31..132.36 rows=1 width=14) (actual time=0.427..0.480 rows=0 loops=25)

  • Hash Cond: (u0_2.order_id = u2.id)
111. 5.825 6.200 ↑ 1.4 22 25

Bitmap Heap Scan on orders_orderline u0_2 (cost=4.53..108.45 rows=31 width=18) (actual time=0.036..0.248 rows=22 loops=25)

  • Recheck Cond: (product_configuration_id = products_productconfiguration.id)
  • Heap Blocks: exact=451
112. 0.375 0.375 ↑ 1.4 22 25

Bitmap Index Scan on orders_orderline_product_configuration_id_a423a83d (cost=0.00..4.52 rows=31 width=0) (actual time=0.014..0.015 rows=22 loops=25)

  • Index Cond: (product_configuration_id = products_productconfiguration.id)
113. 0.188 0.437 ↑ 1.0 23 1

Hash (cost=23.50..23.50 rows=23 width=4) (actual time=0.393..0.437 rows=23 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
114. 0.249 0.249 ↑ 1.0 23 1

Index Scan using orders_orde_status_c6dd84_idx on orders_order u2 (cost=0.28..23.50 rows=23 width=4) (actual time=0.019..0.249 rows=23 loops=1)

  • Index Cond: ((status)::text = ANY ('{PRE_ORDER,DRAFT,CONFIRMED}'::text[]))
115. 0.950 15.925 ↓ 0.0 0 25

Limit (cost=132.38..132.39 rows=1 width=18) (actual time=0.617..0.637 rows=0 loops=25)

116. 0.550 14.975 ↓ 0.0 0 25

Sort (cost=132.38..132.39 rows=1 width=18) (actual time=0.597..0.599 rows=0 loops=25)

  • Sort Key: u0_3.sort, u0_3.id
  • Sort Method: quicksort Memory: 25kB
117. 0.625 14.425 ↓ 0.0 0 25

WindowAgg (cost=28.31..132.37 rows=1 width=18) (actual time=0.573..0.577 rows=0 loops=25)

118. 5.868 13.800 ↓ 0.0 0 25

Hash Join (cost=28.31..132.36 rows=1 width=14) (actual time=0.483..0.552 rows=0 loops=25)

  • Hash Cond: (u0_3.order_id = u2_1.id)
119. 6.825 7.400 ↑ 1.4 22 25

Bitmap Heap Scan on orders_orderline u0_3 (cost=4.53..108.45 rows=31 width=18) (actual time=0.041..0.296 rows=22 loops=25)

  • Recheck Cond: (product_configuration_id = products_productconfiguration.id)
  • Heap Blocks: exact=451
120. 0.575 0.575 ↑ 1.4 22 25

Bitmap Index Scan on orders_orderline_product_configuration_id_a423a83d (cost=0.00..4.52 rows=31 width=0) (actual time=0.022..0.023 rows=22 loops=25)

  • Index Cond: (product_configuration_id = products_productconfiguration.id)
121. 0.225 0.532 ↑ 1.0 23 1

Hash (cost=23.50..23.50 rows=23 width=4) (actual time=0.490..0.532 rows=23 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
122. 0.307 0.307 ↑ 1.0 23 1

Index Scan using orders_orde_status_c6dd84_idx on orders_order u2_1 (cost=0.28..23.50 rows=23 width=4) (actual time=0.012..0.307 rows=23 loops=1)

  • Index Cond: ((status)::text = ANY ('{PRE_ORDER,DRAFT,CONFIRMED}'::text[]))
123. 0.700 7.625 ↓ 0.0 0 25

Limit (cost=15.47..15.48 rows=1 width=18) (actual time=0.293..0.305 rows=0 loops=25)

124. 0.650 6.925 ↓ 0.0 0 25

Sort (cost=15.47..15.48 rows=1 width=18) (actual time=0.276..0.277 rows=0 loops=25)

  • Sort Key: u0_4.sort, u0_4.id
  • Sort Method: quicksort Memory: 25kB
125. 0.625 6.275 ↓ 0.0 0 25

WindowAgg (cost=4.30..15.46 rows=1 width=18) (actual time=0.247..0.251 rows=0 loops=25)

126. 2.504 5.650 ↓ 0.0 0 25

Nested Loop (cost=4.30..15.45 rows=1 width=14) (actual time=0.175..0.226 rows=0 loops=25)

  • Join Filter: (u0_4.purchase_order_id = u2_2.id)
  • Rows Removed by Join Filter: 7
127. 0.725 1.100 ↑ 3.0 1 25

Bitmap Heap Scan on purchase_orders_purchaseorderline u0_4 (cost=4.30..13.78 rows=3 width=18) (actual time=0.030..0.044 rows=1 loops=25)

  • Recheck Cond: (product_configuration_id = products_productconfiguration.id)
  • Heap Blocks: exact=31
128. 0.375 0.375 ↑ 3.0 1 25

Bitmap Index Scan on purchase_orders_purchaseor_product_configuration_id_49e3c618 (cost=0.00..4.30 rows=3 width=0) (actual time=0.013..0.015 rows=1 loops=25)

  • Index Cond: (product_configuration_id = products_productconfiguration.id)
129. 1.927 2.046 ↓ 3.0 6 31

Materialize (cost=0.00..1.59 rows=2 width=4) (actual time=0.009..0.066 rows=6 loops=31)

130. 0.119 0.119 ↓ 3.0 6 1

Seq Scan on purchase_orders_purchaseorder u2_2 (cost=0.00..1.58 rows=2 width=4) (actual time=0.029..0.119 rows=6 loops=1)

  • Filter: ((status)::text = ANY ('{CONFIRMED,ACCEPTED}'::text[]))
  • Rows Removed by Filter: 40
131. 0.400 4.550 ↓ 0.0 0 25

Limit (cost=15.36..15.37 rows=1 width=20) (actual time=0.181..0.182 rows=0 loops=25)

132. 0.475 4.150 ↓ 0.0 0 25

Sort (cost=15.36..15.37 rows=1 width=20) (actual time=0.165..0.166 rows=0 loops=25)

  • Sort Key: u0_5.box, u0_5.sort, u0_5.id
  • Sort Method: quicksort Memory: 25kB
133. 0.425 3.675 ↓ 0.0 0 25

WindowAgg (cost=4.30..15.35 rows=1 width=20) (actual time=0.147..0.147 rows=0 loops=25)

134. 1.437 3.250 ↓ 0.0 0 25

Nested Loop (cost=4.30..15.34 rows=1 width=16) (actual time=0.129..0.130 rows=0 loops=25)

  • Join Filter: (u0_5.shipment_id = u2_3.id)
  • Rows Removed by Join Filter: 2
135. 0.825 1.150 ↑ 1.5 2 25

Bitmap Heap Scan on shipments_shipmentline u0_5 (cost=4.30..13.84 rows=3 width=20) (actual time=0.028..0.046 rows=2 loops=25)

  • Recheck Cond: (product_configuration_id = products_productconfiguration.id)
  • Heap Blocks: exact=37
136. 0.325 0.325 ↑ 1.5 2 25

Bitmap Index Scan on shipments_shipmentline_product_configuration_id_cc58e44d (cost=0.00..4.30 rows=3 width=0) (actual time=0.012..0.013 rows=2 loops=25)

  • Index Cond: (product_configuration_id = products_productconfiguration.id)
137. 0.619 0.663 ↑ 2.0 1 39

Materialize (cost=0.00..1.41 rows=2 width=4) (actual time=0.008..0.017 rows=1 loops=39)

138. 0.044 0.044 ↑ 2.0 1 1

Seq Scan on shipments_shipment u2_3 (cost=0.00..1.40 rows=2 width=4) (actual time=0.023..0.044 rows=1 loops=1)

  • Filter: ((status)::text = ANY ('{SENT,RECEIVED}'::text[]))
  • Rows Removed by Filter: 31
139. 0.900 72.775 ↓ 0.0 0 25

Limit (cost=23.79..23.79 rows=1 width=20) (actual time=2.890..2.911 rows=0 loops=25)

140. 0.575 71.875 ↓ 0.0 0 25

Sort (cost=23.79..23.79 rows=1 width=20) (actual time=2.874..2.875 rows=0 loops=25)

  • Sort Key: u0_6.box, u0_6.sort, u0_6.id
  • Sort Method: quicksort Memory: 25kB
141. 0.700 71.300 ↓ 0.0 0 25

WindowAgg (cost=4.72..23.78 rows=1 width=20) (actual time=2.848..2.852 rows=0 loops=25)

142. 1.129 70.600 ↓ 0.0 0 25

Nested Loop (cost=4.72..23.76 rows=1 width=16) (actual time=2.405..2.824 rows=0 loops=25)

143. 1.683 68.925 ↓ 2.0 2 25

Nested Loop (cost=4.58..23.59 rows=1 width=20) (actual time=1.680..2.757 rows=2 loops=25)

144. 26.000 66.150 ↓ 2.0 2 25

Nested Loop (cost=4.30..15.28 rows=1 width=20) (actual time=1.653..2.646 rows=2 loops=25)

  • Join Filter: (u0_6.shipment_id = u4.id)
  • Rows Removed by Join Filter: 47
145. 6.825 6.825 ↓ 31.0 31 25

Seq Scan on shipments_shipment u4 (cost=0.00..1.40 rows=1 width=4) (actual time=0.011..0.273 rows=31 loops=25)

  • Filter: ((status)::text = 'PROCESSED'::text)
  • Rows Removed by Filter: 1
146. 24.800 33.325 ↑ 1.5 2 775

Bitmap Heap Scan on shipments_shipmentline u0_6 (cost=4.30..13.84 rows=3 width=24) (actual time=0.029..0.043 rows=2 loops=775)

  • Recheck Cond: (product_configuration_id = products_productconfiguration.id)
  • Heap Blocks: exact=1147
147. 8.525 8.525 ↑ 1.5 2 775

Bitmap Index Scan on shipments_shipmentline_product_configuration_id_cc58e44d (cost=0.00..4.30 rows=3 width=0) (actual time=0.011..0.011 rows=2 loops=775)

  • Index Cond: (product_configuration_id = products_productconfiguration.id)
148. 1.092 1.092 ↑ 1.0 1 39

Index Scan using purchase_orders_purchaseorderline_pkey on purchase_orders_purchaseorderline u2_4 (cost=0.28..8.30 rows=1 width=8) (actual time=0.020..0.028 rows=1 loops=39)

  • Index Cond: (id = u0_6.purchase_order_line_id)
149. 0.546 0.546 ↓ 0.0 0 39

Index Scan using purchase_orders_purchaseorder_pkey on purchase_orders_purchaseorder u3 (cost=0.14..0.16 rows=1 width=4) (actual time=0.011..0.014 rows=0 loops=39)

  • Index Cond: (id = u2_4.purchase_order_id)
  • Filter: ((status)::text = 'ACCEPTED'::text)
  • Rows Removed by Filter: 1
Planning time : 6.265 ms
Execution time : 47,931.243 ms