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" <[EMAIL PROTECTED]>
To: <mysql@lists.mysql.com>
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]

Reply via email to