? for (x in 1 <= 2000) Person(firstname : "xx" + string(x)); ? select Person.firstname = "xx20"; = bag(2628.2.201654:oid) ? select Person.firstname = "xx10"; = bag(2608.2.642448:oid)The first operation creates 2000 person instances: as you can notice, this operation takes only a few seconds on a reasonnable computer.
The two last operations query person instance according to their firstname attribute.
As you can notice, these query operations take a while: about 3 seconds for each operation on a ULTRA Sparc: of course, this is too much.
A good idea is to affect an index on the attributes - for instance firstname, lastname and age - for which one wants to perform efficient query.
This is very simple:
class Person {
string firstname;
char lastname;
int age;
Address addr;
...
set<Person *> children;
index on firstname;
index on lastname;
index on age;
};
% eyedbodl -U bill -P {bill password, i.e. 'thekid'} -d foo -u --package=person person.odl
Updating 'person' schema in database foo...
Creating [NULL] hashindex 'index<type = hash, propagate = on> on Person.firstname' on class 'Person'...
Creating [NULL] hashindex 'index<type = hash, propagate = on> on Person.lastname' on class 'Person'...
Creating [NULL] btreeindex 'index<type = btree, propagate = on> on Person.age' on class 'Person'...
Done
% eyedboql -U bill -P thekid -d foo -w ? select Person.firstname = "xx20"; = bag(2628.2.201654:oid) ? select Person.firstname = "xx10"; = bag(2608.2.642448:oid)and you will notice that these operations are immediate.