[Opendnssec-develop] Re: About the 2.0 ORM layer
Yuri Schaeffer
yuri at nlnetlabs.nl
Sun Mar 2 22:20:59 UTC 2014
> - Are we happy with the database schema?
yes, I see no problems with it.
> - Can someone point to a good example where they think the ORM works nicely?
> - Can someone point to a good example where they think the ORM behaves
> badly?
Well, an example would be the code to generate the key list
(keystate/keystate_list_task.cpp) and then for example
perform_keystate_list_compat().
First you would need to fetch the (database-)keys to all zones.
OrmMessageEnum(conn, zone.descriptor(), rows)
Then you can loop over rows to fill the zone data structure doing:
OrmGetMessage(rows, zone, true)
The 3th param indicates that not only the EnforcerZone table is queried
but also recursively all the subtables. This is needed because the key
states are in a different table of course.
So as a result this is what I believe happens when for example having a
thousand zones, 2 keys each (see keystate.proto for schema):
1 + 1000 + 2*1000 + 4*2*1000 = 11,001 queries.
this might be a low estimation really, depending on the implementation
details. - I'd have to test. Bottom line is: it is more than 1 by
several orders of magnitude.
//Yuri
More information about the Opendnssec-develop
mailing list