Hi all, Thanks for your suggestion.
In fact, I use sqlite in a embedded device. So the memroy problem is really critical to us. For profermance improving, all of the database running in a in-memory database. For my case, is that will improve the query performance if I create the temp table of FOO? Furthermore, I need to sort the result, which following sql command has better performance? - Create Table tmp as select distinct x from foo; Select x from tmp where OID>0 and OID<=20 order by x; or - Create Table tmp as select distinct x from foo order by x; Select x from tmp where OID>0 and OID<=20; Thanks for your clearfy. VK.