Gossamer Forum
Home : Products : DBMan : Customization :

Sorting the database file

Quote Reply
Sorting the database file
Is there a mod ( I have not found one yet ) that actually sorts the database? I want to make sure the db file stays sorted whenever it is modified/updated. My db fields start with YEAR, MONTH, DAY and TIME. I need the actual database file to stay sorted because I have other applications that read the db files and I don't want to have to add extra logic the the other apps to sort on-the-fly. It's too inefficient. If I keep the db sorted it will only have to sort once when the db is changed.

What I did in the past was add two extra line to the beginning of my external apps:

# Use event.db.sorted instead of event.db
# Sorting the events database
$result = `sort event.db > event.db.sorted`;

This was quick and dirty but it works. However, this happens every time someone views the events page. There's no reason to sort the database everytime someone views the events page when all that needs to happen is to sort the database once when it changes.
Subject Author Views Date
Thread Sorting the database file acravens 3752 Sep 5, 2005, 3:57 PM
Thread Re: [acravens] Sorting the database file
acravens 3625 Sep 5, 2005, 4:52 PM
Thread Re: [acravens] Sorting the database file
acravens 3620 Sep 5, 2005, 4:55 PM
Post Re: [acravens] Sorting the database file
JPDeni 3617 Sep 6, 2005, 7:48 AM