Hi,
Which one of the following query will be faster in terms of performance,
1) select * from html
where Title\Description\Keywords\Body likep $query
and (ProductId in ($prod))
Then display the results.
If there are 100 rows in the table, then $prod will not be less than 90. (meaning, it will almost be a full table scan with an extra overhead in the query)
OR
2) select * from html
where Title\Description\Keywords\Body likep $query
Then display the results after filtering out only those results which belong to $prod.
My guess is, the 2nd query will be better (without any overhead). I hope I am able to explain what I mean.
Regards,
Which one of the following query will be faster in terms of performance,
1) select * from html
where Title\Description\Keywords\Body likep $query
and (ProductId in ($prod))
Then display the results.
If there are 100 rows in the table, then $prod will not be less than 90. (meaning, it will almost be a full table scan with an extra overhead in the query)
OR
2) select * from html
where Title\Description\Keywords\Body likep $query
Then display the results after filtering out only those results which belong to $prod.
My guess is, the 2nd query will be better (without any overhead). I hope I am able to explain what I mean.
Regards,