kickstart Posted April 22, 2009 Author Share Posted April 22, 2009 Hi You would hope that it would optimise it, but never certain. Generally understood LIKE to be pretty inefficient and as such something to be used with care. All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/154354-solved-unique-records-on-a-union/page/2/#findComment-816674 Share on other sites More sharing options...
fenway Posted April 22, 2009 Share Posted April 22, 2009 Generally understood LIKE to be pretty inefficient and as such something to be used with care. It is -- in the WHERE clause -- but you're already paid that performance penalty. And as mentioned earlier, drop UPPER() unless you've explicitly requested a case-sensitive collation. Quote Link to comment https://forums.phpfreaks.com/topic/154354-solved-unique-records-on-a-union/page/2/#findComment-816810 Share on other sites More sharing options...
kickstart Posted April 23, 2009 Author Share Posted April 23, 2009 It is -- in the WHERE clause -- but you're already paid that performance penalty. Only if the db recognises that the LIKE clauses are duplicated and doesn't carry them out twice, which is why I wanted to try the "having" so that there was no way for it to do them twice. All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/154354-solved-unique-records-on-a-union/page/2/#findComment-817153 Share on other sites More sharing options...
fenway Posted April 23, 2009 Share Posted April 23, 2009 Yes, but even if it doesn't, the LIKE clauses in the column list are evaluated on a limited recordset (i.e. the matching rows), so it's neglible. Quote Link to comment https://forums.phpfreaks.com/topic/154354-solved-unique-records-on-a-union/page/2/#findComment-817287 Share on other sites More sharing options...
kickstart Posted April 23, 2009 Author Share Posted April 23, 2009 Yep, but worth playing with to try out. All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/154354-solved-unique-records-on-a-union/page/2/#findComment-817304 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.