Welcome Guest, Not a member yet? Register   Sign In
Performance Codeigniter, + 2 million records.
#13

(This post was last modified: 08-14-2021, 09:08 AM by php_rocs.)

@[email protected] ,

Wow!! you only have one index on this table and the field that is indexed isn't even used in your query. Here is a good read on indexes in MySQL (https://dev.mysql.com/doc/refman/8.0/en/...dexes.html). Based on how you will be searching this table (now and into the future) I would definitely add indexes to this table. One warning...every field in a table doesn't require an index this is why it is necessary to determine which fields should have an index. Indexes can slow your queries down. Based on the information that you have given us in this thread these are the fields that I would index: ID, CREATEDAT, UPDATEDAT, CONNECTTIME and UID.

Also, what is the difference of time between the two queries (before and after adding the indexes)? Also after you add the indexes run the EXPLAIN on your queries again and see the difference.
Reply


Messages In This Thread
RE: Performance Codeigniter, + 2 million records. - by php_rocs - 08-14-2021, 09:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB