SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    USA
    Posts
    1,407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how long would it take the production server to add new indexes?

    Below is the table structure. How long would it take to add two new indexes to this table that has 200,000 records?

    I know it partially depends on what else the server is doing and the type of machine but will it take hours or seconds is my basic question?

    CREATE TABLE `purchase_list` (
    `purchase_list_id` int(10) unsigned NOT NULL default '0',
    `purchase_id` int(10) default '0',
    `menu_id` int(10) unsigned NOT NULL default '0',
    `purchase_list_price` float NOT NULL default '0',
    `purchase_list_specific` varchar(128) default NULL,
    `purchase_list_name` varchar(255) NOT NULL default '',
    `user_id` int(10) default NULL,
    `old_purchase_id` int(10) default NULL,
    `purchase_mod_date` datetime default NULL,
    PRIMARY KEY (`purchase_list_id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

  2. #2
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    probably minutes.

  3. #3
    SitePoint Addict
    Join Date
    Apr 2004
    Location
    Belgian in Mexico
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I were you, I ask the hosting company when is the best time to do so. If it's in the middle of the night for you, you could execute that query within PHP code with a cron job, or maybe the technical support would even do that for you.
    I say that because I've had problems in the past in a similar case (and also with a db optimization). While both took less than 1 minute on my test machine (with the same amount of data), it took forever on the production server, and finally they had to restart the server and sent me a warning, because I was using too many resources and effectively blocking db access to everyone on the server. Maybe it was also not the best host ever...

    I've now learned my lesson and if I ever have to do such operation in the future, I'll certainly ask them beforehand, just to be sure there's no problem.

    Regards,

    Michaël
    MichaŽl Niessen
    http://assemblysys.com
    (Countries/states/cities with latitude & longitude,
    weathercodes & topical databases)

  4. #4
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    USA
    Posts
    1,407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    good advice - thanks to you and longneck


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •