Wilfried Mestdagh a écrit :
Hi Guillaume,
if restricting in the where clause on VehicleID, then you should create
an index on VehicleID.
I' not sure I understeand correct. Does this mean that if I uses 'where'
clauses it is not needed to make indexes and it make index itself when
needed ?
No no ! :) it just means that if you plan to use regularly some columns
in your where clauses, then you should create indexes on those columns.
By now I have made an index on every 'search thing' I use in where
clause. Since I dont find instructions to say to the database which
index to use, I assume it uses the right ones itself. But when it
autocreate indexes... hmm should be nice thing :)
No. SQLite nor any other DBMS autocreates indexes.
beware of creating to many indexes ! it can slow down your application !
for example, if, for a table, you always access it by using where
clauses like :
1. " where VehicleID='anID' "
or
2. " where VehicleID='anId' and VehicleOwnerID='anOwnerID' "
then you can create one index based on the two columns VehicleID and
VehicleOwnerID.
If some columns are to be used always together within your queries, then
create one index on those columns.
HTH,
Best regards,
--
Guillaume MAISON - [EMAIL PROTECTED]
83, Cours Victor Hugo
47000 AGEN
Tél : 05 53 87 91 48 - Fax : 05 53 68 73 50
e-mail : [EMAIL PROTECTED] - Web : http://nauteus.com