Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_php thread: mysql table optimization


Message #1 by B Esa <esa_1421@y...> on Sun, 17 Mar 2002 09:58:49 -0800 (PST)
This is a multi-part message in MIME format.

------=_NextPart_000_000C_01C1CF31.698A4120
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,
       The fields like product_number or product_price should use number 
like integer or floating point
instead of varchar.
To save disk space and better performance.
Nop,
Thailand.
  ----- Original Message -----
  From: B Esa
  To: professional php
  Sent: Monday, March 18, 2002 12:58 AM
  Subject: [pro_php] mysql table optimization


  hi this is for a ecommerce site, i plan to store about 5,000 + 
products in a table in a mysql database.

  I have made the database but before going ahead with it i just wanted 
to check with you guys if i've made the correct structure or if i need 
to do something called indexing (which i dont know about) Below is the 
structure of the current table.

  
Fields........................TYPE..................NULL.......KEY.......
DEFAULT.....EXTRA
  
product_name............varchar(1330)........YES......................NUL
L......................
  
product_short_desc....mediumtext...........YES......................NULL.
....................
  
product_long_desc......mediumtext...........YES......................NULL
....................
  
small_image_url.........varchar(100)...........YES.......................
NULL....................
  
large_image_url..........varchar(100)..........YES.......................
NULL....................
  
product_category........varchar(150)............YES......................
NULL...................
  
product_stock_number..varchar(20)...........YES......................NULL
..................
  
product_number............varchar(20)...........YES......................
NULL.................
  
product_price................varchar(7)...............YES................
....NULL................
  
in_stock........................varchar(7)...............YES.............
.......NULL.................
  
sort_id..........................int(11).................................
PRI........NULL...auto_increment

  ok so is this the best design for it? If not please advise and supply 
sql code to create the very best design you think i should use.
  as far as i'm aware i dont need to link it to another table with a 
forign key.

  Many thanks
  esa.






-------------------------------------------------------------------------
-----
  Do You Yahoo!?
  Yahoo! Sports - live college hoops coverage --- Change your mail 
options at http://p2p.wrox.com/manager.asp or to unsubscribe send a 
blank email to 



  Return to Index