My query returns empty results with big tables. Any advice? |
I have never had problems with CI so far, but yesterday I started a project in which I have to handle big amounts of data, the database has approximately 10m rows on several tables and I'm struggling with a simple search function
My controller looks something like this. Its need to retrieve the username of the user by entering the email, ID or viceversa: PHP Code: public function username_finder() { The finder_engine on my model: PHP Code: public function finder_engine($input_string, $type) { My members table looks like this: id | username | email | id_number | password When I run this on the members table (10m rows) it returns and empty string. I have tried with different versions but it always returns an empty array: Code: if ($type == 'email') { I duplicated the table and cut it off to 25000 rows, still empty, but when I run the same queries on the same table with 5000 records it returns the values perfectly. I guess this is a problem with the memory or with the execution time, but I have no idea. How can I approach this properly? What are good measures for CI regarding handling this amount of data? Thanks a lot in advance! |
Welcome Guest, Not a member yet? Register Sign In |