Dan, On Fri, Mar 1, 2013 at 1:12 AM, Dan Kennedy <danielk1...@gmail.com> wrote: > On 03/01/2013 03:24 PM, Igor Korot wrote: >> >> Hi, >> Will foreign key creation give me the speed increase? >> Or I need more an index? > > > Foreign keys only ever slow things down (more stuff to check each > time a row is inserted/updated/deleted). Indexes sometimes speed > up queries.
So, it is better to make an index? Thank you. > > Dan. > > > > >> >> Thank you. >> >> On Tue, Jan 1, 2013 at 10:01 AM, Peter Haworth <p...@lcsql.com> wrote: >>> >>> And remembering that you will lose any indexes or triggers defined for >>> the >>> table by doing this. >>> >>> There are plenty of third party tools out there that will take care of >>> adding/removing constraints to existing tables and a whole lot of other >>> functions that aren't available in SQLite's DDL, while accounting for all >>> their secondary effects. >>> >>> Pete >>> lcSQL Software <http://www.lcsql.com> >>> >>> >>> On Tue, Jan 1, 2013 at 9:00 AM, <sqlite-users-requ...@sqlite.org> wrote: >>> >>>> Message: 1 >>>> Date: Mon, 31 Dec 2012 10:13:40 -0800 >>>> From: Ward Willats <sqlite-us...@wardco.com> >>>> To: General Discussion of SQLite Database <sqlite-users@sqlite.org> >>>> Subject: Re: [sqlite] Is there a way to create a foreign key in >>>> existing table? >>>> Message-ID: <e0b03b27-8371-476d-bddd-e58752eb2...@wardco.com> >>>> Content-Type: text/plain; charset=us-ascii >>>> >>>> >>>> >>>> Or, if you want to do it "live:" use ALTER TABLE to rename the existing >>>> table, CREATE TABLE to make the table with the FK you want, INSERT >>>> SELECT >>>> to bring the records from the renamed table to the new table, and DROP >>>> TABLE to get rid of the renamed original. >>>> >>> _______________________________________________ >>> sqlite-users mailing list >>> sqlite-users@sqlite.org >>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >> >> _______________________________________________ >> sqlite-users mailing list >> sqlite-users@sqlite.org >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >> > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users