User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 423,531 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,338 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums
Views: 567 | Replies: 2
Reply
Join Date: Jun 2004
Posts: 36
Reputation: timhysniu is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
timhysniu timhysniu is offline Offline
Light Poster

Querying vertically-large tables. optimization ideas?

  #1  
Feb 4th, 2008
Hi guys,

I am trying to find a solid optimization technique for my problem.

I have two tables that grow quote large:
CREATE TABLE  `mydb`.`xm_artist` (
  `artist_id` int(10) unsigned NOT NULL auto_increment,
  `artist_name` varchar(255) NOT NULL,
  PRIMARY KEY  (`artist_id`),
  UNIQUE KEY `index_artist_name` USING BTREE (`artist_name`),
  FULLTEXT KEY `fulltext_artist_name` (`artist_name`)
) ENGINE=MyISAM;

CREATE TABLE  `mydb`.`xm_artist_tags` (
  `artist_id` int(10) unsigned NOT NULL,
  `similar_artist_id` int(10) unsigned NOT NULL,
  `relevancy` smallint(5) unsigned NOT NULL,
  PRIMARY KEY  USING BTREE (`artist_id`,`similar_artist_id`),
  KEY `index_similar_artist_id` (`similar_artist_id`)
) ENGINE=MyISAM;


I have about 5,000 records in artists and about 13,400 in tags.

I expect they will double, or quadruple over time.
Does anyone have any idea if there is a way to optimize the model/indexes further?
What about the basic join queries, can they be optimized further?
So far, query speed is not unacceptable, but it would be nice to have them run faster.

Does anyone have any ideas?

Thanks,
Tim
Last edited by peter_budo : Feb 6th, 2008 at 5:17 pm. Reason: Please use [code] tags even for SQL queries
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 176
Reputation: trudge is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 20
trudge trudge is offline Offline
Junior Poster

Re: Querying vertically-large tables. optimization ideas?

  #2  
Feb 6th, 2008
'Large' is relative as is 'optimize'. There are lots of MySQL databases handling millions of records / transactions. You can use EXPLAIN to see what your queries are actually doing. Why not wait until you notice a severe reduction in query time, then see if anyone here can help.
Amer Neely - Web Mechanic
"Others make web sites. We make web sites work!"
Reply With Quote  
Join Date: Jul 2006
Location: Remunj
Posts: 200
Reputation: pritaeas is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 24
pritaeas's Avatar
pritaeas pritaeas is offline Offline
Posting Whiz in Training

Re: Querying vertically-large tables. optimization ideas?

  #3  
Feb 12th, 2008
Depending on your queries, adding indexes can drastically improve speed.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MySQL Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the MySQL Forum

All times are GMT -4. The time now is 5:22 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC