1

Which query is more performant

User.joins('addresses').having("GROUP_CONCAT( DISTINCT addresses.status) REGEXP ?", '^approved$|^rejected$|^pending$')

OR

 User.joins('addresses').having("GROUP_CONCAT( DISTINCT addresses.status) in ('approved','rejected','pending')")
Ross
  • 1,562
  • 1
  • 15
  • 26
  • take a look at explain plan .. – ScaisEdge Jul 16 '16 at 14:56
  • Can you write out the whole queries? Makes it easier to read and adds focus on the actual topic – Philipp Jul 16 '16 at 15:03
  • Take a look at performance. Explain plan won't prove a ton. If you think that is not the case, look at the answer [here](http://stackoverflow.com/a/38189113). Same explain plans different performances – Drew Jul 16 '16 at 15:05
  • By the way, the `in` clause can be a speed demon if setup properly http://stackoverflow.com/a/38002986 – Drew Jul 16 '16 at 15:15

0 Answers0