On Mon, Mar 16, 2009 at 10:34:54PM +0100, Carsten Aulbert wrote:
> Can ZFS make educated guesses where the seek targets might be or will it
> read the file block by block until it reaches the target position, in
> the latter case it might be quite inefficient if the file is huge and
> has a large variance in compressibility.

Imagine a file that isn't compressed.  You don't have to read earlier
blocks to find data further into the file.  If you want data from a
particular offset, the filesystem can direct you to the block containing
that offset, and the byte within the block.

Now, since only the individual ZFS blocks are compressed, nothing
changes when compression is enabled.  The filesystem can still compute
the ZFS block containing any offset.  You might have to decompress the
final block to read the data, but that's the only file data block that
has to be read.

This is different from something like a .Z file where the entire file
is compressed.  For that, to read data at the end you either need a
directory or to decompress earlier data.
-- 
Darren
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to