Welcome Guest, Not a member yet? Register   Sign In
Active Record: COUNT WHERE?
#5

[eluser]Jay Callicott[/eluser]
The problem with num rows is that it runs the full query and then just returns how many rows were returned. When the query is complex and slow like one I'm working on which has math calculations and a bunch of joins and having clauses then my count query gets way too slow.

The best way I guess is to run a SELECT COUNT(something) from (QUERY) as tbl1 but then you're having to do a custom query and that's a pain. I wish there was some function I could create but I'm not sure there is.


Messages In This Thread
Active Record: COUNT WHERE? - by El Forum - 09-04-2007, 10:36 PM
Active Record: COUNT WHERE? - by El Forum - 09-05-2007, 12:00 AM
Active Record: COUNT WHERE? - by El Forum - 09-05-2007, 12:50 AM
Active Record: COUNT WHERE? - by El Forum - 09-05-2007, 06:43 AM
Active Record: COUNT WHERE? - by El Forum - 09-20-2007, 03:37 PM
Active Record: COUNT WHERE? - by El Forum - 09-20-2007, 03:51 PM
Active Record: COUNT WHERE? - by El Forum - 09-21-2007, 08:51 AM
Active Record: COUNT WHERE? - by El Forum - 09-21-2007, 05:07 PM
Active Record: COUNT WHERE? - by El Forum - 11-05-2007, 08:00 PM
Active Record: COUNT WHERE? - by El Forum - 12-18-2007, 08:50 AM
Active Record: COUNT WHERE? - by El Forum - 12-30-2008, 10:57 PM
Active Record: COUNT WHERE? - by El Forum - 05-21-2010, 11:47 PM
Active Record: COUNT WHERE? - by El Forum - 01-18-2012, 11:07 PM
Active Record: COUNT WHERE? - by El Forum - 03-03-2013, 09:21 PM



Theme © iAndrew 2016 - Forum software by © MyBB