From 127d01dd016aeb4b90689219d13b67075e21b8bb Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Dec 2002 00:06:05 +0100 Subject: ANALYZE for MERGE --- myisammrg/myrg_info.c | 17 ++++++++--------- myisammrg/myrg_open.c | 22 ++++++++++++++++++---- 2 files changed, 26 insertions(+), 13 deletions(-) (limited to 'myisammrg') diff --git a/myisammrg/myrg_info.c b/myisammrg/myrg_info.c index 14bc228cc1f..ba840ac444b 100644 --- a/myisammrg/myrg_info.c +++ b/myisammrg/myrg_info.c @@ -28,8 +28,6 @@ ulonglong myrg_position(MYRG_INFO *info) ~(ulonglong) 0; } - /* If flag != 0 one only gets pos of last record */ - int myrg_status(MYRG_INFO *info,register MYMERGE_INFO *x,int flag) { MYRG_TABLE *current_table; @@ -55,15 +53,16 @@ int myrg_status(MYRG_INFO *info,register MYMERGE_INFO *x,int flag) DBUG_PRINT("info2",("table: %s, offset: %lu", file->table->filename,(ulong) file->file_offset)); } - x->records = info->records; - x->deleted = info->del; - x->data_file_length = info->data_file_length; - x->reclength = info->reclength; - x->options = info->options; + x->records= info->records; + x->deleted= info->del; + x->data_file_length= info->data_file_length; + x->reclength= info->reclength; + x->options= info->options; if (current_table) - x->errkey = current_table->table->errkey; + x->errkey= current_table->table->errkey; else - x->errkey=0; + x->errkey= 0; + x->rec_per_key = info->rec_per_key_part; } DBUG_RETURN(0); } diff --git a/myisammrg/myrg_open.c b/myisammrg/myrg_open.c index 9360f582958..6a3c8dd86d9 100644 --- a/myisammrg/myrg_open.c +++ b/myisammrg/myrg_open.c @@ -32,8 +32,8 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking) { - int save_errno,i,errpos; - uint files,dir_length,length,options; + int save_errno,i,j,errpos; + uint files,dir_length,length,options, key_parts; ulonglong file_offset; char name_buff[FN_REFLEN*2],buff[FN_REFLEN],*end; MYRG_INFO info,*m_info; @@ -89,13 +89,25 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking) } info.reclength=isam->s->base.reclength; } + key_parts=(isam ? isam->s->base.key_parts : 0); if (!(m_info= (MYRG_INFO*) my_malloc(sizeof(MYRG_INFO)+ - files*sizeof(MYRG_TABLE), + files*sizeof(MYRG_TABLE)+ + sizeof(long)*key_parts, MYF(MY_WME)))) goto err; *m_info=info; - m_info->open_tables=(files) ? (MYRG_TABLE *) (m_info+1) : 0; m_info->tables=files; + if (files) + { + m_info->open_tables=(MYRG_TABLE *) (m_info+1); + m_info->rec_per_key_part=(ulong *) (m_info->open_tables+files); + bzero((char*) m_info->rec_per_key_part,sizeof(long)*key_parts); + } + else + { + m_info->open_tables=0; + m_info->rec_per_key_part=0; + } errpos=2; options= (uint) ~0; @@ -107,6 +119,8 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking) m_info->records+=isam->state->records; m_info->del+=isam->state->del; m_info->data_file_length+=isam->state->data_file_length; + for (j=0; j < key_parts; j++) + m_info->rec_per_key_part[j]+=isam->s->state.rec_per_key_part[j] / files; if (i) isam=(MI_INFO*) (isam->open_list.next->data); } -- cgit v1.2.1 From e6783a8785925f0e7433cd96d8f7f8b5c6d0c9a0 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Dec 2002 21:01:32 +0200 Subject: Removed compiler warnings Fixed wrong variable name for Windows VC++Files/innobase/innobase.dsp: Don't use precompiled headers (doesn't work with samba) VC++Files/myisammrg/myisammrg.dsp: Add missing files VC++Files/mysqlbinlog/mysqlbinlog.dsp: Fixed included paths VC++Files/mysqldemb/mysqldemb.dsp: Don't use precompiled headers (doesn't work with samba) VC++Files/mysqlserver/mysqlserver.dsp: Don't use precompiled headers (doesn't work with samba) VC++Files/sql/mysqld.dsp: Fixed paths innobase/include/univ.i: Removed compiler warning myisammrg/myrg_open.c: Removed compiler warning sql/ha_myisam.cc: Removed compiler warning Fixed wrong (but not dangerous) if statement sql/ha_myisammrg.cc: Removed compiler warning sql/mysqld.cc: Fixed wrong variable name for Windows sql/sql_update.cc: Removed not used label --- myisammrg/myrg_open.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'myisammrg') diff --git a/myisammrg/myrg_open.c b/myisammrg/myrg_open.c index 6a3c8dd86d9..f996277d287 100644 --- a/myisammrg/myrg_open.c +++ b/myisammrg/myrg_open.c @@ -32,7 +32,7 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking) { - int save_errno,i,j,errpos; + int save_errno,i,errpos; uint files,dir_length,length,options, key_parts; ulonglong file_offset; char name_buff[FN_REFLEN*2],buff[FN_REFLEN],*end; @@ -113,6 +113,7 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking) options= (uint) ~0; for (i=files ; i-- > 0 ; ) { + uint j; m_info->open_tables[i].table=isam; m_info->options|=isam->s->options; options&=isam->s->options; -- cgit v1.2.1