Why Low Performance when Accessing POS Reports or Scan Barcode when Adjust/Stocktaking

Identification

Sometimes you can feel a significant slow or infinity loading screen when accessing one of these features

  1. You are using MariaDB 10.4.x

  2. Access Report Stock Value, Stock Detail, Stock by Source

3. Scan barcode when Stocktaking

 

Reason

MariaDB 10.4 has changed something in their engine and the default variables configuration which resulted in low performance in Magento Indexes and also some POS functions

Solving

  1. Changing MariaDB to a lower minor version like: 10.3.x or even lower (not recommended)

  2. Changing these 2 MariaDB Variables as below
    - optimizer_switch='rowid_filter=off'
    - optimizer_use_condition_selectivity = 1
    Reference: Magento Bess Practices