On Nov 19, 2008, at 4:36 AM, Christophe Leske wrote:

> Hi,
>
> first i´d like to thank the people on this list that I have found to  
> be
> very helpful in the past. This list is truly great and friendly.
>
> I got two questions today:
>
> I have two tables, a standard one and an rtree table, which are both
> linked together logically by the ID field of the rtree table.
>
> Can I spare some bytes in my DB by defining the ID field of the  
> standard
> table as being a foreign key of the rtree table? In other words, when
> defining a foreign key, is the coloumn referencing the ID field of the
> foreign table and thus NOT replicating them (using a smaller memory
> footprint in the file)?
> Or does the table which has a foreign key still have its own ID  
> coloumn?

The ID column is replicated in each table.

>
>
> And regarding Indices:
> my standard table has two indices, one for the coloumn ID (since it is
> being referenced from the rtree), plus another one on a coloumn  
> which I
> use for sorting the results coming from that table. Are indices also
> used for sorting results, or do they do just apply for searching?

Indices are used for both sorting and searching or both at the same  
time if applicable.


D. Richard Hipp
[EMAIL PROTECTED]



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

Reply via email to