Dennis Cote wrote:
> John Elrick wrote:
>   
>> Last rowid.  Rowid will be a key linking to other tables.
>>
>>     
>
> What table will rowid be linked to? Are you linking children rows back 
> to parent rows?
>
>   

Not exactly.  This is a theoretical implementation of WinFS modified to 
our specific needs.  There will be multiple tables, each representing a 
persistent class, with this table and one other serving as common ground 
for an interntal hierarchical representation.



> You should generally use an excplict column as a foreign key (i.e. for 
> linking) to other tables. You can use SQLite's "integer primary key" 
> optimization which stores a column declared that way as the table's rowid.
>
>   

Very true. The final form would contain a separate id field.




>> Because they must locate the MAX value which to my mind requires more 
>> "work" to be done that a simple:
>>
>> select rowid from foo where parent_id = :parentId and child_id = :childId
>>
>> and then stepping the first row and discarding the rest...but I could be 
>> wrong which is why I was asking<g>
>>
>>     
>
> Well if you don't know the max value before hand, then you have to 
> search the table to find it before you can use it to get any other 
> results. Always assume your table is scrambled to an arbitrary row order 
> before each query since SQL works with sets of rows, not ordered tables 
> like a spreadsheet.
>   

Given the usage, normally the inserts would always be ascending (by 
normally, I cannot think of a case where that would not be true right 
now, but I'm not far enough into the design phase to rule it out yet) 
and that "may" mean there is an optimization we could use.  However, I 
wanted to check before trying to cheat.


Thanks,


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

Reply via email to