SQLite Forum

SELECT optimization for constant expression
Login
I have a similar table, named df_players.  Even ignoring all the parameters and the IS NULL, a very simple single column query demonstrates that the LIKE causes the table scan:

explain query plan select * from df_players where surname LIKE 'Dennis';
QUERY PLAN
`--SCAN TABLE df_players

explain query plan select * from df_players where surname = 'Dennis';
QUERY PLAN
`--SEARCH TABLE df_players USING INDEX pix1 (surname=?)