RE: LIMIT and get_num_rows

From: Date: Mon, 14 Jan 2002 14:00:43 +0000
Subject: RE: LIMIT and get_num_rows
Groups: php.db 
Request: Send a blank email to php-db+get-15763@lists.php.net to get a copy of this message
but presumably if i'm doing a SELECT count(*) FROM Designs WHERE Keywords LIKE "%sport%" followed by a SELECT * FROM Designs WHERE Keywords LIKE "%sport%" LIMIT 0,20 it's still using nearly as much processing time as just returning all the designs and just using a get_num_rows and then only using the first 20?
I absolutely think it will not. After all, the table record count should be able to reference the index, (you are running this query against an indexed 'Keywords' column yes?), while assembling the table of returned data will take quite a bit more memory, which is what you're really trying to cut down, I think. Cheers, -Peter

« previous php.db (#15763) next »