Ingo Strüwing <[EMAIL PROTECTED]> wrote:
Hi Sirisha,

Am Donnerstag, den 27.01.2005, 08:41 +0000 schrieb sirisha gnvg:
> hai,
> I tried the command "myisamchk -d -v ".It gives the output containing data 
> file length,key file length,max key file length of a myisam table.I supposed 
> to use the value of "MAX KEY FILE LENGTH" in my java program.For that I 
> search the souce code of mysql 4.1.8.It is used in the statement 
> "llstr(share->base.max_key_file_length,llbuff2)" in 
> ../myisam/myisamchk.c.(where share is a structure variable for MYISAM_SHARE& 
> base is a structure variable for MI_BASE_INFO).But I could not get how it is 
> computed.Can any one suggest me in detail
> 1.HOW THE "MAX KEY FILE LENGTH " IS COMPUTED?

myisam/mi_info.c mi_info():
max_key_file_length=
mi_safe_mul(MI_MIN_KEY_BLOCK_LENGTH,
((ulonglong) 1 << (share->base.key_reflength*8))-1);

> 2.WHAT ARE THE VARIABLES USED IN COMPUTING THAT PARAMETER?

key_reflength is read from the key file by my_n_base_info_read() in
mi_open().

> 3.HOW CAN I USE THOSE VARIABLES IN MY JAVA PROGRAM IN COMPUTING "MAX KEY FILE 
> LENGTH"?

You can read the key file, following the file layout as given by the
above mentioned functions. In that case, max_key_file_length is itself
part of the key file. You just need to figure out, at which offset it
is.

Regards,
Ingo
-- 
Ingo Strüwing, Senior Software Developer
MySQL AB, www.mysql.com
Office: +49 30 43672407

Are you MySQL certified? www.mysql.com/certification



 

Respected sir,

Thank you for your reply.You suggested me that both key_reflength and 
max_key_file_length can be read from "key file".We just need to find the offset 
at which they are stored in "key file".But I have searched all files containing 
"key" as part of their name in "MySQL 4.1.9" folder for "max_key_file_length" 
and all those files all c or c++ program files.

Then what do you mean by  finding offset?Please once again explain in detail 
what "key file" is and what it contains.

Thanking you,

sirisha. 



Yahoo! India Matrimony: Find your life partneronline.

Reply via email to