If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > ISAM File performance

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-24-09, 12:54
kitaman kitaman is offline
Papabi's friend
 
Join Date: Sep 2009
Location: Ontario
Posts: 626
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?
Reply With Quote
  #2 (permalink)  
Old 11-25-09, 19:43
sco08y sco08y is offline
Registered User
 
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.

Quote:
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On