On 19 Nov 2008, at 11:46, Günther Lackner wrote: >> If you just want to count items then use DeviceToUpdate.count ... > > You mean like this? > > count = DeviceToUpdate.count(:conditions => ["status like 'moreinfo' > and > CLIENT_STATUS is NULL and CLASS like ?",asset_class ] )
Also keep in mind that in MySQL InnoDB "like" searches are unindexed and notoriously slow in the first place. Compare it to having the find the number of occurrences of the word "rails" in a book. One book offers no index at the back of the book, so you have to manually go over every page finding the word (MySQL LIKE search), while the other does have one and you only need to count the pages it appears on listed next to it (Fulltext indexer) Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

