On Tue, Mar 22, 2011 at 10:55 PM, BareFeetWare <list....@barefeetware.com>wrote:

>
> You have to drop the old table and create a new one with the changed
> foreign keys.


This is a bummer.   Is there any desire/plan to add an alter feature, in the
future?


> > Also, from a performance perspective, is there an advantage to using a
> > foreign key in SQLite verses just an index? (aka, is it worth my time to
> add
> > the key to begin with, I understand there are draw backs).
>
> An index and a foreign key serve different purposes. What are you trying to
> achieve. Post the relevant parts of your schema.
>

My goal in adding foreign keys (FK) is simple:  Implement referential
integrity (RI) at the database level, that way I don't shoot myself in the
foot later (I am the only developer at this time).

I am aware that an index is normally used to speed up look ups and FK are to
insure RI, but it is my impression that databases created appropriate
indexes to make the RI checks very fast, alleviating the need to create that
index separately.

So what I am wondering is: Does the act of creating FK also result in the
correct indexes being created to make the RI checks speedy?

sam
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to