In case you have your own slow SQL query, you can optimize it automatically here.
For the query above, the following recommendations will be helpful as part of the SQL tuning process.
You'll find 3 sections below:
SELECT
topquery.kind_id,
topquery.image,
topquery.id,
userquery.user_name
FROM
`order` AS topquery,
`user` AS userquery
WHERE
userquery.user_id = topquery.user_id
AND topquery.id IN (
SELECT
MIN(mainquery.id)
FROM
`order` AS mainquery
WHERE
mainquery.user_id != '$vUserId'
AND mainquery.id NOT IN (
SELECT
history.order_id
FROM
history
WHERE
history.user_id = '$vUserId'
)
AND mainquery.kind_id NOT IN (
SELECT
o.kind_id
FROM
history h
INNER JOIN
`order` o
ON h.order_id = o.id
WHERE
h.user_id = '$vUserId'
)
AND mainquery.actions > 0
AND mainquery.kind = '1'
GROUP BY
mainquery.kind_id
ORDER BY
NULL)
ORDER BY
vip DESC LIMIT 35