2006-01-01から1年間の記事一覧

UNIV_EXPECT gccでは以下のように定義される。 # define UNIV_EXPECT(expr,constant) __builtin_expect(expr, constant)__builtin_expectはプログラマが指定できる分岐予測の情報で、exprで指定した条件がconstantで指定した結果になる可能性が高いことをコ…

transaction

read_view_open_now read_view_t(現在実行中のトランザクションIDのリスト: PostgreSQLのsnapshotに相当する)を作成する。(1)read_view_create_lowでメモリを確保。 実行中のトランザクション数は、trx_sys->trx_listに登録されている。 (2)view->low_limit_…

Improvement of search for a binary operator

http://archives.postgresql.org/pgsql-patches/2006-04/msg00228.php'='などの演算子(operator)を、どのように処理するか決める処理を高速化するパッチ。operatorはシステムカタログpg_operatorに登録されており、ユーザーがcreate operatorで登録すること…

memory manager (2)

mem_heap_create_func memory heapを作成する。mem_heap_createなどのマクロから実行される。 (関数名がXXXXX_funcなどとなっている場合、マクロ経由で実行される)引数 n: 先頭のブロックサイズを指定する。0を指定した場合はデフォルトサイズ (MEM_BLOCK_ST…

memory manager

innobaseのmemory managerはmemory poolとmemory heapで構成されている。 memory poolは、最初にmysqlのパラメータinnobase_additional_mem_pool_sizeで指定された大きさのバッファを確保して、そこから必要なメモリを割り当てていく。このバッファからメモ…

hash

mysqlのハッシュテーブルは、PostgreSQLと同じリニアハッシュ・アルゴリズムを使用している。 (PostgreSQLのハッシュテーブル:http://www.hi-ho.ne.jp/a_ogawa/document/pg_dynahash.pdf) PostgreSQLと違う点。 - ハッシュテーブルにデータを登録するたびに…

innodbのレコードの構造

レコードのフォーマットはrem0rec.cに詳しい説明がある。 OLD STYLEとNEW STYLEの2種類がある。 (MySQL Internals Manualの説明はOLD STYLEのもの)index->table->compが1だとNEW STYLE。 compはdict_mem_table_create()で設定している。 ha_innobase::create…

Improve the comparison of NUMERIC data

patch applied. http://archives.postgresql.org/pgsql-patches/2006-02/msg00080.php

gdb memo

callコマンドで関数を実行できる。例) innodbのrecordの情報を出力する (1)ブレークポイントを設定 break rec_init_offsets(2)ブレークしたらデバッグ用の関数を実行 call rec_print(stderr, rec, index) continueこれでmysqlのerrファイル(mysqlhome/varに…

mysql-5.1のstorage engine

storage engineの実装は、storageディレクトリにある bdb heap innobase myisam myisammrg ndbがある storage engineのインタフェースには、handlerとhandlertonがある handlerはinsertやselectなど、テーブルを操作するインターフェースを定義したclass。sq…