explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Lkw5

Settings
# exclusive inclusive rows x rows loops node
1. 58,966.559 1,459,033.342 ↓ 3,172,987.0 3,172,987 1

Sort (cost=40,695,350.72..40,695,350.73 rows=1 width=4,376) (actual time=1,441,200.916..1,459,033.342 rows=3,172,987 loops=1)

  • Sort Key: ol.uuid
  • Sort Method: external merge Disk: 3208336kB
2. 245,608.764 1,400,066.783 ↓ 3,172,987.0 3,172,987 1

Nested Loop Left Join (cost=35,512,496.10..40,695,350.71 rows=1 width=4,376) (actual time=370,128.980..1,400,066.783 rows=3,172,987 loops=1)

3. 10,252.163 745,142.696 ↓ 3,172,987.0 3,172,987 1

Nested Loop Left Join (cost=35,512,495.95..40,695,141.45 rows=1 width=4,344) (actual time=370,127.042..745,142.696 rows=3,172,987 loops=1)

4. 7,004.061 633,354.949 ↓ 3,172,987.0 3,172,987 1

Nested Loop Left Join (cost=35,512,495.52..40,695,130.70 rows=1 width=4,250) (actual time=370,126.933..633,354.949 rows=3,172,987 loops=1)

5. 7,145.714 623,177.901 ↓ 3,172,987.0 3,172,987 1

Nested Loop Left Join (cost=35,512,495.23..40,695,127.68 rows=1 width=4,215) (actual time=370,126.921..623,177.901 rows=3,172,987 loops=1)

6. 5,948.526 612,859.200 ↓ 3,172,987.0 3,172,987 1

Nested Loop Left Join (cost=35,512,494.95..40,695,124.71 rows=1 width=4,180) (actual time=370,126.912..612,859.200 rows=3,172,987 loops=1)

7. 6,449.322 603,737.687 ↓ 3,172,987.0 3,172,987 1

Nested Loop Left Join (cost=35,512,494.53..40,695,122.45 rows=1 width=4,180) (actual time=370,126.908..603,737.687 rows=3,172,987 loops=1)

8. 13,096.309 594,115.378 ↓ 3,172,987.0 3,172,987 1

Nested Loop Left Join (cost=35,512,494.11..40,695,120.20 rows=1 width=4,172) (actual time=370,126.902..594,115.378 rows=3,172,987 loops=1)

  • Filter: ((first_refund_current_status.id = (SubPlan 22)) OR (first_refund_current_status.* IS NULL))
  • Rows Removed by Filter: 191822
9. 5,292.921 567,751.655 ↓ 113,321.0 3,172,987 1

Hash Left Join (cost=35,512,493.68..40,694,338.22 rows=28 width=4,172) (actual time=370,126.885..567,751.655 rows=3,172,987 loops=1)

  • Hash Cond: (first_refund.reason_id = first_refund_reason.id)
10. 8,423.409 562,458.643 ↓ 113,321.0 3,172,987 1

Nested Loop Left Join (cost=35,512,491.09..40,694,335.24 rows=28 width=4,169) (actual time=370,126.784..562,458.643 rows=3,172,987 loops=1)

11. 10,476.591 538,170.299 ↓ 113,321.0 3,172,987 1

Nested Loop Left Join (cost=35,512,490.80..40,694,278.85 rows=28 width=4,169) (actual time=370,126.757..538,170.299 rows=3,172,987 loops=1)

12. 9,988.580 499,136.825 ↓ 113,321.0 3,172,987 1

Nested Loop (cost=35,512,490.24..40,693,996.17 rows=28 width=4,148) (actual time=370,126.714..499,136.825 rows=3,172,987 loops=1)

13. 7,467.731 470,110.323 ↓ 113,321.0 3,172,987 1

Hash Left Join (cost=35,512,489.81..40,693,935.08 rows=28 width=4,030) (actual time=370,126.682..470,110.323 rows=3,172,987 loops=1)

  • Hash Cond: ((('OfferState.'::text || (ol.offer_state)::text) || '.label'::text) = i18n_offer_state_without_region.code)
14. 6,606.129 462,642.042 ↓ 113,321.0 3,172,987 1

Hash Left Join (cost=35,512,452.18..40,693,895.44 rows=28 width=3,995) (actual time=370,126.120..462,642.042 rows=3,172,987 loops=1)

  • Hash Cond: ((('OfferState.'::text || (ol.offer_state)::text) || '.label'::text) = i18n_offer_state.code)
15. 16,068.626 456,035.881 ↓ 113,321.0 3,172,987 1

Hash Left Join (cost=35,512,444.00..40,693,887.07 rows=28 width=3,960) (actual time=370,126.025..456,035.881 rows=3,172,987 loops=1)

  • Hash Cond: (ol.id = first_refund.order_line_id)
  • Filter: ((first_refund.id = (SubPlan 21)) OR (first_refund.id IS NULL))
  • Rows Removed by Filter: 773
16. 5,263.170 417,598.338 ↓ 1.2 3,172,987 1

Hash Join (cost=35,497,329.93..37,609,420.09 rows=2,704,450 width=3,420) (actual time=369,973.079..417,598.338 rows=3,172,987 loops=1)

  • Hash Cond: (o.shop_id = s.id)
17. 5,053.623 412,322.412 ↓ 1.2 3,172,987 1

Hash Left Join (cost=35,495,478.66..37,570,382.63 rows=2,704,450 width=3,390) (actual time=369,960.283..412,322.412 rows=3,172,987 loops=1)

  • Hash Cond: (o.commission_grid_uuid = commission_grid.uuid)
18. 4,554.092 407,268.369 ↓ 1.2 3,172,987 1

Hash Left Join (cost=35,495,462.69..37,533,180.47 rows=2,704,450 width=3,383) (actual time=369,956.953..407,268.369 rows=3,172,987 loops=1)

  • Hash Cond: ((('Channel.'::text || (o.channel_code)::text) || '.label'::text) = i18n_channel_label_without_region.code)
19. 4,611.605 402,713.802 ↓ 1.2 3,172,987 1

Hash Left Join (cost=35,495,425.06..37,337,840.17 rows=2,704,450 width=3,348) (actual time=369,956.468..402,713.802 rows=3,172,987 loops=1)

  • Hash Cond: ((('Channel.'::text || (o.channel_code)::text) || '.label'::text) = i18n_channel_label.code)
20. 6,720.520 398,102.184 ↓ 1.2 3,172,987 1

Hash Left Join (cost=35,495,416.88..37,320,832.93 rows=2,704,450 width=3,313) (actual time=369,956.444..398,102.184 rows=3,172,987 loops=1)

  • Hash Cond: ((('ShippingZone.'::text || (o.shipping_zone_code)::text) || '.label'::text) = i18n_shipping_zone_label_without_region.code)
21. 18,664.112 391,381.157 ↓ 1.2 3,172,987 1

Hash Right Join (cost=35,495,379.25..37,125,492.63 rows=2,704,450 width=3,278) (actual time=369,955.919..391,381.157 rows=3,172,987 loops=1)

  • Hash Cond: (tl_commission_fee.order_line_id = ol.id)
22. 2,764.483 2,764.483 ↓ 1.0 3,148,485 1

Index Only Scan using idx_transaction_log_type_order_line_id on transaction_log tl_commission_fee (cost=0.56..470,494.07 rows=3,055,854 width=8) (actual time=0.989..2,764.483 rows=3,148,485 loops=1)

  • Index Cond: (type = 'COMMISSION_FEE'::text)
  • Heap Fetches: 208819
23. 7,703.015 369,952.562 ↓ 1.2 3,172,987 1

Hash (cost=34,370,813.07..34,370,813.07 rows=2,704,450 width=3,278) (actual time=369,952.562..369,952.562 rows=3,172,987 loops=1)

  • Buckets: 16384 Batches: 512 Memory Usage: 6604kB
24. 12,204.120 362,249.547 ↓ 1.2 3,172,987 1

Hash Right Join (cost=33,116,066.39..34,370,813.07 rows=2,704,450 width=3,278) (actual time=349,943.922..362,249.547 rows=3,172,987 loops=1)

  • Hash Cond: (ols_refunded.order_line_id = ol.id)
25. 121.815 136.193 ↑ 1.0 80,126 1

Bitmap Heap Scan on order_line_status ols_refunded (cost=2,299.59..166,877.58 rows=83,487 width=16) (actual time=23.825..136.193 rows=80,126 loops=1)

  • Recheck Cond: ((order_state)::text = 'REFUNDED'::text)
  • Heap Blocks: exact=51821
26. 14.378 14.378 ↑ 1.0 80,127 1

Bitmap Index Scan on order_line_status_order_state_idx (cost=0.00..2,278.72 rows=83,487 width=0) (actual time=14.378..14.378 rows=80,127 loops=1)

  • Index Cond: ((order_state)::text = 'REFUNDED'::text)
27. 8,288.909 349,909.234 ↓ 1.2 3,172,987 1

Hash (cost=31,991,842.18..31,991,842.18 rows=2,704,450 width=3,270) (actual time=349,909.234..349,909.234 rows=3,172,987 loops=1)

  • Buckets: 16384 Batches: 512 Memory Usage: 6602kB
28. 4,619.025 341,620.325 ↓ 1.2 3,172,987 1

Hash Left Join (cost=30,456,664.46..31,991,842.18 rows=2,704,450 width=3,270) (actual time=302,987.007..341,620.325 rows=3,172,987 loops=1)

  • Hash Cond: ((('ShippingZone.'::text || (o.shipping_zone_code)::text) || '.label'::text) = i18n_shipping_zone_label.code)
29. 5,153.239 337,001.293 ↓ 1.2 3,172,987 1

Hash Left Join (cost=30,456,656.28..31,974,834.94 rows=2,704,450 width=3,235) (actual time=302,986.984..337,001.293 rows=3,172,987 loops=1)

  • Hash Cond: ((('ShippingType.'::text || (o.shipping_type_code)::text) || '.label'::text) = i18n_shipping_type_label_without_region.code)
30. 4,429.858 331,847.566 ↓ 1.2 3,172,987 1

Hash Left Join (cost=30,456,618.65..31,779,494.64 rows=2,704,450 width=3,200) (actual time=302,986.474..331,847.566 rows=3,172,987 loops=1)

  • Hash Cond: ((('ShippingType.'::text || (o.shipping_type_code)::text) || '.label'::text) = i18n_shipping_type_label.code)
31. 4,057.063 327,417.701 ↓ 1.2 3,172,987 1

Hash Left Join (cost=30,456,610.47..31,762,487.41 rows=2,704,450 width=3,165) (actual time=302,986.451..327,417.701 rows=3,172,987 loops=1)

  • Hash Cond: ((('Reason.'::text || (ols_incident_open.reason)::text) || '.label'::text) = i18n_incident_reason_without_region.code)
32. 4,006.292 323,360.071 ↓ 1.2 3,172,987 1

Hash Left Join (cost=30,456,572.84..31,567,147.11 rows=2,704,450 width=3,130) (actual time=302,985.866..323,360.071 rows=3,172,987 loops=1)

  • Hash Cond: ((('Reason.'::text || (ols_incident_open.reason)::text) || '.label'::text) = i18n_incident_reason.code)
33. 3,916.447 319,353.757 ↓ 1.2 3,172,987 1

Hash Anti Join (cost=30,456,564.66..31,550,139.87 rows=2,704,450 width=3,095) (actual time=302,985.823..319,353.757 rows=3,172,987 loops=1)

  • Hash Cond: (((ols_incident_close.order_state)::text = (ols_incident_close_tmp.order_state)::text) AND (ols_incident_close.order_line_id = ols_incident_close_tmp.order_line_id))
  • Join Filter: (((ols_incident_close.order_state)::text = 'INCIDENT_CLOSED'::text) AND (ols_incident_close.date_created < ols_incident_close_tmp.date_created))
  • Rows Removed by Join Filter: 77691
34. 12,377.141 315,295.477 ↓ 1.2 3,172,987 1

Hash Right Join (cost=30,448,652.86..31,485,320.30 rows=2,704,606 width=3,116) (actual time=302,843.823..315,295.477 rows=3,172,987 loops=1)

  • Hash Cond: (ols_incident_close.order_line_id = ol.id)
  • Join Filter: (ols_incident_close.date_created >= ols_incident_open.date_created)
  • Rows Removed by Join Filter: 9191
35. 80.542 80.542 ↑ 1.0 82,399 1

Index Scan using idx_order_line_status_id_where_incident_closed on order_line_status ols_incident_close (cost=0.29..6,639.62 rows=84,812 width=29) (actual time=0.042..80.542 rows=82,399 loops=1)

36. 7,932.022 302,837.794 ↓ 1.2 3,172,987 1

Hash (cost=29,387,410.99..29,387,410.99 rows=2,704,606 width=3,087) (actual time=302,837.794..302,837.794 rows=3,172,987 loops=1)

  • Buckets: 16384 Batches: 512 Memory Usage: 6542kB
37. 4,003.163 294,905.772 ↓ 1.2 3,172,987 1

Hash Anti Join (cost=27,492,805.25..29,387,410.99 rows=2,704,606 width=3,087) (actual time=272,776.384..294,905.772 rows=3,172,987 loops=1)

  • Hash Cond: (((ols_incident_open.order_state)::text = (ols_incident_open_tmp.order_state)::text) AND (ols_incident_open.order_line_id = ols_incident_open_tmp.order_line_id))
  • Join Filter: (((ols_incident_open.order_state)::text = 'INCIDENT_OPEN'::text) AND (ols_incident_open.date_created < ols_incident_open_tmp.date_created))
  • Rows Removed by Join Filter: 84581
38. 12,268.499 290,752.177 ↓ 1.2 3,182,178 1

Hash Right Join (cost=27,484,408.60..29,322,142.70 rows=2,704,759 width=3,108) (actual time=272,625.643..290,752.177 rows=3,182,178 loops=1)

  • Hash Cond: (tl_paid.order_line_id = ol.id)
39. 5,865.804 5,865.804 ↓ 1.0 2,985,652 1

Seq Scan on transaction_log tl_paid (cost=0.00..541,484.17 rows=2,873,483 width=532) (actual time=0.027..5,865.804 rows=2,985,652 loops=1)

  • Filter: (((payment_state)::text = 'PAID'::text) AND ((type)::text = 'ORDER_AMOUNT'::text))
  • Rows Removed by Filter: 10077422
40. 7,817.980 272,617.874 ↓ 1.2 3,182,178 1

Hash (cost=26,589,513.11..26,589,513.11 rows=2,704,759 width=2,584) (actual time=272,617.874..272,617.874 rows=3,182,178 loops=1)

  • Buckets: 16384 Batches: 256 Memory Usage: 17672kB
41. 9,604.035 264,799.894 ↓ 1.2 3,182,178 1

Hash Right Join (cost=25,731,776.45..26,589,513.11 rows=2,704,759 width=2,584) (actual time=255,102.428..264,799.894 rows=3,182,178 loops=1)

  • Hash Cond: (ols_incident_open.order_line_id = ol.id)
42. 97.088 97.088 ↓ 1.0 84,581 1

Index Scan using idx_order_line_status_id_where_incident_open on order_line_status ols_incident_open (cost=0.29..7,134.42 rows=84,149 width=42) (actual time=0.052..97.088 rows=84,581 loops=1)

43. 8,086.207 255,098.771 ↓ 1.2 3,172,987 1

Hash (cost=24,850,087.67..24,850,087.67 rows=2,704,759 width=2,542) (actual time=255,098.771..255,098.771 rows=3,172,987 loops=1)

  • Buckets: 16384 Batches: 256 Memory Usage: 12913kB
44. 14,310.595 247,012.564 ↓ 1.2 3,172,987 1

Hash Anti Join (cost=16,523,916.30..24,850,087.67 rows=2,704,759 width=2,542) (actual time=206,224.614..247,012.564 rows=3,172,987 loops=1)

  • Hash Cond: (((ols_received.order_state)::text = (ols_received_tmp.order_state)::text) AND (ols_received.order_line_id = ols_received_tmp.order_line_id))
  • Join Filter: (((ols_received.order_state)::text = 'RECEIVED'::text) AND (ols_received.date_created > ols_received_tmp.date_created))
  • Rows Removed by Join Filter: 3050880
45. 16,329.547 228,493.706 ↓ 1.1 3,203,721 1

Hash Anti Join (cost=16,109,565.49..21,020,480.88 rows=2,850,983 width=2,571) (actual time=198,030.521..228,493.706 rows=3,203,721 loops=1)

  • Hash Cond: (((ols_shipped.order_state)::text = (ols_shipped_tmp.order_state)::text) AND (ols_shipped.order_line_id = ols_shipped_tmp.order_line_id))
  • Join Filter: (((ols_shipped.order_state)::text = 'SHIPPED'::text) AND (ols_shipped.date_created > ols_shipped_tmp.date_created))
  • Rows Removed by Join Filter: 13067409
46. 12,207.176 207,571.678 ↓ 1.1 3,254,161 1

Hash Right Join (cost=15,696,278.92..17,000,076.81 rows=3,004,197 width=2,592) (actual time=193,422.828..207,571.678 rows=3,254,161 loops=1)

  • Hash Cond: (ols_received.order_line_id = ol.id)
47. 1,960.763 2,271.619 ↑ 1.0 3,021,202 1

Bitmap Heap Scan on order_line_status ols_received (cost=84,216.19..347,564.84 rows=3,058,532 width=29) (actual time=325.812..2,271.619 rows=3,021,202 loops=1)

  • Recheck Cond: ((order_state)::text = 'RECEIVED'::text)
  • Heap Blocks: exact=71885
48. 310.856 310.856 ↑ 1.0 3,021,203 1

Bitmap Index Scan on order_line_status_order_state_idx (cost=0.00..83,451.55 rows=3,058,532 width=0) (actual time=310.856..310.856 rows=3,021,203 loops=1)

  • Index Cond: ((order_state)::text = 'RECEIVED'::text)
49. 7,825.335 193,092.883 ↓ 1.1 3,221,296 1

Hash (cost=14,623,963.28..14,623,963.28 rows=3,004,197 width=2,563) (actual time=193,092.883..193,092.883 rows=3,221,296 loops=1)

  • Buckets: 16384 Batches: 256 Memory Usage: 17777kB
50. 12,087.455 185,267.548 ↓ 1.1 3,221,296 1

Hash Right Join (cost=13,332,620.57..14,623,963.28 rows=3,004,197 width=2,563) (actual time=170,969.374..185,267.548 rows=3,221,296 loops=1)

  • Hash Cond: (ols_shipped.order_line_id = ol.id)
51. 2,257.590 2,616.655 ↓ 1.0 3,105,248 1

Bitmap Heap Scan on order_line_status ols_shipped (cost=83,742.68..346,875.99 rows=3,041,305 width=29) (actual time=402.460..2,616.655 rows=3,105,248 loops=1)

  • Recheck Cond: ((order_state)::text = 'SHIPPED'::text)
  • Heap Blocks: exact=185410
52. 359.065 359.065 ↓ 1.0 3,105,281 1

Bitmap Index Scan on order_line_status_order_state_idx (cost=0.00..82,982.35 rows=3,041,305 width=0) (actual time=359.065..359.065 rows=3,105,281 loops=1)

  • Index Cond: ((order_state)::text = 'SHIPPED'::text)
53. 8,582.537 170,563.438 ↓ 1.1 3,172,987 1

Hash (cost=12,272,513.43..12,272,513.43 rows=3,004,197 width=2,534) (actual time=170,563.438..170,563.438 rows=3,172,987 loops=1)

  • Buckets: 16384 Batches: 256 Memory Usage: 12817kB
54. 15,286.565 161,980.901 ↓ 1.1 3,172,987 1

Hash Anti Join (cost=6,117,716.58..12,272,513.43 rows=3,004,197 width=2,534) (actual time=101,449.762..161,980.901 rows=3,172,987 loops=1)

  • Hash Cond: (((ols_shipping.order_state)::text = (ols_shipping_tmp.order_state)::text) AND (ols_shipping.order_line_id = ols_shipping_tmp.order_line_id))
  • Join Filter: (((ols_shipping.order_state)::text = 'SHIPPING'::text) AND (ols_shipping.date_created > ols_shipping_tmp.date_created))
  • Rows Removed by Join Filter: 3152019
55. 18,361.403 142,013.007 ↓ 1.0 3,174,921 1

Hash Join (cost=5,697,789.28..8,055,777.76 rows=3,171,661 width=2,555) (actual time=95,539.807..142,013.007 rows=3,174,921 loops=1)

  • Hash Cond: (ol.order_id = o.id)
56. 22,512.687 115,101.542 ↓ 1.0 3,174,921 1

Hash Right Join (cost=4,847,867.58..5,948,711.57 rows=3,171,661 width=725) (actual time=80,801.384..115,101.542 rows=3,174,921 loops=1)

  • Hash Cond: (ols.id = ol.order_line_status_id)
57. 11,831.393 11,831.393 ↓ 1.0 19,966,457 1

Seq Scan on order_line_status ols (cost=0.00..423,895.08 rows=19,877,808 width=21) (actual time=0.011..11,831.393 rows=19,966,457 loops=1)

58. 5,719.633 80,757.462 ↓ 1.0 3,174,921 1

Hash (cost=4,520,169.82..4,520,169.82 rows=3,171,661 width=720) (actual time=80,757.462..80,757.462 rows=3,174,921 loops=1)

  • Buckets: 65536 Batches: 128 Memory Usage: 19176kB
59. 9,100.621 75,037.829 ↓ 1.0 3,174,921 1

Hash Right Join (cost=3,882,721.28..4,520,169.82 rows=3,171,661 width=720) (actual time=63,725.239..75,037.829 rows=3,174,921 loops=1)

  • Hash Cond: (ols_shipping.order_line_id = ol.id)
60. 2,250.833 2,672.215 ↓ 1.0 3,150,419 1

Bitmap Heap Scan on order_line_status ols_shipping (cost=86,698.56..351,173.62 rows=3,148,645 width=29) (actual time=459.058..2,672.215 rows=3,150,419 loops=1)

  • Recheck Cond: ((order_state)::text = 'SHIPPING'::text)
  • Heap Blocks: exact=156831
61. 421.382 421.382 ↓ 1.0 3,150,427 1

Bitmap Index Scan on order_line_status_order_state_idx (cost=0.00..85,911.40 rows=3,148,645 width=0) (actual time=421.382..421.382 rows=3,150,427 loops=1)

  • Index Cond: ((order_state)::text = 'SHIPPING'::text)
62. 5,259.309 63,264.993 ↓ 1.0 3,172,987 1

Hash (cost=3,477,616.95..3,477,616.95 rows=3,171,661 width=691) (actual time=63,264.993..63,264.993 rows=3,172,987 loops=1)

  • Buckets: 65536 Batches: 128 Memory Usage: 18610kB
63. 8,875.085 58,005.684 ↓ 1.0 3,172,987 1

Hash Right Join (cost=2,855,845.97..3,477,616.95 rows=3,171,661 width=691) (actual time=46,837.154..58,005.684 rows=3,172,987 loops=1)

  • Hash Cond: (ols_waiting_acceptance.order_line_id = ol.id)
64. 2,335.979 2,788.761 ↓ 1.0 3,166,096 1

Bitmap Heap Scan on order_line_status ols_waiting_acceptance (cost=86,498.07..350,882.02 rows=3,141,356 width=16) (actual time=494.120..2,788.761 rows=3,166,096 loops=1)

  • Recheck Cond: ((order_state)::text = 'WAITING_ACCEPTANCE'::text)
  • Heap Blocks: exact=177317
65. 452.782 452.782 ↓ 1.0 3,166,098 1

Bitmap Index Scan on order_line_status_order_state_idx (cost=0.00..85,712.73 rows=3,141,356 width=0) (actual time=452.782..452.782 rows=3,166,098 loops=1)

  • Index Cond: ((order_state)::text = 'WAITING_ACCEPTANCE'::text)
66. 5,153.412 46,341.838 ↓ 1.0 3,172,987 1

Hash (cost=2,454,040.13..2,454,040.13 rows=3,171,661 width=683) (actual time=46,341.838..46,341.838 rows=3,172,987 loops=1)

  • Buckets: 65536 Batches: 128 Memory Usage: 18416kB
67. 8,526.349 41,188.426 ↓ 1.0 3,172,987 1

Hash Right Join (cost=1,836,819.95..2,454,040.13 rows=3,171,661 width=683) (actual time=30,300.014..41,188.426 rows=3,172,987 loops=1)

  • Hash Cond: (ols_waiting_debit.order_line_id = ol.id)
68. 2,409.588 2,837.822 ↓ 1.0 3,148,573 1

Bitmap Heap Scan on order_line_status ols_waiting_debit (cost=85,457.38..349,369.24 rows=3,103,589 width=16) (actual time=474.533..2,837.822 rows=3,148,573 loops=1)

  • Recheck Cond: ((order_state)::text = 'WAITING_DEBIT'::text)
  • Heap Blocks: exact=195565
69. 428.234 428.234 ↓ 1.0 3,148,573 1

Bitmap Index Scan on order_line_status_order_state_idx (cost=0.00..84,681.48 rows=3,103,589 width=0) (actual time=428.234..428.234 rows=3,148,573 loops=1)

  • Index Cond: ((order_state)::text = 'WAITING_DEBIT'::text)
70. 5,201.011 29,824.255 ↓ 1.0 3,172,987 1

Hash (cost=1,439,151.81..1,439,151.81 rows=3,171,661 width=675) (actual time=29,824.255..29,824.255 rows=3,172,987 loops=1)

  • Buckets: 65536 Batches: 128 Memory Usage: 18224kB
71. 8,973.933 24,623.244 ↓ 1.0 3,172,987 1

Hash Right Join (cost=825,182.94..1,439,151.81 rows=3,171,661 width=675) (actual time=12,809.064..24,623.244 rows=3,172,987 loops=1)

  • Hash Cond: (ols_waiting_debit_payment.order_line_id = ol.id)
72. 2,888.193 3,363.254 ↓ 1.0 3,148,573 1

Bitmap Heap Scan on order_line_status ols_waiting_debit_payment (cost=85,346.56..349,208.73 rows=3,099,613 width=16) (actual time=521.729..3,363.254 rows=3,148,573 loops=1)

  • Recheck Cond: ((order_state)::text = 'WAITING_DEBIT_PAYMENT'::text)
  • Heap Blocks: exact=196024
73. 475.061 475.061 ↓ 1.0 3,148,573 1

Bitmap Index Scan on order_line_status_order_state_idx (cost=0.00..84,571.66 rows=3,099,613 width=0) (actual time=475.061..475.061 rows=3,148,573 loops=1)

  • Index Cond: ((order_state)::text = 'WAITING_DEBIT_PAYMENT'::text)
74. 5,789.531 12,286.057 ↓ 1.0 3,172,987 1

Hash (cost=430,722.61..430,722.61 rows=3,171,661 width=667) (actual time=12,286.057..12,286.057 rows=3,172,987 loops=1)

  • Buckets: 65536 Batches: 128 Memory Usage: 18032kB
75. 6,496.526 6,496.526 ↓ 1.0 3,172,987 1

Seq Scan on order_line ol (cost=0.00..430,722.61 rows=3,171,661 width=667) (actual time=0.019..6,496.526 rows=3,172,987 loops=1)

76. 4,140.739 8,550.062 ↑ 1.0 2,722,792 1

Hash (cost=192,519.31..192,519.31 rows=2,727,631 width=1,846) (actual time=8,550.062..8,550.062 rows=2,722,792 loops=1)

  • Buckets: 16384 Batches: 256 Memory Usage: 3465kB
77. 4,409.323 4,409.323 ↑ 1.0 2,722,792 1

Seq Scan on "order" o (cost=0.00..192,519.31 rows=2,727,631 width=1,846) (actual time=0.009..4,409.323 rows=2,722,792 loops=1)

78. 2,169.592 4,681.329 ↓ 1.0 3,150,419 1

Hash (cost=351,173.62..351,173.62 rows=3,148,645 width=29) (actual time=4,681.329..4,681.329 rows=3,150,419 loops=1)

  • Buckets: 524288 Batches: 8 Memory Usage: 28672kB
79. 2,228.457 2,511.737 ↓ 1.0 3,150,419 1

Bitmap Heap Scan on order_line_status ols_shipping_tmp (cost=86,698.56..351,173.62 rows=3,148,645 width=29) (actual time=319.096..2,511.737 rows=3,150,419 loops=1)

  • Recheck Cond: ((order_state)::text = 'SHIPPING'::text)
  • Heap Blocks: exact=156831
80. 283.280 283.280 ↓ 1.0 3,150,427 1

Bitmap Index Scan on order_line_status_order_state_idx (cost=0.00..85,911.40 rows=3,148,645 width=0) (actual time=283.280..283.280 rows=3,150,427 loops=1)

  • Index Cond: ((order_state)::text = 'SHIPPING'::text)
81. 2,072.471 4,592.481 ↓ 1.0 3,105,248 1

Hash (cost=346,875.99..346,875.99 rows=3,041,305 width=29) (actual time=4,592.481..4,592.481 rows=3,105,248 loops=1)

  • Buckets: 524288 Batches: 8 Memory Usage: 25301kB
82. 2,228.818 2,520.010 ↓ 1.0 3,105,248 1

Bitmap Heap Scan on order_line_status ols_shipped_tmp (cost=83,742.68..346,875.99 rows=3,041,305 width=29) (actual time=331.611..2,520.010 rows=3,105,248 loops=1)

  • Recheck Cond: ((order_state)::text = 'SHIPPED'::text)
  • Heap Blocks: exact=185410
83. 291.192 291.192 ↓ 1.0 3,105,281 1

Bitmap Index Scan on order_line_status_order_state_idx (cost=0.00..82,982.35 rows=3,041,305 width=0) (actual time=291.192..291.192 rows=3,105,281 loops=1)

  • Index Cond: ((order_state)::text = 'SHIPPED'::text)
84. 2,035.412 4,208.263 ↑ 1.0 3,021,202 1

Hash (cost=347,564.84..347,564.84 rows=3,058,532 width=29) (actual time=4,208.263..4,208.263 rows=3,021,202 loops=1)

  • Buckets: 524288 Batches: 8 Memory Usage: 27724kB
85. 1,937.253 2,172.851 ↑ 1.0 3,021,202 1

Bitmap Heap Scan on order_line_status ols_received_tmp (cost=84,216.19..347,564.84 rows=3,058,532 width=29) (actual time=249.775..2,172.851 rows=3,021,202 loops=1)

  • Recheck Cond: ((order_state)::text = 'RECEIVED'::text)
  • Heap Blocks: exact=71885
86. 235.598 235.598 ↑ 1.0 3,021,203 1

Bitmap Index Scan on order_line_status_order_state_idx (cost=0.00..83,451.55 rows=3,058,532 width=0) (actual time=235.598..235.598 rows=3,021,203 loops=1)

  • Index Cond: ((order_state)::text = 'RECEIVED'::text)
87. 57.103 150.432 ↓ 1.0 84,581 1

Hash (cost=7,134.42..7,134.42 rows=84,149 width=29) (actual time=150.432..150.432 rows=84,581 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 6311kB
88. 93.329 93.329 ↓ 1.0 84,581 1

Index Scan using idx_order_line_status_id_where_incident_open on order_line_status ols_incident_open_tmp (cost=0.29..7,134.42 rows=84,149 width=29) (actual time=0.018..93.329 rows=84,581 loops=1)

89. 54.740 141.833 ↑ 1.0 82,399 1

Hash (cost=6,639.62..6,639.62 rows=84,812 width=29) (actual time=141.833..141.833 rows=82,399 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 6174kB
90. 87.093 87.093 ↑ 1.0 82,399 1

Index Scan using idx_order_line_status_id_where_incident_closed on order_line_status ols_incident_close_tmp (cost=0.29..6,639.62 rows=84,812 width=29) (actual time=0.009..87.093 rows=82,399 loops=1)

91. 0.002 0.022 ↓ 0.0 0 1

Hash (cost=8.17..8.17 rows=1 width=61) (actual time=0.022..0.022 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
92. 0.020 0.020 ↓ 0.0 0 1

Index Scan using i18n_message_locale_code_key on i18n_message i18n_incident_reason (cost=0.28..8.17 rows=1 width=61) (actual time=0.020..0.020 rows=0 loops=1)

  • Index Cond: ((locale)::text = 'en-AU'::text)
93. 0.209 0.567 ↑ 1.0 273 1

Hash (cost=34.21..34.21 rows=273 width=61) (actual time=0.567..0.567 rows=273 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 36kB
94. 0.358 0.358 ↑ 1.0 273 1

Seq Scan on i18n_message i18n_incident_reason_without_region (cost=0.00..34.21 rows=273 width=61) (actual time=0.012..0.358 rows=273 loops=1)

  • Filter: ((locale)::text = 'en'::text)
  • Rows Removed by Filter: 944
95. 0.001 0.007 ↓ 0.0 0 1

Hash (cost=8.17..8.17 rows=1 width=61) (actual time=0.007..0.007 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
96. 0.006 0.006 ↓ 0.0 0 1

Index Scan using i18n_message_locale_code_key on i18n_message i18n_shipping_type_label (cost=0.28..8.17 rows=1 width=61) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: ((locale)::text = 'en-AU'::text)
97. 0.200 0.488 ↑ 1.0 273 1

Hash (cost=34.21..34.21 rows=273 width=61) (actual time=0.488..0.488 rows=273 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 36kB
98. 0.288 0.288 ↑ 1.0 273 1

Seq Scan on i18n_message i18n_shipping_type_label_without_region (cost=0.00..34.21 rows=273 width=61) (actual time=0.006..0.288 rows=273 loops=1)

  • Filter: ((locale)::text = 'en'::text)
  • Rows Removed by Filter: 944
99. 0.001 0.007 ↓ 0.0 0 1

Hash (cost=8.17..8.17 rows=1 width=61) (actual time=0.007..0.007 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
100. 0.006 0.006 ↓ 0.0 0 1

Index Scan using i18n_message_locale_code_key on i18n_message i18n_shipping_zone_label (cost=0.28..8.17 rows=1 width=61) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: ((locale)::text = 'en-AU'::text)
101. 0.194 0.507 ↑ 1.0 273 1

Hash (cost=34.21..34.21 rows=273 width=61) (actual time=0.507..0.507 rows=273 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 36kB
102. 0.313 0.313 ↑ 1.0 273 1

Seq Scan on i18n_message i18n_shipping_zone_label_without_region (cost=0.00..34.21 rows=273 width=61) (actual time=0.010..0.313 rows=273 loops=1)

  • Filter: ((locale)::text = 'en'::text)
  • Rows Removed by Filter: 944
103. 0.000 0.013 ↓ 0.0 0 1

Hash (cost=8.17..8.17 rows=1 width=61) (actual time=0.013..0.013 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
104. 0.013 0.013 ↓ 0.0 0 1

Index Scan using i18n_message_locale_code_key on i18n_message i18n_channel_label (cost=0.28..8.17 rows=1 width=61) (actual time=0.013..0.013 rows=0 loops=1)

  • Index Cond: ((locale)::text = 'en-AU'::text)
105. 0.200 0.475 ↑ 1.0 273 1

Hash (cost=34.21..34.21 rows=273 width=61) (actual time=0.475..0.475 rows=273 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 36kB
106. 0.275 0.275 ↑ 1.0 273 1

Seq Scan on i18n_message i18n_channel_label_without_region (cost=0.00..34.21 rows=273 width=61) (actual time=0.005..0.275 rows=273 loops=1)

  • Filter: ((locale)::text = 'en'::text)
  • Rows Removed by Filter: 944
107. 0.198 0.420 ↑ 1.0 310 1

Hash (cost=12.10..12.10 rows=310 width=39) (actual time=0.420..0.420 rows=310 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 30kB
108. 0.222 0.222 ↑ 1.0 310 1

Seq Scan on grid commission_grid (cost=0.00..12.10 rows=310 width=39) (actual time=0.008..0.222 rows=310 loops=1)

109. 1.901 12.756 ↑ 1.3 2,585 1

Hash (cost=1,810.01..1,810.01 rows=3,301 width=46) (actual time=12.756..12.756 rows=2,585 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 219kB
110. 10.855 10.855 ↑ 1.3 2,585 1

Seq Scan on shop s (cost=0.00..1,810.01 rows=3,301 width=46) (actual time=0.013..10.855 rows=2,585 loops=1)

111. 64.486 152.597 ↑ 1.0 96,750 1

Hash (cost=7,064.03..7,064.03 rows=97,203 width=548) (actual time=152.597..152.597 rows=96,750 loops=1)

  • Buckets: 65536 Batches: 2 Memory Usage: 3169kB
112. 88.111 88.111 ↑ 1.0 96,750 1

Seq Scan on refund first_refund (cost=0.00..7,064.03 rows=97,203 width=548) (actual time=0.007..88.111 rows=96,750 loops=1)

113.          

SubPlan (forHash Left Join)

114. 6,347.520 22,216.320 ↓ 0.0 0 3,173,760

Limit (cost=8.45..8.45 rows=1 width=16) (actual time=0.007..0.007 rows=0 loops=3,173,760)

115. 6,347.520 15,868.800 ↓ 0.0 0 3,173,760

Sort (cost=8.45..8.45 rows=1 width=16) (actual time=0.005..0.005 rows=0 loops=3,173,760)

  • Sort Key: refund.date_created
  • Sort Method: quicksort Memory: 25kB
116. 9,521.280 9,521.280 ↓ 0.0 0 3,173,760

Index Scan using idx_refund_order_line_id on refund (cost=0.42..8.44 rows=1 width=16) (actual time=0.003..0.003 rows=0 loops=3,173,760)

  • Index Cond: (order_line_id = ol.id)
117. 0.002 0.032 ↓ 0.0 0 1

Hash (cost=8.17..8.17 rows=1 width=61) (actual time=0.032..0.032 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
118. 0.030 0.030 ↓ 0.0 0 1

Index Scan using i18n_message_locale_code_key on i18n_message i18n_offer_state (cost=0.28..8.17 rows=1 width=61) (actual time=0.030..0.030 rows=0 loops=1)

  • Index Cond: ((locale)::text = 'en-AU'::text)
119. 0.204 0.550 ↑ 1.0 273 1

Hash (cost=34.21..34.21 rows=273 width=61) (actual time=0.550..0.550 rows=273 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 36kB
120. 0.346 0.346 ↑ 1.0 273 1

Seq Scan on i18n_message i18n_offer_state_without_region (cost=0.00..34.21 rows=273 width=61) (actual time=0.008..0.346 rows=273 loops=1)

  • Filter: ((locale)::text = 'en'::text)
  • Rows Removed by Filter: 944
121. 19,037.922 19,037.922 ↑ 1.0 1 3,172,987

Index Scan using customer_pkey on customer cust (cost=0.43..2.17 rows=1 width=134) (actual time=0.005..0.006 rows=1 loops=3,172,987)

  • Index Cond: (id = o.customer_id)
122. 28,556.883 28,556.883 ↑ 8.0 1 3,172,987

Index Scan using idx_transaction_log_type_order_line_id on transaction_log tl_payment_status (cost=0.56..10.02 rows=8 width=29) (actual time=0.009..0.009 rows=1 loops=3,172,987)

  • Index Cond: (((type)::text = 'ORDER_AMOUNT'::text) AND (ol.id = order_line_id))
123. 15,864.935 15,864.935 ↑ 1.0 1 3,172,987

Index Scan using payment_invoice_pkey on payment_invoice inv (cost=0.29..2.00 rows=1 width=32) (actual time=0.004..0.005 rows=1 loops=3,172,987)

  • Index Cond: (uuid = tl_payment_status.accounting_document_uuid)
124. 0.044 0.091 ↑ 1.0 71 1

Hash (cost=1.71..1.71 rows=71 width=19) (actual time=0.091..0.091 rows=71 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
125. 0.047 0.047 ↑ 1.0 71 1

Seq Scan on reason first_refund_reason (cost=0.00..1.71 rows=71 width=19) (actual time=0.008..0.047 rows=71 loops=1)

126. 3,172.987 3,172.987 ↓ 0.0 0 3,172,987

Index Scan using idx_refund_status_refund_id on refund_status first_refund_current_status (cost=0.42..2.27 rows=3 width=99) (actual time=0.001..0.001 rows=0 loops=3,172,987)

  • Index Cond: (refund_id = first_refund.id)
127.          

SubPlan (forNested Loop Left Join)

128. 6,729.618 10,094.427 ↑ 1.0 1 3,364,809

Aggregate (cost=8.53..8.54 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=3,364,809)

129. 3,364.809 3,364.809 ↓ 0.0 0 3,364,809

Index Scan using idx_refund_status_refund_id on refund_status (cost=0.42..8.52 rows=3 width=8) (actual time=0.001..0.001 rows=0 loops=3,364,809)

  • Index Cond: (refund_id = first_refund.id)
130. 3,172.987 3,172.987 ↓ 0.0 0 3,172,987

Index Scan using idx_un_refund_status_refund_id_refund_state on refund_status first_refund_waiting_refund_status (cost=0.42..2.25 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=3,172,987)

  • Index Cond: ((refund_id = first_refund.id) AND ((refund_state)::text = 'WAITING_REFUND'::text))
131. 3,172.987 3,172.987 ↓ 0.0 0 3,172,987

Index Scan using idx_un_refund_status_refund_id_refund_state on refund_status first_refund_waiting_refund_payment_status (cost=0.42..2.25 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=3,172,987)

  • Index Cond: ((refund_id = first_refund.id) AND ((refund_state)::text = 'WAITING_REFUND_PAYMENT'::text))
132. 3,172.987 3,172.987 ↓ 0.0 0 3,172,987

Index Scan using i18n_message_locale_code_key on i18n_message i18n_refund_reason (cost=0.28..2.96 rows=1 width=61) (actual time=0.001..0.001 rows=0 loops=3,172,987)

  • Index Cond: (((locale)::text = 'en-AU'::text) AND (code = (('Reason.'::text || (first_refund_reason.code)::text) || '.label'::text)))
133. 3,172.987 3,172.987 ↓ 0.0 0 3,172,987

Index Scan using i18n_message_locale_code_key on i18n_message i18n_refund_reason_without_region (cost=0.28..3.01 rows=1 width=61) (actual time=0.001..0.001 rows=0 loops=3,172,987)

  • Index Cond: (((locale)::text = 'en'::text) AND (code = (('Reason.'::text || (first_refund_reason.code)::text) || '.label'::text)))
134. 48,655.622 101,535.584 ↑ 1.0 1 3,172,987

Index Scan using shipment_order_uuid_idx on shipment (cost=0.43..10.74 rows=1 width=110) (actual time=0.031..0.032 rows=1 loops=3,172,987)

  • Index Cond: (o.uuid = order_uuid)
  • Filter: (sort_index = (SubPlan 20))
135.          

SubPlan (forIndex Scan)

136. 9,331.758 52,879.962 ↑ 1.0 1 3,110,586

Result (cost=8.45..8.46 rows=1 width=0) (actual time=0.016..0.017 rows=1 loops=3,110,586)

137.          

Initplan (forResult)

138. 6,221.172 43,548.204 ↑ 1.0 1 3,110,586

Limit (cost=0.43..8.45 rows=1 width=4) (actual time=0.013..0.014 rows=1 loops=3,110,586)

139. 37,327.032 37,327.032 ↑ 1.0 1 3,110,586

Index Only Scan using idx_un_shipment_order_uuid_sort_index on shipment shipment_1 (cost=0.43..8.45 rows=1 width=4) (actual time=0.012..0.012 rows=1 loops=3,110,586)

  • Index Cond: ((order_uuid = o.uuid) AND (sort_index IS NOT NULL))
  • Heap Fetches: 397982
140. 3,172.987 3,172.987 ↓ 0.0 0 3,172,987

Index Scan using idx_un_order_quote_association_order_uuid on order_quote_association (cost=0.15..0.97 rows=1 width=64) (actual time=0.001..0.001 rows=0 loops=3,172,987)

  • Index Cond: (o.uuid = order_uuid)
141.          

SubPlan (forNested Loop Left Join)

142. 12,691.948 41,248.831 ↑ 1.0 1 3,172,987

Aggregate (cost=35.79..35.80 rows=1 width=5) (actual time=0.012..0.013 rows=1 loops=3,172,987)

143. 28,556.883 28,556.883 ↑ 8.0 1 3,172,987

Index Scan using idx_transaction_log_type_order_line_id on transaction_log tl_commission_vat (cost=0.56..35.77 rows=8 width=5) (actual time=0.008..0.009 rows=1 loops=3,172,987)

  • Index Cond: (((type)::text = 'COMMISSION_VAT'::text) AND (ol.id = order_line_id))
144. 9,518.961 28,556.883 ↑ 1.0 1 3,172,987

Aggregate (cost=8.45..8.46 rows=1 width=5) (actual time=0.008..0.009 rows=1 loops=3,172,987)

145. 19,037.922 19,037.922 ↑ 1.0 1 3,172,987

Index Scan using idx_un_order_line_commission_tax_order_line_id_code on order_line_commission_tax olct (cost=0.43..8.45 rows=1 width=5) (actual time=0.005..0.006 rows=1 loops=3,172,987)

  • Index Cond: (order_line_id = ol.id)
146. 9,518.961 22,210.909 ↑ 1.0 1 3,172,987

Aggregate (cost=1.75..1.76 rows=1 width=64) (actual time=0.007..0.007 rows=1 loops=3,172,987)

147. 12,691.948 12,691.948 ↓ 0.0 0 3,172,987

Function Scan on jsonb_each ol_json_afv (cost=0.00..1.00 rows=100 width=64) (actual time=0.004..0.004 rows=0 loops=3,172,987)

148. 6,345.974 12,691.948 ↑ 1.0 1 3,172,987

Aggregate (cost=1.75..1.76 rows=1 width=64) (actual time=0.004..0.004 rows=1 loops=3,172,987)

149. 6,345.974 6,345.974 ↓ 0.0 0 3,172,987

Function Scan on jsonb_each o_json_afv (cost=0.00..1.00 rows=100 width=64) (actual time=0.002..0.002 rows=0 loops=3,172,987)

150. 6,345.974 88,843.636 ↑ 1.0 1 3,172,987

Aggregate (cost=74.83..74.84 rows=1 width=566) (actual time=0.027..0.028 rows=1 loops=3,172,987)

151. 6,345.974 82,497.662 ↓ 0.0 0 3,172,987

Subquery Scan on refunds (cost=74.81..74.82 rows=1 width=566) (actual time=0.026..0.026 rows=0 loops=3,172,987)

152. 9,518.961 76,151.688 ↓ 0.0 0 3,172,987

Sort (cost=74.81..74.81 rows=1 width=1,066) (actual time=0.024..0.024 rows=0 loops=3,172,987)

  • Sort Key: r.date_created
  • Sort Method: quicksort Memory: 25kB
153. 8,047.948 66,632.727 ↓ 0.0 0 3,172,987

Nested Loop Left Join (cost=10.28..74.80 rows=1 width=1,066) (actual time=0.020..0.021 rows=0 loops=3,172,987)

154. 2,689.237 53,940.779 ↓ 0.0 0 3,172,987

Nested Loop Left Join (cost=10.00..38.10 rows=1 width=1,031) (actual time=0.016..0.017 rows=0 loops=3,172,987)

155. 2,882.737 50,767.792 ↓ 0.0 0 3,172,987

Nested Loop Left Join (cost=9.71..35.79 rows=1 width=996) (actual time=0.015..0.016 rows=0 loops=3,172,987)

156. 5,958.974 47,594.805 ↓ 0.0 0 3,172,987

Nested Loop Left Join (cost=9.29..27.34 rows=1 width=973) (actual time=0.013..0.015 rows=0 loops=3,172,987)

157. 9,035.211 41,248.831 ↓ 0.0 0 3,172,987

Nested Loop Left Join (cost=8.87..18.89 rows=1 width=950) (actual time=0.012..0.013 rows=0 loops=3,172,987)

158. 15,390.758 31,729.870 ↓ 0.0 0 3,172,987

Hash Join (cost=8.45..10.43 rows=1 width=927) (actual time=0.009..0.010 rows=0 loops=3,172,987)

  • Hash Cond: (reason.id = r.reason_id)
159. 3,647.164 3,647.164 ↑ 1.0 71 95,978

Seq Scan on reason (cost=0.00..1.71 rows=71 width=19) (actual time=0.003..0.038 rows=71 loops=95,978)

160. 3,172.987 12,691.948 ↓ 0.0 0 3,172,987

Hash (cost=8.44..8.44 rows=1 width=924) (actual time=0.004..0.004 rows=0 loops=3,172,987)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
161. 9,518.961 9,518.961 ↓ 0.0 0 3,172,987

Index Scan using idx_refund_order_line_id on refund r (cost=0.42..8.44 rows=1 width=924) (actual time=0.003..0.003 rows=0 loops=3,172,987)

  • Index Cond: (order_line_id = ol.id)
162. 483.750 483.750 ↑ 1.0 1 96,750

Index Scan using idx_un_refund_status_refund_id_refund_state on refund_status refund_status_waiting_refund (cost=0.42..8.44 rows=1 width=31) (actual time=0.005..0.005 rows=1 loops=96,750)

  • Index Cond: ((refund_id = r.id) AND ((refund_state)::text = 'WAITING_REFUND'::text))
163. 387.000 387.000 ↑ 1.0 1 96,750

Index Scan using idx_un_refund_status_refund_id_refund_state on refund_status refund_status_waiting_refund_payment (cost=0.42..8.44 rows=1 width=31) (actual time=0.003..0.004 rows=1 loops=96,750)

  • Index Cond: ((refund_id = r.id) AND ((refund_state)::text = 'WAITING_REFUND_PAYMENT'::text))
164. 290.250 290.250 ↑ 1.0 1 96,750

Index Scan using idx_un_refund_status_refund_id_refund_state on refund_status refund_status_refunded (cost=0.42..8.44 rows=1 width=31) (actual time=0.003..0.003 rows=1 loops=96,750)

  • Index Cond: ((refund_id = r.id) AND ((refund_state)::text = 'REFUNDED'::text))
165. 483.750 483.750 ↓ 0.0 0 96,750

Index Scan using i18n_message_locale_code_key on i18n_message i18n (cost=0.28..2.30 rows=1 width=61) (actual time=0.005..0.005 rows=0 loops=96,750)

  • Index Cond: (((locale)::text = 'en-AU'::text) AND (code = (('Reason.'::text || (reason.code)::text) || '.label'::text)))
166. 677.250 677.250 ↑ 1.0 1 96,750

Index Scan using i18n_message_locale_code_key on i18n_message i18n_without_region (cost=0.28..2.33 rows=1 width=61) (actual time=0.006..0.007 rows=1 loops=96,750)

  • Index Cond: (((locale)::text = 'en'::text) AND (code = (('Reason.'::text || (reason.code)::text) || '.label'::text)))
167.          

SubPlan (forNested Loop Left Join)

168. 677.250 2,031.750 ↑ 1.0 1 96,750

Aggregate (cost=8.47..8.48 rows=1 width=39) (actual time=0.020..0.021 rows=1 loops=96,750)

169. 290.250 1,354.500 ↑ 1.0 1 96,750

Subquery Scan on order_line_commission_taxes (cost=8.45..8.46 rows=1 width=39) (actual time=0.012..0.014 rows=1 loops=96,750)

170. 483.750 1,064.250 ↑ 1.0 1 96,750

Sort (cost=8.45..8.45 rows=1 width=19) (actual time=0.010..0.011 rows=1 loops=96,750)

  • Sort Key: rct.sort_index
  • Sort Method: quicksort Memory: 25kB
171. 580.500 580.500 ↑ 1.0 1 96,750

Index Scan using idx_un_refund_commission_tax_refund_id_code on refund_commission_tax rct (cost=0.42..8.44 rows=1 width=19) (actual time=0.006..0.006 rows=1 loops=96,750)

  • Index Cond: (refund_id = r.id)
172. 290.250 580.500 ↑ 1.0 1 96,750

Aggregate (cost=8.44..8.45 rows=1 width=5) (actual time=0.006..0.006 rows=1 loops=96,750)

173. 290.250 290.250 ↑ 1.0 1 96,750

Index Scan using idx_un_refund_commission_tax_refund_id_code on refund_commission_tax rct_1 (cost=0.42..8.44 rows=1 width=5) (actual time=0.002..0.003 rows=1 loops=96,750)

  • Index Cond: (refund_id = r.id)
174. 193.500 774.000 ↑ 1.0 1 96,750

Aggregate (cost=8.20..8.21 rows=1 width=56) (actual time=0.008..0.008 rows=1 loops=96,750)

175. 193.500 580.500 ↓ 0.0 0 96,750

Subquery Scan on price_taxes (cost=8.18..8.19 rows=1 width=56) (actual time=0.006..0.006 rows=0 loops=96,750)

176. 193.500 387.000 ↓ 0.0 0 96,750

Sort (cost=8.18..8.18 rows=1 width=64) (actual time=0.004..0.004 rows=0 loops=96,750)

  • Sort Key: rta.code
  • Sort Method: quicksort Memory: 25kB
177. 193.500 193.500 ↓ 0.0 0 96,750

Index Scan using idx_refund_tax_amount_refund_id on refund_tax_amount rta (cost=0.14..8.17 rows=1 width=64) (actual time=0.002..0.002 rows=0 loops=96,750)

  • Index Cond: (refund_id = r.id)
  • Filter: ((type)::text = 'PRICE'::text)
178. 193.500 580.500 ↑ 1.0 1 96,750

Aggregate (cost=8.20..8.21 rows=1 width=56) (actual time=0.006..0.006 rows=1 loops=96,750)

179. 96.750 387.000 ↓ 0.0 0 96,750

Subquery Scan on shipping_price_taxes (cost=8.18..8.19 rows=1 width=56) (actual time=0.004..0.004 rows=0 loops=96,750)

180. 193.500 290.250 ↓ 0.0 0 96,750

Sort (cost=8.18..8.18 rows=1 width=64) (actual time=0.003..0.003 rows=0 loops=96,750)

  • Sort Key: rta_1.code
  • Sort Method: quicksort Memory: 25kB
181. 96.750 96.750 ↓ 0.0 0 96,750

Index Scan using idx_refund_tax_amount_refund_id on refund_tax_amount rta_1 (cost=0.14..8.17 rows=1 width=64) (actual time=0.001..0.001 rows=0 loops=96,750)

  • Index Cond: (refund_id = r.id)
  • Filter: ((type)::text = 'SHIPPING_PRICE'::text)
182. 6,345.974 22,210.909 ↑ 1.0 1 3,172,987

Aggregate (cost=8.20..8.21 rows=1 width=56) (actual time=0.006..0.007 rows=1 loops=3,172,987)

183. 3,172.987 15,864.935 ↓ 0.0 0 3,172,987

Subquery Scan on price_taxes_1 (cost=8.18..8.19 rows=1 width=56) (actual time=0.005..0.005 rows=0 loops=3,172,987)

184. 9,518.961 12,691.948 ↓ 0.0 0 3,172,987

Sort (cost=8.18..8.18 rows=1 width=64) (actual time=0.004..0.004 rows=0 loops=3,172,987)

  • Sort Key: olta.code
  • Sort Method: quicksort Memory: 25kB
185. 3,172.987 3,172.987 ↓ 0.0 0 3,172,987

Index Scan using idx_order_line_tax_amount_order_line_id on order_line_tax_amount olta (cost=0.14..8.17 rows=1 width=64) (actual time=0.001..0.001 rows=0 loops=3,172,987)

  • Index Cond: (order_line_id = ol.id)
  • Filter: ((type)::text = 'PRICE'::text)
186. 6,345.974 19,037.922 ↑ 1.0 1 3,172,987

Aggregate (cost=8.20..8.21 rows=1 width=56) (actual time=0.006..0.006 rows=1 loops=3,172,987)

187. 3,172.987 12,691.948 ↓ 0.0 0 3,172,987

Subquery Scan on shipping_price_taxes_1 (cost=8.18..8.19 rows=1 width=56) (actual time=0.004..0.004 rows=0 loops=3,172,987)

188. 6,345.974 9,518.961 ↓ 0.0 0 3,172,987

Sort (cost=8.18..8.18 rows=1 width=64) (actual time=0.003..0.003 rows=0 loops=3,172,987)

  • Sort Key: olta_1.code
  • Sort Method: quicksort Memory: 25kB
189. 3,172.987 3,172.987 ↓ 0.0 0 3,172,987

Index Scan using idx_order_line_tax_amount_order_line_id on order_line_tax_amount olta_1 (cost=0.14..8.17 rows=1 width=64) (actual time=0.001..0.001 rows=0 loops=3,172,987)

  • Index Cond: (order_line_id = ol.id)
  • Filter: ((type)::text = 'SHIPPING_PRICE'::text)
190. 22,210.909 57,113.766 ↑ 1.0 1 3,172,987

Aggregate (cost=8.49..8.50 rows=1 width=39) (actual time=0.017..0.018 rows=1 loops=3,172,987)

191. 9,518.961 34,902.857 ↑ 1.0 1 3,172,987

Subquery Scan on order_line_commission_taxes_1 (cost=8.46..8.48 rows=1 width=39) (actual time=0.010..0.011 rows=1 loops=3,172,987)

192. 9,518.961 25,383.896 ↑ 1.0 1 3,172,987

Sort (cost=8.46..8.47 rows=1 width=23) (actual time=0.008..0.008 rows=1 loops=3,172,987)

  • Sort Key: olct_1.sort_index
  • Sort Method: quicksort Memory: 25kB
193. 15,864.935 15,864.935 ↑ 1.0 1 3,172,987

Index Scan using idx_un_order_line_commission_tax_order_line_id_code on order_line_commission_tax olct_1 (cost=0.43..8.46 rows=1 width=23) (actual time=0.004..0.005 rows=1 loops=3,172,987)

  • Index Cond: (order_line_id = ol.id)
194. 57,113.766 57,113.766 ↑ 1.0 1 3,172,987

Index Scan using product_product_sku_key on product p (cost=0.56..8.57 rows=1 width=11) (actual time=0.017..0.018 rows=1 loops=3,172,987)

  • Index Cond: ((product_sku)::text = (ol.product_sku)::text)
195. 6,345.974 57,113.766 ↑ 1.0 1 3,172,987

Aggregate (cost=48.07..48.08 rows=1 width=61) (actual time=0.017..0.018 rows=1 loops=3,172,987)

196. 6,345.974 50,767.792 ↓ 0.0 0 3,172,987

Subquery Scan on cancelations (cost=48.05..48.06 rows=1 width=61) (actual time=0.016..0.016 rows=0 loops=3,172,987)

197. 9,518.961 44,421.818 ↓ 0.0 0 3,172,987

Sort (cost=48.05..48.05 rows=1 width=467) (actual time=0.014..0.014 rows=0 loops=3,172,987)

  • Sort Key: cancel.date_created
  • Sort Method: quicksort Memory: 25kB
198. 6,202.012 34,902.857 ↓ 0.0 0 3,172,987

Nested Loop Left Join (cost=8.88..48.04 rows=1 width=467) (actual time=0.011..0.011 rows=0 loops=3,172,987)

199. 6,331.284 28,556.883 ↓ 0.0 0 3,172,987

Nested Loop Left Join (cost=8.60..12.61 rows=1 width=432) (actual time=0.009..0.009 rows=0 loops=3,172,987)

200. 9,407.355 22,210.909 ↓ 0.0 0 3,172,987

Hash Join (cost=8.31..10.30 rows=1 width=397) (actual time=0.007..0.007 rows=0 loops=3,172,987)

  • Hash Cond: (reason_1.id = cancel.reason_id)
201. 111.606 111.606 ↑ 1.0 71 2,937

Seq Scan on reason reason_1 (cost=0.00..1.71 rows=71 width=19) (actual time=0.003..0.038 rows=71 loops=2,937)

202. 6,345.974 12,691.948 ↓ 0.0 0 3,172,987

Hash (cost=8.30..8.30 rows=1 width=394) (actual time=0.004..0.004 rows=0 loops=3,172,987)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
203. 6,345.974 6,345.974 ↓ 0.0 0 3,172,987

Index Scan using idx_cancelation_order_line_id on cancelation cancel (cost=0.29..8.30 rows=1 width=394) (actual time=0.002..0.002 rows=0 loops=3,172,987)

  • Index Cond: (order_line_id = ol.id)
204. 14.690 14.690 ↓ 0.0 0 2,938

Index Scan using i18n_message_locale_code_key on i18n_message i18n_1 (cost=0.28..2.30 rows=1 width=61) (actual time=0.005..0.005 rows=0 loops=2,938)

  • Index Cond: (((locale)::text = 'en-AU'::text) AND (code = (('Reason.'::text || (reason_1.code)::text) || '.label'::text)))
205. 23.504 23.504 ↑ 1.0 1 2,938

Index Scan using i18n_message_locale_code_key on i18n_message i18n_without_region_1 (cost=0.28..2.33 rows=1 width=61) (actual time=0.007..0.008 rows=1 loops=2,938)

  • Index Cond: (((locale)::text = 'en'::text) AND (code = (('Reason.'::text || (reason_1.code)::text) || '.label'::text)))
206.          

SubPlan (forNested Loop Left Join)

207. 17.628 58.760 ↑ 1.0 1 2,938

Aggregate (cost=8.34..8.35 rows=1 width=39) (actual time=0.020..0.020 rows=1 loops=2,938)

208. 11.752 41.132 ↑ 1.0 1 2,938

Subquery Scan on order_line_commission_taxes_2 (cost=8.31..8.33 rows=1 width=39) (actual time=0.012..0.014 rows=1 loops=2,938)

209. 11.752 29.380 ↑ 1.0 1 2,938

Sort (cost=8.31..8.32 rows=1 width=19) (actual time=0.010..0.010 rows=1 loops=2,938)

  • Sort Key: cct.sort_index
  • Sort Method: quicksort Memory: 25kB
210. 17.628 17.628 ↑ 1.0 1 2,938

Index Scan using idx_cancelation_commission_tax_cancelation_id on cancelation_commission_tax cct (cost=0.29..8.30 rows=1 width=19) (actual time=0.005..0.006 rows=1 loops=2,938)

  • Index Cond: (cancelation_id = cancel.id)
211. 8.814 17.628 ↑ 1.0 1 2,938

Aggregate (cost=8.31..8.32 rows=1 width=5) (actual time=0.006..0.006 rows=1 loops=2,938)

212. 8.814 8.814 ↑ 1.0 1 2,938

Index Scan using idx_cancelation_commission_tax_cancelation_id on cancelation_commission_tax cct_1 (cost=0.29..8.30 rows=1 width=5) (actual time=0.002..0.003 rows=1 loops=2,938)

  • Index Cond: (cancelation_id = cancel.id)
213. 5.876 23.504 ↑ 1.0 1 2,938

Aggregate (cost=8.20..8.21 rows=1 width=56) (actual time=0.007..0.008 rows=1 loops=2,938)

214. 5.876 17.628 ↓ 0.0 0 2,938

Subquery Scan on price_taxes_2 (cost=8.17..8.19 rows=1 width=56) (actual time=0.006..0.006 rows=0 loops=2,938)

215. 5.876 11.752 ↓ 0.0 0 2,938

Sort (cost=8.17..8.18 rows=1 width=64) (actual time=0.004..0.004 rows=0 loops=2,938)

  • Sort Key: cta.code
  • Sort Method: quicksort Memory: 25kB
216. 5.876 5.876 ↓ 0.0 0 2,938

Index Scan using idx_cancelation_tax_amount_cancelation_id on cancelation_tax_amount cta (cost=0.14..8.16 rows=1 width=64) (actual time=0.002..0.002 rows=0 loops=2,938)

  • Index Cond: (cancelation_id = cancel.id)
  • Filter: ((type)::text = 'PRICE'::text)
217. 5.876 20.566 ↑ 1.0 1 2,938

Aggregate (cost=8.20..8.21 rows=1 width=56) (actual time=0.006..0.007 rows=1 loops=2,938)

218. 5.876 14.690 ↓ 0.0 0 2,938

Subquery Scan on shipping_price_taxes_2 (cost=8.17..8.19 rows=1 width=56) (actual time=0.005..0.005 rows=0 loops=2,938)

219. 5.876 8.814 ↓ 0.0 0 2,938

Sort (cost=8.17..8.18 rows=1 width=64) (actual time=0.003..0.003 rows=0 loops=2,938)

  • Sort Key: cta_1.code
  • Sort Method: quicksort Memory: 25kB
220. 2.938 2.938 ↓ 0.0 0 2,938

Index Scan using idx_cancelation_tax_amount_cancelation_id on cancelation_tax_amount cta_1 (cost=0.14..8.16 rows=1 width=64) (actual time=0.001..0.001 rows=0 loops=2,938)

  • Index Cond: (cancelation_id = cancel.id)
  • Filter: ((type)::text = 'SHIPPING_PRICE'::text)
Planning time : 45.021 ms
Execution time : 1,461,429.353 ms