diff options
author | unknown <dlenev@mysql.com> | 2006-02-27 20:00:07 +0300 |
---|---|---|
committer | unknown <dlenev@mysql.com> | 2006-02-27 20:00:07 +0300 |
commit | e54ecf09beca168cc7fba6d0a21b440be4f2783d (patch) | |
tree | 0fde704b3ac2031c62de8957626945f2239d8343 /sql/ha_myisammrg.cc | |
parent | e2393aa24a02505688aabc73fa4ebf79aeff17d9 (diff) | |
parent | 475eb3e9179fa4c1af3e0daa980dc6f30025ac28 (diff) | |
download | mariadb-git-e54ecf09beca168cc7fba6d0a21b440be4f2783d.tar.gz |
Merge mysql.com:/home/dlenev/src/mysql-5.0-bg13525
into mysql.com:/home/dlenev/src/mysql-5.1-merges2
client/mysqltest.c:
Auto merged
include/my_global.h:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/mysql-test-run.sh:
Auto merged
mysql-test/r/heap.result:
Auto merged
mysql-test/r/merge.result:
Auto merged
mysql-test/r/ps.result:
Auto merged
mysql-test/r/trigger.result:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/t/ps.test:
Auto merged
mysql-test/t/trigger.test:
Auto merged
mysql-test/t/view.test:
Auto merged
sql/field.cc:
Auto merged
sql/field.h:
Auto merged
sql/ha_myisammrg.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.h:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_table.cc:
Auto merged
storage/myisammrg/myrg_queue.c:
Auto merged
sql/sql_rename.cc:
Manual merge.
sql/sql_trigger.cc:
Manual merge.
sql/sql_yacc.yy:
Manual merge.
Diffstat (limited to 'sql/ha_myisammrg.cc')
-rw-r--r-- | sql/ha_myisammrg.cc | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc index a24b32435a8..ec015c5e320 100644 --- a/sql/ha_myisammrg.cc +++ b/sql/ha_myisammrg.cc @@ -308,7 +308,27 @@ void ha_myisammrg::info(uint flag) table->s->keys_in_use.set_prefix(table->s->keys); table->s->db_options_in_use= info.options; mean_rec_length= info.reclength; - block_size=0; + + /* + The handler::block_size is used all over the code in index scan cost + calculations. It is used to get number of disk seeks required to + retrieve a number of index tuples. + If the merge table has N underlying tables, then (assuming underlying + tables have equal size, the only "simple" approach we can use) + retrieving X index records from a merge table will require N times more + disk seeks compared to doing the same on a MyISAM table with equal + number of records. + In the edge case (file_tables > myisam_block_size) we'll get + block_size==0, and index calculation code will act as if we need one + disk seek to retrieve one index tuple. + + TODO: In 5.2 index scan cost calculation will be factored out into a + virtual function in class handler and we'll be able to remove this hack. + */ + block_size= 0; + if (file->tables) + block_size= myisam_block_size / file->tables; + update_time=0; #if SIZEOF_OFF_T > 4 ref_length=6; // Should be big enough |