Commit graph

24 commits

Author SHA1 Message Date
sunny
d0e8003b2f branches/innodb+: Merge revisions 2460:2579 from branches/zip
The followin mysql-tests failed (and they are known to fail):
main.information_schema        	[ fail ]
main.innodb_file_per_table_basic[ fail ]
main.type_bit_innodb           	[ fail ]

Tested against : MYSQL_SERVER_VERSION  "5.1.28"
2008-08-09 00:15:46 +00:00
inaam
c5dacc2914 branches/innodb+: Merge revisions 2344:2454 from branches/zip 2008-05-14 15:43:19 +00:00
marko
5cf58ce919 branches/innodb+: Merge revisions 2322:2340 from branches/zip 2008-03-03 10:25:27 +00:00
marko
bddb5a0cca branches/zip: Add a UNIV_INTERN qualifier to every global function declaration
in *.h files, so that the function signatures in the *.h and *.c files fully
match each other.

ut_dulint_sort(): Add a UNIV_INTERN qualifier also to the function definition.
2008-02-18 18:38:33 +00:00
marko
35db9631fd branches/zip: Add statistics on page compression and decompression counts.
ha_innodb.cc: Add the columns COMPRESSED, COMPRESSED_OK, DECOMPRESSED
to INFORMATION_SCHEMA.INNODB_BUDDY.

page_zip_compress_count[], page_zip_compress_ok[]: New statistic counters,
incremented in page_zip_compress().

page_zip_decompress_count[]: New statistic counter,
incremented in page_zip_decompress().
2007-04-10 08:11:49 +00:00
marko
ba1fb95598 branches/zip: Try to adhere to ISO 9899:1989 where possible. (The recently
introduced ib_longlong and %ll length specifier are not C89.)

row_ext_t: Change char* buf to byte* buf to avoid signedness warnings.

Change the type of all bit fields to unsigned.

rec_get_next_ptr(): Add (byte*) casts to avoid arithmetics on void*.

page_zip_decompress_clust(): Do not mix declarations and code.
2006-12-08 15:55:59 +00:00
marko
7b32620f7d branches/zip: page_zip_des_t: Enclose m_start in #ifdef UNIV_DEBUG.
Add m_nonempty for facilitating the test in page_zip_alloc().  This
reduces the combined size of the bit-fields to 32 bits.  Thus,
sizeof(page_zip_des_t) == 2 machine words on 32-bit and wider systems.
2006-11-30 14:09:29 +00:00
marko
69f87fb058 branches/zip: Move all fields that are not needed in compression or
decompression from page_zip_des_t to buf_page_t, because the fields
needed in compression are modified without holding the block mutex.
All writes to bit-fields sharing a machine word must be protected
by the same mutex or rw-lock.
2006-11-30 10:33:35 +00:00
marko
b03460d90d branches/zip: Move the page flushing fields from buf_block_t to
buf_page_t and page_zip_des_t.
2006-11-27 14:12:09 +00:00
marko
0d7111c9cd branches/zip: page_zip_des_t: Rename "size" to "ssize" and reduce the
storage size from 16 to 3 bits.

page_zip_get_size(), page_zip_set_size(): New functions.

Replace direct references to page_zip_des_t:size with calls to
buf_block_get_zip_size(), page_zip_get_size(), and page_zip_set_size().
2006-11-27 13:44:32 +00:00
marko
8332c45ce4 branches/zip: Introduce buf_page_t, a common structure for compressed-only
and uncompressed buffer pool pages.

buf_block_t: Replace page_zip, space, and offset with buf_page_t page.
Replace some integers with bit-fields.

enum buf_block_state: Rename to buf_page_state.  Add BUF_BLOCK_ZIP_PAGE.

page_zip_des_t: Add the field "state".  Make the integer fields bit-fields.

page_zip_copy(): Document which fields are copied.
2006-11-24 08:32:18 +00:00
marko
4465e272a0 branches/zip: Allow the code to be built with function inlining enabled.
page0page.h: Add #include "page0zip.h"

page_dir_slot_get_rec(): Avoid void* arithmetics.

trx0undo.ic, trx0sys.ic: Remove unnecessary #include "page0zip.h"

page_zip_write_header(): Move prototype from page0types.h to page0zip.h
2006-08-14 08:25:46 +00:00
marko
49d252397a branches/zip: Remove remaining occurrences of XDES_DESCRIBED_PER_PAGE.
mlog_parse_string(): Remove an off-by-one error in an assertion.

fil_extend_space_to_desired_size(): fsp_header_get_free_limit(),
fsp_try_extend_data_file(): Replace UNIV_PAGE_SIZE with the actual page size.

PAGE_ZIP_MIN_SIZE: New constant, to be used in assertions.

FSP_SEG_INODES_PER_PAGE: Add parameter zip_size.

fsp_seg_inode_page_get_nth_inode(), fsp_seg_inode_page_find_used(),
fsp_seg_inode_page_find_free(): Add parameter zip_size.
2006-06-07 10:41:58 +00:00
marko
f137c03847 branches/zip: Improve the clearing of deleted records. Try to support
operations on BLOB columns.  There are some bugs in the code, because
test-insert and a few other tests fail.

page_mem_free(): Add parameter index.  Decrement PAGE_N_RECS here.
Move some operations to page_zip_dir_delete().

page_zip_clear_rec(): Make this a static function.

page_zip_dir_delete(): Add parameters index and offsets.
Decrement PAGE_N_RECS and clear info_bits and n_owned.

page_zip_get_n_prev_extern(): Correct the synopsis and the algorithm.
Add parameter page_zip.  Search the records in heap_no order instead
of collation order.

page_zip_compress(), page_zip_decompress(): Only copy BLOB pointers
and increment n_blobs for records that have not been deleted.

page_zip_clear_rec(): Clear trx_id and roll_ptr on the compressed page.

page_zip_dir_delete(): Decrement PAGE_N_RECS.  Shift the array of
BLOB pointers.  Call page_zip_clear_rec().

page_zip_dir_add_slot(): Shift the array of BLOB pointers to make
space of roll_ptr and trx_id.

page_cur_delete_rec(): Do not decrement PAGE_N_RECS or call
page_zip_clear_rec(), as page_mem_free() already does it.
2006-03-16 14:02:22 +00:00
marko
e8e9fb28b4 branches/zip: Note that TRX_ID and ROLL_PTR only exist on B-tree leaf pages
of clustered indexes.  Previously, parts of the code assumed that these
columns would exist on all leaf pages.  Simplify the update-in-place of
these columns.

Add inline function dict_index_is_clust() to replace all tests
index->type & DICT_CLUSTERED.

Remove the redo log entry types MLOG_ZIP_WRITE_TRX_ID and
MLOG_ZIP_WRITE_ROLL_PTR, because the modifications to these columns
are covered by logical logging.

Fuse page_zip_write_trx_id() and page_zip_write_roll_ptr() into
page_zip_write_trx_id_and_roll_ptr().

page_zip_dir_add_slot(), page_zip_available(): Add flag "is_clustered",
so that no space will be reserved for TRX_ID and ROLL_PTR on leaf pages
of secondary indexes.

page_zip_apply_log(): Flag an error when val==0 is encoded with two bytes.

page_zip_write_rec(): Add debug assertions that there is enough space
available for the entry before copying the data bytes of the record.
2006-03-09 17:26:02 +00:00
marko
4ea9fe182f branches/zip: Fix various bugs.
btr_root_raise_and_insert(): Because btr_page_set_level() must not
change level from non-zero to zero on compressed pages, invoke
btr_page_set_level() with page_zip==NULL and compress the entire
root page after creating it from the scratch.

btr_attach_half_pages(): Simplify the computation of lower_page_zip
and upper_page_zip.  Invoke btr_node_ptr_set_child_page_no() with
the correct page_zip.

page0page.h: Add __attribute__((const)) to functions testing for
infimum or supremum.

page_zip_dir_delete(): Note that the third parameter may be NULL.
Correct offset errors.

page_zip_available(): Use n_heap instead of n_recs.

page_zip_dir_find(), page_zip_dir_find_free(): Fix off-by-one error.

page_zip_fields_encode(), page_zip_fields_decode(): Encode and decode
index->n_nullable for non-leaf pages.

page_zip_apply_log(): Write REC_NEW_HEAP_NO before calling
rec_offs_make_valid().

page_zip_write_node_ptr(): Correct off-by-one error.

page_cur_search_with_match(): Make use of page_is_leaf().

page_dir_add_slots(): Replaced with page_dir_add_slot().  Use memmove().
2006-03-08 22:19:20 +00:00
marko
1aca6cada1 branches/zip: Fix some bugs in the insertion of records.
row_upd_rec_in_place(), page_zip_write_rec(): Add parameter "index".

page_dir_set_n_heap(): Add a debug assertion that on compressed
pages, n_heap will always be incremented by one.  Improve code formatting.

page_zip_dir_add_slot(): New function, called from
page_cur_insert_rec_low() after page_mem_alloc_heap().

rec_set_n_owned_new(): Do not call page_zip_rec_set_owned()
on the supremum record.

rec_offs_make_valid(): Add debug assertions.

page_zip_dir_user_size(): Correct an off-by-one error in the debug assertion.

page_zip_apply_log(): Add parameter trx_id_col.  Skip trx_id and roll_ptr.

page_zip_decompress(): Simplify the handling of "storage" in the loop that
copies the uncompressed fields.

page_zip_write_rec(): Store trx_id and roll_ptr separately.

page_zip_write_trx_id(), page_zip_write_roll_ptr(): Fix off-by-one errors.

page_cur_insert_rec_low(): Call page_zip_dir_add_slot() after
page_mem_alloc_heap().  Remove some redundant assertions.
Pass page_zip to page_dir_split_slot().
2006-03-06 21:00:05 +00:00
marko
747c8fad44 branches/zip: Merge revisions 200:236 from trunk. 2006-02-23 19:25:29 +00:00
marko
77a094819e branches/zip: Minor cleanup.
Remove the declaration of the undefined function
page_zip_available_noninline().

Make page_zip_available() private to page0zip.c and page0zip.ic.
2006-02-22 13:49:05 +00:00
marko
47da8abc14 branches/zip: Try to synchronize the updates of uncompressed and
compressed pages.

btr_root_raise_and_insert(): Distinguish root_page_zip and new_page_zip.

btr_cur_set_ownership_of_extern_field(): Do not log the write on the
uncompressed page if it will be logged for page_zip.

lock_rec_insert_check_and_lock(), lock_sec_rec_modify_check_and_lock():
Update the max_trx_id field also on the compressed page.

mlog_write_ulint(): Add UNIV_UNLIKELY hints.  Remove trailing white space.

mlog_log_string(): Remove trailing white space.

rec_set_field_extern_bits(): Remove parameter mtr, as the write will either
occur in the heap, or it will be logged at a higher level.

recv_parse_or_apply_log_rec_body(),
page_zip_write_header(): Add log record type MLOG_ZIP_WRITE_HEADER.

page_header_set_field(): Pass mtr=NULL to page_zip_write_header().

page_header_reset_last_insert(): Pass mtr to page_zip_write_header().

btr_page_set_index_id(), btr_page_set_level(),
btr_page_set_next(), btr_page_set_prev(): Pass mtr to page_zip_write_header().

row_upd_rec_sys_fields(): Pass mtr=NULL to page_zip_write_trx_id() and
page_zip_write_roll_ptr(), since the write will be logged at a higher level.

page_zip_write_header(): Add parameter mtr.
page_zip_write_header_log(): New function.

Remove rec_set_nth_field_extern_bit().
Make rec_set_nth_field_extern_bit_old() static.
Rename rec_set_nth_field_extern_bit_new()
to rec_set_field_extern_bits_new() and make it static.

row_ins_index_entry_low(): Remove bogus TODO comment.
2006-02-22 13:02:40 +00:00
marko
12050c5c1c branches/zip: Prepare for in-place updates of B-tree node pointers,
BLOB pointers, trx_id, and roll_ptr.

btr_empty(), btr_create(), page_create(): Add parameter "index", as some
index information will be encoded on the compressed page.

Define REC_NODE_PTR_SIZE as 4.

Allow btr_page_reorganize() and btr_page_reorganize_low() to fail.

Define the error code DB_ZIP_OVERFLOW.

Make row_ins_index_entry_low() static.

page0zip: Encode the index, log reorganized records, and store uncompressed
fields separately from the compressed data stream.
2006-02-10 15:06:17 +00:00
marko
48a1ffa5f4 branches/zip: Implement a more compact page format.
Add a hook to buf0flu.c for testing compression and decompression.
TODO: adapt page_zip_write() calls.
2005-11-24 14:13:10 +00:00
marko
b34b37b502 branches/zip:
Initial import of the zip-like compression of B-tree pages.
2005-10-27 11:48:10 +00:00
osku
2903c72469 Import 5.0 code. 2005-10-27 07:29:40 +00:00