Large Dictionaries

Thomas Ganss tganss_at_t_dash_online_dot_de-remove-all-after-first-real-dash at
Mon May 29 09:09:50 CEST 2006

Klaas schrieb:

> 4. Insert your keys in sorted order.
This advice is questionable -
it depends on the at least on the db vendor and probably
sometimes on the sort method, if inserting pre-sorted
values is better.

My gut feeling on this matter is:
IF the insert times of pre-sorted values is far better
than the times of unsorted values, there is a chance
that the resulting tree is unbalanced: only 1 compare
operation after insert and no re-balancing of the tree.

re-indexing will probably give you far better access times
in this case. Another option is to drop non RI indexes used only
for query optimization and recreate them after batch insert.

my 0.02 EUR


More information about the Python-list mailing list