Jump to content

Query Optimization


anu123

Recommended Posts

Hi

 

I have a query

 

SELECT * FROM table1 AS a WHERE a.user_id NOT IN (SELECT c.user_id FROM table2 AS c) and (a.sentby = ‘S’ or a. sentby =’B’ or a. sentby = ‘R’)

 

This was running fine when the number of users in the site was less, but as the user number increased, the the query is taking too much time to run. Can anyone help me with how to optimize this query so that, the site wont get slow

 

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/140905-query-optimization/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.