Reply to Re: Optimization : Where to focus

Your name:

Reply:


Posted by Jerry Stuckle on 05/03/06 14:43

Ben Holness wrote:
> Hi all,
>
> I am writing a php/mysql application in which I have to deal with around
> 500 product codes.
>
> When a product code is referenced a table with the details of all product
> codes is accessed.
>
> I am not sure how best to optimize this code.
> I am anticipating very high levels of activity for this particular part of
> the application (it's a machine to machine interface).
>
> Clearly the product id should be the primary key, but is it best to be
> int, enum or varchar?
>
> Here are the options:
>
> 1. Product code is represented by an int in the DB and is mapped to the
> actual product code in a PHP array
>
> 2. Product code is an enum in the DB. The enum has all 500 odd product
> codes in it
>
> 3. Product code is a varchar in the DB
>
> Which would be best? Does php speed beat mysql speed in this scenario?
>
> Ben
>
> PS. Extrapolating further, is it best to use PHP or MySQL to, for example,
> sort a dataset, format a date, make a calculation etc?


Oops - pushed send too quickly.

However, for only 500 items I'd say just use the varchar. As Toby said, if you
index this column (automatic if it's the primary key), it should be very fast.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация