Recently, there has been a new addition in xotcl-core that allows to have different database contexts to interact with the database. At run time, one can dynamically change the interface one wants to talk to the DB with. This allows us to operate simultaneously with two db interfaces talking to the same database: nsdb (nsdbpg ) and nsdbi (nsdbipg). The reasons we want to have such a setup are the following:
- First of all, giving the way nsdbpgi is implemented, queries run sometimes up to 10 times faster through that interface. Therefore we want to be able to use this interface to run our queries. The following tests show how fast it is:
# dbi_* calls beling to the nsdbi interface and db_* calls to the nsdb one.
append _ [time {dbi_rows {select object_id from acs_objects limit 200}} 100]
append _ [time {dbi_rows {select object_id, title from acs_objects limit 200}} 100]