On Sunday, 28 February, 2016 09:17, Christoforus Surjoputro <cs_sanmar at yahoo.com> said:
> So you think that it better use autoindex instead of my own index for > matching email and password from user input and database? How about sqlite > queryplanner docs tell that said "To get the maximum performance out of a > query with multiple AND-connectedterms in the WHERE clause, you really > want a multi-column index withcolumns for each of the AND terms."? The > index that I made contain email and password, but sqlite autoindex only > contain email that of course my index is better than autoindex as they > said from docs. Take a look at your SELECT. You have told SQLite that "email" is UNIQUE. Yet in your SELECT you are matching on "password" too. SQLite has realised that since "email" must be UNIQUE it doesn't need the "password" column to find the right row. Having done that it picked the best index for the "email" column. I don't need to argue with you about this. There are very good answers to your question from other people. Simon.