homepage Welcome to WebmasterWorld Guest from 54.198.42.105
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Hardware and OS Related Technologies / Website Technology Issues
Forum Library, Charter, Moderators: phranque

Website Technology Issues Forum

    
MySQL and slow website
Indexes?
Vivizimo




msg:671083
 5:24 am on Jan 18, 2005 (gmt 0)

Hi there,

I have a website and in the last couple of years it has grown and so the amount of data. When I contacted the hosting company, they told me that using Indexes will solve the problem. Is here anybody who could help me to solve this problem? I will also copy the structure of the table that got this problem:

CREATE TABLE `news` (
`id` int(11) NOT NULL auto_increment,
`headline` varchar(80) default NULL,
`author` varchar(80) default NULL,
`category` varchar(80) default NULL,
`picture` varchar(120) default NULL,
`datum2` timestamp(14) NOT NULL,
`datum` timestamp(14) NOT NULL default '00000000000000',
`preview` text,
`tekst` text,
`story` int(11) NOT NULL default '0',
`views` int(11) default NULL,
`type` tinyint(4) NOT NULL default '1',
`lang` tinytext NOT NULL,
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=1611 ;

I will be very thankful if someone can help me solve this problem.

Sincerely,
Sam

 

sunzon




msg:671084
 7:20 am on Jan 18, 2005 (gmt 0)

Your ID field is an index.

To re-index your table (which improves speed and is wise to do once a month or so) you can run this command at the sql prompt:

OPTIMIZE TABLE news;

the command is pretty self explanatory.
HTH

coopster




msg:671085
 12:53 pm on Jan 18, 2005 (gmt 0)

Welcome to WebmasterWorld, Vivizimo. And you too, sunzon!

While you are reading up on OPTIMIZE TABLE [dev.mysql.com], have a read through the section on the Speed of SELECT Queries [dev.mysql.com]. You'll find a link in there instructing How MySQL Uses Indexes as well as some general tips for speeding up queries on MyISAM tables.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Website Technology Issues
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved