One further advice :

The fastest solution for your Problem would be to create a Array with 
fixed size Entries to describe the relationship between animals.

in C you would simply end up with a struct like :

struct ancestors {
    integer id_father ;
    integer id_mother ;
} ;

If you have a continuing range of animals this would create for 1 Mio 
animals you would end up with an array of 8 MB size. You can store this 
as a seperate file or a blob in a database and get the fastest possible 
accesstime for your problem.

The question is then if you have a continuing range of animal id's.

If you have no continuous range of animal_id's than i'd advice to create 
a indextable (symboltable) which translates animal_id's into array 
indexes. Sqlite could be used for this too where you declare animal_id 
as a numerical primary key instead of rowid. (UNIQUE PRIMARY KEY). No 
other fields should be included in this translation table so you'll have 
a maximum amount of key-index pairs on each page of your database and 
the translation so will require less page reads to get the correct array 
index. Well designed hash tables would be a bit faster for this goal but 
the difference would be minimal.

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

Reply via email to