Welcome Guest, Not a member yet? Register   Sign In
Is this bad sql to count total for pagination? (CI3-dev)
#2

[eluser]treenef[/eluser]
You should always optimize your queries if you CAN by doing a limit. An example, would be selecting a password for a userid. Do a limit(1) as there should only be one row returned.

Additionally, avoid using $this->db->select('*') where you can.

Unfortunately, if you don't know how many rows are to be returned you can't do much about it, as if you try and limit your query you might miss important data.

Hope that helped.


Messages In This Thread
Is this bad sql to count total for pagination? (CI3-dev) - by El Forum - 06-20-2014, 04:49 PM



Theme © iAndrew 2016 - Forum software by © MyBB