EDS - replacing record data slows down database
- Posted by Tone Škoda <tskoda at email.si> Aug 17, 2005
- 483 views
if you often use db_replace_data() or db_delete_record() database gets fragmented, i.e it grows and there are a lot of small chunks of unused space, and consequence is ever growing and ever slower database. you have to use db_compress() to solve the problem. solution would be to define maximum size of record keys and data. and then junk data would be addded to every record. that way db_replace_data() wouldnt need reallocating and db_insert() would use up whole free chunk. we would need new functions: db_insert_ex (object key, object data, integer key_max_size, integer data_max_size) or maybe db_set_max_record_size (integer max_record_size) and db_compressed_object_size (object x) which will help us determinign maximum size of keys and data. am i right or am i missing something?