Commit 1f0b739f authored by marko's avatar marko

branches/zip: Do not decompress blocks in buf_page_init_for_read(),

but in buf_page_get_gen().  Adjust comments.  This prevents
unnecessary decompression in read-ahead when the compressed block
exists in the buffer pool.

If the block does not exist in the buffer pool, read-ahead will still
allocate an uncompressed page and decompress the block.

Move buf_block_init_low() and buf_zip_decompress() earlier in the file,
because some compilers are unable to inline functions that are defined
after the invocation.

buf_page_get_gen(): Decompress the block if needed.

buf_page_init_for_read(): Do not decompress.
parent 52f7bb36
This diff is collapsed.
......@@ -992,7 +992,7 @@ buf_LRU_free_block(
bpage->zip.data = NULL;
page_zip_set_size(&bpage->zip, 0);
/* Prevent buf_page_init_for_read() from
/* Prevent buf_page_get_gen() from
decompressing the block while we release
buf_pool->mutex and block_mutex. */
b->buf_fix_count++;
......
......@@ -256,7 +256,7 @@ buf_page_get_gen(
Initializes a page to the buffer buf_pool. The page is usually not read
from a file even if it cannot be found in the buffer buf_pool. This is one
of the functions which perform to a block a state transition NOT_USED =>
FILE_PAGE (the other is buf_page_init_for_read above). */
FILE_PAGE (others are buf_page_init_for_read and buf_page_get_gen). */
buf_block_t*
buf_page_create(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment