SELECT 
  SQL_CALC_FOUND_ROWS products.product_id, 
  descr1.product as product, 
  companies.company as company_name, 
  products.product_type, 
  products.parent_product_id, 
  descr1.full_description as full_description 
FROM 
  cscart_products as products 
  LEFT JOIN cscart_product_descriptions as descr1 ON descr1.product_id = products.product_id 
  AND descr1.lang_code = 'en' 
  LEFT JOIN cscart_product_prices as prices ON prices.product_id = products.product_id 
  AND prices.lower_limit = 1 
  LEFT JOIN cscart_companies AS companies ON companies.company_id = products.company_id 
  INNER JOIN cscart_products_categories as products_categories ON products_categories.product_id = products.product_id 
  INNER JOIN cscart_categories ON cscart_categories.category_id = products_categories.category_id 
  AND (
    cscart_categories.usergroup_ids = '' 
    OR FIND_IN_SET(
      0, cscart_categories.usergroup_ids
    ) 
    OR FIND_IN_SET(
      1, cscart_categories.usergroup_ids
    )
  ) 
  AND cscart_categories.status IN ('A', 'H') 
  AND cscart_categories.storefront_id IN (0, 1) 
WHERE 
  1 
  AND companies.status IN ('A') 
  AND (
    products.usergroup_ids = '' 
    OR FIND_IN_SET(0, products.usergroup_ids) 
    OR FIND_IN_SET(1, products.usergroup_ids)
  ) 
  AND products.status IN ('A') 
  AND prices.usergroup_id IN (0, 0, 1) 
  AND products.parent_product_id = 0 
  AND products.product_type != 'D' 
GROUP BY 
  products.product_id 
ORDER BY 
  products.timestamp desc, 
  products.product_id ASC 
LIMIT 
  0, 32

Query time 0.00868

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "43.47"
    },
    "ordering_operation": {
      "using_filesort": true,
      "grouping_operation": {
        "using_temporary_table": true,
        "using_filesort": false,
        "nested_loop": [
          {
            "table": {
              "table_name": "companies",
              "access_type": "ALL",
              "possible_keys": [
                "PRIMARY"
              ],
              "rows_examined_per_scan": 5,
              "rows_produced_per_join": 1,
              "filtered": "20.00",
              "cost_info": {
                "read_cost": "2.98",
                "eval_cost": "0.20",
                "prefix_cost": "3.18",
                "data_read_per_join": "6K"
              },
              "used_columns": [
                "company_id",
                "status",
                "company"
              ],
              "attached_condition": "(`pankajecarter_systemfour`.`companies`.`status` = 'A')"
            }
          },
          {
            "table": {
              "table_name": "cscart_categories",
              "access_type": "ALL",
              "possible_keys": [
                "PRIMARY",
                "c_status",
                "p_category_id"
              ],
              "rows_examined_per_scan": 84,
              "rows_produced_per_join": 3,
              "filtered": "4.00",
              "using_join_buffer": "Block Nested Loop",
              "cost_info": {
                "read_cost": "19.59",
                "eval_cost": "0.67",
                "prefix_cost": "23.44",
                "data_read_per_join": "8K"
              },
              "used_columns": [
                "category_id",
                "storefront_id",
                "usergroup_ids",
                "status"
              ],
              "attached_condition": "(((`pankajecarter_systemfour`.`cscart_categories`.`usergroup_ids` = '') or find_in_set(0,`pankajecarter_systemfour`.`cscart_categories`.`usergroup_ids`) or find_in_set(1,`pankajecarter_systemfour`.`cscart_categories`.`usergroup_ids`)) and (`pankajecarter_systemfour`.`cscart_categories`.`status` in ('A','H')) and (`pankajecarter_systemfour`.`cscart_categories`.`storefront_id` in (0,1)))"
            }
          },
          {
            "table": {
              "table_name": "products_categories",
              "access_type": "ref",
              "possible_keys": [
                "PRIMARY",
                "pt"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "category_id"
              ],
              "key_length": "3",
              "ref": [
                "pankajecarter_systemfour.cscart_categories.category_id"
              ],
              "rows_examined_per_scan": 3,
              "rows_produced_per_join": 10,
              "filtered": "100.00",
              "using_index": true,
              "cost_info": {
                "read_cost": "3.61",
                "eval_cost": "2.02",
                "prefix_cost": "29.06",
                "data_read_per_join": "161"
              },
              "used_columns": [
                "product_id",
                "category_id"
              ]
            }
          },
          {
            "table": {
              "table_name": "products",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY",
                "status",
                "idx_parent_product_id"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "product_id"
              ],
              "key_length": "3",
              "ref": [
                "pankajecarter_systemfour.products_categories.product_id"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 0,
              "filtered": "7.93",
              "cost_info": {
                "read_cost": "10.08",
                "eval_cost": "0.16",
                "prefix_cost": "41.16",
                "data_read_per_join": "3K"
              },
              "used_columns": [
                "product_id",
                "product_type",
                "status",
                "company_id",
                "timestamp",
                "usergroup_ids",
                "parent_product_id"
              ],
              "attached_condition": "((`pankajecarter_systemfour`.`products`.`company_id` = `pankajecarter_systemfour`.`companies`.`company_id`) and (`pankajecarter_systemfour`.`products`.`parent_product_id` = 0) and ((`pankajecarter_systemfour`.`products`.`usergroup_ids` = '') or find_in_set(0,`pankajecarter_systemfour`.`products`.`usergroup_ids`) or find_in_set(1,`pankajecarter_systemfour`.`products`.`usergroup_ids`)) and (`pankajecarter_systemfour`.`products`.`status` = 'A') and (`pankajecarter_systemfour`.`products`.`product_type` <> 'D'))"
            }
          },
          {
            "table": {
              "table_name": "descr1",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY",
                "product_id"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "product_id",
                "lang_code"
              ],
              "key_length": "9",
              "ref": [
                "pankajecarter_systemfour.products_categories.product_id",
                "const"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 0,
              "filtered": "100.00",
              "cost_info": {
                "read_cost": "0.80",
                "eval_cost": "0.16",
                "prefix_cost": "42.12",
                "data_read_per_join": "3K"
              },
              "used_columns": [
                "product_id",
                "lang_code",
                "product",
                "full_description"
              ]
            }
          },
          {
            "table": {
              "table_name": "prices",
              "access_type": "ref",
              "possible_keys": [
                "usergroup",
                "product_id",
                "lower_limit",
                "usergroup_id"
              ],
              "key": "usergroup",
              "used_key_parts": [
                "product_id"
              ],
              "key_length": "3",
              "ref": [
                "pankajecarter_systemfour.products_categories.product_id"
              ],
              "rows_examined_per_scan": 3,
              "rows_produced_per_join": 2,
              "filtered": "97.92",
              "using_index": true,
              "cost_info": {
                "read_cost": "0.87",
                "eval_cost": "0.47",
                "prefix_cost": "43.47",
                "data_read_per_join": "56"
              },
              "used_columns": [
                "product_id",
                "lower_limit",
                "usergroup_id"
              ],
              "attached_condition": "((`pankajecarter_systemfour`.`prices`.`lower_limit` = 1) and (`pankajecarter_systemfour`.`prices`.`usergroup_id` in (0,0,1)))"
            }
          }
        ]
      }
    }
  }
}

Result

product_id product company_name product_type parent_product_id full_description
453 65" Class (64.5" Diag.) LED 8000 Series Smart TV CS-Cart P 0 <p> For the ultimate TV enthusiasts, incredible picture quality and advanced connectivity are just the first step; the Samsung UN65D8000 LED TV goes a step beyond, adding elegant design to the formula. On the commanding 65-inch screen you can enjoy Samsung' Smart TV, which puts the web, a wide range of apps, Skype video calling, and plenty more at your fingertips. Or connect a Blu-ray 3D player to get immersed in cinema-quality 3D programming--two pairs of active glasses are included. </p>
454 65" Class (64.5" Diag.) LED 8000 Series Smart TV CS-Cart P 0 <p> For the ultimate TV enthusiasts, incredible picture quality and advanced connectivity are just the first step; the Samsung UN65D8000 LED TV goes a step beyond, adding elegant design to the formula. On the commanding 65-inch screen you can enjoy Samsung' Smart TV, which puts the web, a wide range of apps, Skype video calling, and plenty more at your fingertips. Or connect a Blu-ray 3D player to get immersed in cinema-quality 3D programming--two pairs of active glasses are included. </p>
455 65" Class (64.5" Diag.) LED 8000 Series Smart TV CS-Cart P 0 <p> For the ultimate TV enthusiasts, incredible picture quality and advanced connectivity are just the first step; the Samsung UN65D8000 LED TV goes a step beyond, adding elegant design to the formula. On the commanding 65-inch screen you can enjoy Samsung' Smart TV, which puts the web, a wide range of apps, Skype video calling, and plenty more at your fingertips. Or connect a Blu-ray 3D player to get immersed in cinema-quality 3D programming--two pairs of active glasses are included. </p>
450 65" Class (64.5" Diag.) LED 8000 Series Smart TV CS-Cart P 0 <p> For the ultimate TV enthusiasts, incredible picture quality and advanced connectivity are just the first step; the Samsung UN65D8000 LED TV goes a step beyond, adding elegant design to the formula. On the commanding 65-inch screen you can enjoy Samsung' Smart TV, which puts the web, a wide range of apps, Skype video calling, and plenty more at your fingertips. Or connect a Blu-ray 3D player to get immersed in cinema-quality 3D programming--two pairs of active glasses are included. </p>
451 65" Class (64.5" Diag.) LED 8000 Series Smart TV CS-Cart P 0 <p> For the ultimate TV enthusiasts, incredible picture quality and advanced connectivity are just the first step; the Samsung UN65D8000 LED TV goes a step beyond, adding elegant design to the formula. On the commanding 65-inch screen you can enjoy Samsung' Smart TV, which puts the web, a wide range of apps, Skype video calling, and plenty more at your fingertips. Or connect a Blu-ray 3D player to get immersed in cinema-quality 3D programming--two pairs of active glasses are included. </p>
452 65" Class (64.5" Diag.) LED 8000 Series Smart TV CS-Cart P 0 <p> For the ultimate TV enthusiasts, incredible picture quality and advanced connectivity are just the first step; the Samsung UN65D8000 LED TV goes a step beyond, adding elegant design to the formula. On the commanding 65-inch screen you can enjoy Samsung' Smart TV, which puts the web, a wide range of apps, Skype video calling, and plenty more at your fingertips. Or connect a Blu-ray 3D player to get immersed in cinema-quality 3D programming--two pairs of active glasses are included. </p>
435 2011 Ice Queen CS-Cart P 0 <p>Hydration Capacity: 70 oz (2 L)<br><br>Total Capacity: 1000 cu in (16.39 L)<br><br>CamelBak®Got Your Bak&trade; Guarantee: If we built it, we'll Bak it&trade; with our lifetime guarantee. <br><br>Reservoir Features: 1/4 turn - easy open/close cap, lightweight fillport, dryer arms, center baffling and low-profile design, patented Big Bite&trade; Valve, HydroGuard&trade; technology, insulated PureFlow&trade; tube, easy-to-clean wide-mouth opening<br><br>BACK PANEL: Snowshed&trade;<br><br>HARNESS: S-Curved Women's Harness; Therminator&trade; provides easy access for frequent sipping, insulated and fully enclosed to protect against freezing<br><br>BELT: Removable 1" (25 mm) stability<br><br>Additional Features: <br>Tri-Zip design allows easy access to all your gear, compresion, goggle pocket, essentials pocket<br><br>Designed to carry: Helmet, goggles, extra layers, lunch, phone, wallet, keys</p>
439 2011 Ice Queen CS-Cart P 0 <p>Hydration Capacity: 70 oz (2 L)<br><br>Total Capacity: 1000 cu in (16.39 L)<br><br>CamelBak®Got Your Bak&trade; Guarantee: If we built it, we'll Bak it&trade; with our lifetime guarantee. <br><br>Reservoir Features: 1/4 turn - easy open/close cap, lightweight fillport, dryer arms, center baffling and low-profile design, patented Big Bite&trade; Valve, HydroGuard&trade; technology, insulated PureFlow&trade; tube, easy-to-clean wide-mouth opening<br><br>BACK PANEL: Snowshed&trade;<br><br>HARNESS: S-Curved Women's Harness; Therminator&trade; provides easy access for frequent sipping, insulated and fully enclosed to protect against freezing<br><br>BELT: Removable 1" (25 mm) stability<br><br>Additional Features: <br>Tri-Zip design allows easy access to all your gear, compresion, goggle pocket, essentials pocket<br><br>Designed to carry: Helmet, goggles, extra layers, lunch, phone, wallet, keys</p>
443 2011 Ice Queen CS-Cart P 0 <p>Hydration Capacity: 70 oz (2 L)<br><br>Total Capacity: 1000 cu in (16.39 L)<br><br>CamelBak®Got Your Bak&trade; Guarantee: If we built it, we'll Bak it&trade; with our lifetime guarantee. <br><br>Reservoir Features: 1/4 turn - easy open/close cap, lightweight fillport, dryer arms, center baffling and low-profile design, patented Big Bite&trade; Valve, HydroGuard&trade; technology, insulated PureFlow&trade; tube, easy-to-clean wide-mouth opening<br><br>BACK PANEL: Snowshed&trade;<br><br>HARNESS: S-Curved Women's Harness; Therminator&trade; provides easy access for frequent sipping, insulated and fully enclosed to protect against freezing<br><br>BELT: Removable 1" (25 mm) stability<br><br>Additional Features: <br>Tri-Zip design allows easy access to all your gear, compresion, goggle pocket, essentials pocket<br><br>Designed to carry: Helmet, goggles, extra layers, lunch, phone, wallet, keys</p>
430 2011 Tycoon CS-Cart P 0 <p>Hydration Capacity: 100 oz (3 L)<br /><br />Total Capacity: 1125 cu in (18.44 L)<br /><br />CamelBak&reg; Got Your Bak&trade; Guarantee: If we built it, we'll Bak it&trade; with our lifetime guarantee. <br /><br />Reservoir Features: Quick Link&trade; System, 1/4 turn - easy open/close cap, lightweight fillport, dryer arms, center baffling and low-profile design, patented Big Bite&trade; Valve, HydroGuard&trade; technology, insulated PureFlow&trade; tube, easy-to-clean wide-mouth opening<br /><br />BACK PANEL: Snowshed&trade;<br /><br />HARNESS: Therminator&trade; provides easy access for frequent sipping, insulated and fully enclosed to protect against freezing<br /><br />BELT: Load-bearing<br /><br />Additional Features: <br />Snowboard / Ski Carry (Diagonal, Vertical or Horizontal), pack compression, goggle pocket, essentials pocket<br />Drop-out Probe Pocket for instant probe access -- locate survivors without unloading your pack<br /><br />Designed to carry: skis/snowboard, shovel, probe, skins or snowshoes, goggles, extra layer, snack, phone, wallet, keys</p>
429 2011 Tycoon CS-Cart P 0 <p>Hydration Capacity: 100 oz (3 L)<br /><br />Total Capacity: 1125 cu in (18.44 L)<br /><br />CamelBak&reg; Got Your Bak&trade; Guarantee: If we built it, we'll Bak it&trade; with our lifetime guarantee. <br /><br />Reservoir Features: Quick Link&trade; System, 1/4 turn - easy open/close cap, lightweight fillport, dryer arms, center baffling and low-profile design, patented Big Bite&trade; Valve, HydroGuard&trade; technology, insulated PureFlow&trade; tube, easy-to-clean wide-mouth opening<br /><br />BACK PANEL: Snowshed&trade;<br /><br />HARNESS: Therminator&trade; provides easy access for frequent sipping, insulated and fully enclosed to protect against freezing<br /><br />BELT: Load-bearing<br /><br />Additional Features: <br />Snowboard / Ski Carry (Diagonal, Vertical or Horizontal), pack compression, goggle pocket, essentials pocket<br />Drop-out Probe Pocket for instant probe access -- locate survivors without unloading your pack<br /><br />Designed to carry: skis/snowboard, shovel, probe, skins or snowshoes, goggles, extra layer, snack, phone, wallet, keys</p>
428 46" Class (45.9" Diag.) LCD 610 Series TV CS-Cart P 0 <p> ConnectShare™ Movie lets you watch videos, play music or view photos from a USB drive. Simply plug your USB directly into your Samsung TV’s USB port and watch on the big screen with friends and family. </p>
415 test123 CS-Cart P 0
416 test123 CS-Cart P 0
417 test123 CS-Cart P 0
418 test123 CS-Cart P 0
419 test123 CS-Cart P 0
420 test123 CS-Cart P 0
421 test123 CS-Cart P 0
422 test123 CS-Cart P 0
423 test123 CS-Cart P 0
424 test123 CS-Cart P 0
425 test123 CS-Cart P 0
426 test123 CS-Cart P 0
403 test123 CS-Cart P 0
404 test123 CS-Cart P 0
405 test123 CS-Cart P 0
406 test123 CS-Cart P 0
407 test123 CS-Cart P 0
408 test123 CS-Cart P 0
409 test123 CS-Cart P 0
410 test123 CS-Cart P 0