Welcome Guest, Not a member yet? Register   Sign In
Ability to specify index for query build from
#8

(06-02-2016, 08:38 AM)mwhitney Wrote: Something like "use index" should be extremely rare in your queries, because it indicates that somehow you've found a situation in which your database engine is doing it wrong. In most cases, you would be better off optimizing your query or adding another index.
That's how I found it - my $this->db->count_all() queries were taking way longer than before after I converted my DB from MYISAM to InnoDB leading me to write my own queries. Since I didn't like to hard-code them I needed a way to specify an index in the $this->db->from() clause.

The articles you are referring to - I don't know if my use-case of InnoDB is extreme, the DB is around 9 GB and the table I got most problems with have around 3M rows. SELECT COUNT(*) FROM table in MYISAM is a snap but after convering to InnoDB it takes around 9 seconds to execute that query unless specifying the PRIMARY index.
Reply


Messages In This Thread
RE: Ability to specify index for query build from - by tgix - 06-02-2016, 12:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB