Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2009
    Location
    Ontario
    Posts
    1,057

    ISAM File performance

    One of my customers called today and said that he thought his machine was running slower since a system crash last week. As a result of the crash, we reorganized all the data files into key sequence (some files had corrupted indexes.)
    The client is in the same day courier business. The records in the files, generally speaking, are only accessed while the order is active (1 to 2 days).
    My thinking is that when the files are disorganized, the most active records are always at the end of the file, and therefore closer together physically on the disk and less head movement occurs.
    I have no solution, as I have no access to the source code.
    My question really is, is my theory sound?

  2. #2
    Join Date
    Oct 2002
    Location
    Baghdad, Iraq
    Posts
    697
    What's the difference between random seek time (the time it takes for the drive head to move halfway across the platter, plus rotation time) vs. sequential seek time (the time it takes the head to move one track)?

    Probably a lot less than the capacity of this person to imagine that his system is running slower.

    My thinking is that when the files are disorganized, the most active records are always at the end of the file, and therefore closer together physically on the disk and less head movement occurs.
    Not sure what flavor you're using, but an ACID system doesn't just write something out. At a minimum, it first writes out to a journal or log. Then on committing the changes, it marks the log as committed. Later on, the base file is updated from the log file.

    When the log is being written out to the base, though, there are two places it can put stuff: either in some gap within the file or at the end of the file. That tends to support your theory. But there's a strong incentive not to move rows, because if a row moves you have to update all the indexes that point to it. OTOH, if you're not actually updating but rather deleting rows and then inserting similar data, the rows _would_ be moving around.

    Last thought: wherever the rows are, if they're frequently accessed, they ought to be cached in RAM.

Posting Permissions

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