title: Mysql - inner join with or condition taking long time mysql
body: <p>Need help with MySQL query.</p>
  <p>I have indexed mandatory columns but still getting results in 160 seconds.</p>
  <p>I know I have a problem with Contact conditions without it results are coming in 15s.</p>
  <p>Any kind of help is appreciated.</p>
  <p>My Query is :</p>
  <pre><code> SELECT `order`.invoicenumber, `order`.lastupdated_by AS processed_by, `order`.lastupdated_date AS LastUpdated_date, 
      `trans`.transaction_id AS trans_id, 
      GROUP_CONCAT(`trans`.subscription_id) AS subscription_id, 
      GROUP_CONCAT(`trans`.price) AS trans_price, 
      GROUP_CONCAT(`trans`.quantity) AS prod_quantity, 
      `user`.id AS id, `user`.businessname AS businessname, 
      `user`.given_name AS given_name, `user`.surname AS surname
      FROM cdp_order_transaction_master AS `order` 
      INNER JOIN `cdp_order_transaction_detail` AS trans ON `order`.transaction_id=trans.transaction_id 
      INNER JOIN cdp_user AS user ON (`order`.user_id=user.id OR CONCAT( user.id , '_CDP' ) = `order`.lastupdated_by)
      WHERE `order`.xero_invoice_status='Completed' AND `order`.order_date &gt; '2021-01-01' 
      GROUP BY `order`.transaction_id 
      ORDER BY `order`.lastupdated_date 
      DESC LIMIT 100
  </code></pre>