Results 1 to 2 of 2
  1. #1
    fogus is offline Member
    Join Date
    Mar 2008
    Posts
    43
    Rep Power
    0

    Question How can I store a persistent index?

    Hello,

    I am trying to index a database consisting of about 12 CSV tables in a relational database structure. I am still in the process of getting the open CSV sample code to work (see this thread).

    My question is, how can I index these tables for fast record lookup AND store this index on the hard disk so that it would be persistent across program restarts?

    For example, let us say that I wanted to index a table of users across the field "user_name". If I were to make this index with a B+ tree (which is roughly what I am working to implement), how could I store this B+ tree so that it did not have to be recalculated every time the program restarted?

    I would prefer an explanation of a storage procedure for a number of abstract objects (in my case nodes) in some kind of a structure. Is XML a good way to do this? If so, does anyone have any suggestions on how to implement a B+ tree with XML as the storage solution?

    Cheers,
    ~fogus

  2. #2
    fogus is offline Member
    Join Date
    Mar 2008
    Posts
    43
    Rep Power
    0

    Default

    I thought about this some more with other members of my team and came to the conclusion that the rows of the CSV file would have to be consistent so that the index could find the place in the file appropriately and return it.

    If the lines were all variable length then the index would not be able to point to the correct location in the file, or are we missing something? Since each line in the file occupies an indefinite amount of file space, the location of each line would shift around as lines were expanded or contracted.

    I assume, in addition, that the row deletion would be handled in the index rather than the actual CSV file and that periodically the file would have to be compressed to keep space efficiency high. Deleting a row would shift the whole file around on the hard disk and make keeping track of where everything is a real chore. Perhaps a counter of row deletions could trigger a rebuild after 10,000 deletions or so.

    Does anyone have any thoughts on how to build a constant row sized CSV table?
    ~fogus

Similar Threads

  1. persistent collection
    By nanaji in forum Advanced Java
    Replies: 4
    Last Post: 10-03-2008, 05:40 PM
  2. Help with Flesch Index
    By L_22 in forum Advanced Java
    Replies: 1
    Last Post: 03-31-2008, 06:30 PM
  3. Replacing at an index
    By bugger in forum New To Java
    Replies: 2
    Last Post: 01-29-2008, 07:33 AM
  4. z-Index problem
    By mjdousti in forum AWT / Swing
    Replies: 1
    Last Post: 12-29-2007, 02:34 AM
  5. Replies: 0
    Last Post: 12-01-2007, 12:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •