SELECT 
  * 
FROM 
  cscart_bm_locations as l 
  LEFT JOIN cscart_bm_locations_descriptions as d ON d.location_id = l.location_id 
  AND d.lang_code = 'en' 
WHERE 
  l.layout_id = 2 
  AND l.dispatch IN ('pages.view?page_type=B') 
  AND (
    FIND_IN_SET(101, l.object_ids) 
    OR l.object_ids = ''
  ) 
ORDER BY 
  l.object_ids desc 
LIMIT 
  1

Query time 0.00040

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "14.37"
    },
    "ordering_operation": {
      "using_filesort": true,
      "cost_info": {
        "sort_cost": "1.00"
      },
      "nested_loop": [
        {
          "table": {
            "table_name": "l",
            "access_type": "ALL",
            "rows_examined_per_scan": 86,
            "rows_produced_per_join": 0,
            "filtered": "1.16",
            "cost_info": {
              "read_cost": "12.92",
              "eval_cost": "0.10",
              "prefix_cost": "13.02",
              "data_read_per_join": "231"
            },
            "used_columns": [
              "location_id",
              "dispatch",
              "is_default",
              "layout_id",
              "object_ids",
              "custom_html",
              "position"
            ],
            "attached_condition": "((`wearethehelpful_scalesta_net`.`l`.`layout_id` = 2) and (`wearethehelpful_scalesta_net`.`l`.`dispatch` = 'pages.view?page_type=B') and ((0 <> find_in_set(101,`wearethehelpful_scalesta_net`.`l`.`object_ids`)) or (`wearethehelpful_scalesta_net`.`l`.`object_ids` = '')))"
          }
        },
        {
          "table": {
            "table_name": "d",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "location_id",
              "lang_code"
            ],
            "key_length": "10",
            "ref": [
              "wearethehelpful_scalesta_net.l.location_id",
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 0,
            "filtered": "100.00",
            "index_condition": "<if>(is_not_null_compl(d), (`wearethehelpful_scalesta_net`.`d`.`location_id` = `wearethehelpful_scalesta_net`.`l`.`location_id`), true)",
            "cost_info": {
              "read_cost": "0.25",
              "eval_cost": "0.10",
              "prefix_cost": "13.37",
              "data_read_per_join": "239"
            },
            "used_columns": [
              "location_id",
              "lang_code",
              "name",
              "title",
              "meta_description",
              "meta_keywords"
            ]
          }
        }
      ]
    }
  }
}

Result

location_id dispatch is_default layout_id object_ids custom_html position lang_code name title meta_description meta_keywords
36 pages.view?page_type=B 0 2 <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-47N6MDZG2E"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-47N6MDZG2E'); </script> <script> (function(w, d, t, h, s, n) { w.FlodeskObject = n; var fn = function() { (w[n].q = w[n].q || []).push(arguments); }; w[n] = w[n] || fn; var f = d.getElementsByTagName(t)[0]; var v = '?v=' + Math.floor(new Date().getTime() / (120 * 1000)) * 60; var sm = d.createElement(t); sm.async = true; sm.type = 'module'; sm.src = h + s + '.mjs' + v; f.parentNode.insertBefore(sm, f); var sn = d.createElement(t); sn.async = true; sn.noModule = true; sn.src = h + s + '.js' + v; f.parentNode.insertBefore(sn, f); })(window, document, 'script', 'https://assets.flodesk.com', '/universal', 'fd'); </script> <script> window.fd('form', { formId: '66bcb6d832d586ef1ff79130' }); </script> <style>.ff-66bcc4b353d124a83cc7f773__title{display:none!important;} #fd-form-66bcc4b353d124a83cc7f773 {margin-top:-3em!important;}</style> 170 en The Journal The Journal | Meaningful Gifting, Self-Care & Real-Life Insights by We Are The Helpful Explore The Journal by We Are The Helpful - your UK guide to meaningful gifting, self-care and connection. From grief to new beginnings, motherhood to midlife, discover thoughtful ways to show up for real life. helpful gifts UK, meaningful gifts, self-care UK, grief gifts, new beginnings, motherhood support