PennyH <[EMAIL PROTECTED]> writes:

> 
> 
> Thank you MikeW. I try to use transaction, still slow. Use limit clause is
> good idea, but the help is limited. Dose number of index affect speed too?
> How many index on one table is better?
> 
> Regards,
> 
> Penny
> 

I don't know about the effect of an index, but looking at your
table definitions, it looks to me like the TRIGGER is trying
to keep the number of records below a certain value.

However perhaps the TRIGGER is trying to do too much - rather
than deleting a whole range of values, why not just delete
the 'bottom' value:

if 'new' userId > 10000000 + min(userId), delete where userId == min(userId)
(I'm sure you can turn that into SQL!)

Sorry if this is not relevant to your question !

You could also try one of the PRAGMA speedup suggestions:
e.g. http://article.gmane.org/gmane.comp.db.sqlite.general/41990

Regards,
MikeW

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to