On 26 Apr 2019, at 3:30pm, Jose Isaias Cabrera <jic...@outlook.com> wrote:
> -- On line 5 of the resulted output , > > SCAN TABLE Project_List USING COVERING INDEX Project_Name > > Why is it scanning the table using that INDEX if there is no "Project_Name" > referenced in the query? That is one of the fields of Project_List, but it is > not being used now. Since there is no ideal index it needs to scan the list using something. That index seems to be fairly short and covers all the data needed, because all data can be retrieved directly from the index rather than needing an additional lookup in the table itself. > -- How can I create the INDEX on line 8 that sqlite_autoindex created? I think you mean SEARCH TABLE Project_ABT_Budget AS b USING COVERING INDEX sqlite_autoindex_Project_ABT_Budget_1 (ProjID=?) in which case the command is CREATE INDEX myName1 ON Project_ABT_Budget (ProjID) You should also do something like CREATE INDEX myName2 ON Project_List (InsertDate) CREATE INDEX myName3 ON Project_List (ProjID,InsertDate) Once you have defined those indices, execute the ANALZE command, then try the .expert again. What led to you using WHERE 1=1 ? An apparent bug ? _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users