On 11/19/08, Christophe Leske <[EMAIL PROTECTED]> wrote:
>
>  >> 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.
>  >
>
> Is there a construct in sqlite which would allow a coulumn to be shared 
> amongst tables in such a way that the data is there only once, thus creating 
> a smaller file?

No, there is no such construct in standard SQL. Every table is its own
self-standing entity.

>
>  In the example provided, the iDs are exactly the same, yet they are there 
> twice...
>
>

It precisely because the IDs are identical that allows you to join the
two tables using that column.

Unless you are working with incredibly space constrained conditions,
which, it seems you are not because you are using R-Trees, you should
not worry about saving space over one column (unless you are curious
for just, well, the sake of curiosity).




N
>
>
>  Christophe Leske
>
>  www.multimedial.de - [EMAIL PROTECTED]
>  http://www.linkedin.com/in/multimedial
>  Lessingstr. 5 - 40227 Duesseldorf - Germany
>  0211 261 32 12 - 0177 249 70 31
>
>
>  _______________________________________________
>
> sqlite-users mailing list
>  sqlite-users@sqlite.org
>  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>


-- 
Puneet Kishor http://punkish.eidesis.org/
Nelson Institute for Environmental Studies http://www.nelson.wisc.edu/
Open Source Geospatial Foundation (OSGeo) http://www.osgeo.org/
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to