How did you get these byte calculations?  I thought an INT took up 4 bytes and 
char(10) would take 10 bytes.
  
  http://dev.mysql.com/doc/refman/4.1/en/storage-requirements.html

"C.R.Vegelin" <[EMAIL PROTECTED]> wrote:  Hi Grant,

I suggest to change both key fields to Integers.
Numeric keys take less space and are faster.
Your Product_Feature table then may have:
- product_id INT unsigned
- feature INT unsigned
having a Primary Key of 8 bytes i.s.o. 141 bytes.
Thus a smaller index, less disk reads and more speed.

HTH, Cor Vegelin


----- Original Message ----- 
From: "Grant Giddens" 
To: 
Sent: Tuesday, January 17, 2006 2:28 AM
Subject: Most efficient way to design this table


> Hi,
>
>    I currently have a table with 2 columns, product_id and feature.  Each 
> product_id can have multiple features.
>
>  My two columns are:
>  product_id is type char(13)
>  feature is type varchar(128)
>
>  In order to make sure I don't have the same feature listed twice for a 
> particular product, I have set the PRIMARY key on product_id and  feature.
>
>  I have lots of products and lots of features.  Is design bloating my 
> available key_buffer memory with too much data?
>
>  Is there a better way to index this data?
>
>  Thanks,
>  Grant
>
>
>
> ---------------------------------
> Yahoo! Photos
> Ring in the New Year with Photo Calendars. Add photos, events, holidays, 
> whatever. 



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]




                        
---------------------------------
Yahoo! Photos
 Got holiday prints? See all the ways to get quality prints in your hands ASAP.

Reply via email to