> This should be relatively fast if your indexes are set up correctly. That's a very good point. If you haven't indexed the table, try this:
ALTER TABLE login_logs ADD INDEX (created) For the benefit of anyone who hasn't discovered the joys of indexing yet, this essentially makes an alphabetised (or, in this case, chronological) copy of that particular column, so that any query that needs to find the MIN or MAX creation date will be sped up a lot. I only recently discovered the benefits of indexing, and it's amazing how much faster it makes queries. I got some down from about 30 seconds to around about 0.5 seconds. As a rule of thumb, try indexing any column that appears in lots of queries in there WHERE, GROUP BY or HAVING section at the end. (If it's only being SELECTED but isn't a condition or thing being grouped, you don't need to index it as it's not being pulled out in order, so having a quick ordered reference won't speed anything up.) Hope that helps, and sorry for the off-topic RDBMS advice everyone else! Zoe. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---