Data Retrieval from disk part 2

Post Reply
skalyanaraman
Posts: 109
Joined: Tue May 29, 2001 9:13 pm

Data Retrieval from disk part 2

Post by skalyanaraman »

Hi John,
You had mentioned earlier in a reply to my post "Retrievel from disk",

1. Yes, the entire record is read to get the fields you want. Generally the record is smaller than the size of the data the drive will read anyway.

I did not quite understand the second sentence.
For instance, if our table has 4 fields,
DOCID, AUTHOR, KEYWORDS, DOCTEXT
of datatypes
varchar(100), varchar(100), varchar(100), varchar(4000)

and if I do, "select DOCID from tbldoc"
all the 4 fields comprising of the record will be retrieved?

And what about the drive reading more than the record?

Also, in Texis, varchar(100), does not stop us from putting data more than 100bytes into a field, i.e. we can put a 2K text into author. How does this affect the concept of a record.

If you can please elaborate it would be much appreciated.

Basically, we are trying to optimize on performance of pulling DOCID's from disk.
Thanks!!
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Data Retrieval from disk part 2

Post by mark »

Disk drives have built-in buffers and read chunks of data at a time. Sometimes those chunks are bigger than a record. Also, sometimes the OS will do read-ahead caching and request more from the drive than is currently needed.

Ignoring any index optimizations, selecting one field from a record will cause the entire record, except for blobs, to be read from disk.

Right, varchar(100) can hold more or less than 100 bytes. The disk space used will be just what's needed, not padded to 100. Records with var fields are variable sized on disk.

IMHO it would have been better to keep the discussion in the original thread http://thunderstone.master.com/texis/ma ... 45019e0418
Post Reply