mysql - Find if there is a line on table : count or first? -
i wish optimizations on sql queries. without doing performance test it, query time-consuming ? sure return same result.
!myclass.find(:first, :conditions => c).nil?myclass.count(:conditions => c) > 0myclass.count(:conditions => c, :limit => 1) > 0
regards
you can test own. writing performance test less 15 lines of code. more information:
Comments
Post a Comment