MySQL Forums
Forum List  »  Newbie

Re: Slow answer when using ORDER BY
Posted by: kennet andersson
Date: March 15, 2009 03:05PM

My tables (not all fiels, but the importent ones for the select)


CREATE TABLE `medialib` (
  `id`                  int AUTO_INCREMENT NOT NULL,
  `guid`                varchar(50),
  `artist`              varchar(255),
  `title`               varchar(255) ,
/* Keys */
  PRIMARY KEY (`id`)
) ENGINE = MyISAM;

CREATE FULLTEXT INDEX `medialib_IndexArtist`
  ON `medialib`
  (`artist`);

CREATE FULLTEXT INDEX `medialib_IndexGUID`
  ON `medialib`
  (`guid`);


CREATE TABLE `songstation` (
  `id`                   int AUTO_INCREMENT NOT NULL,
  `guid`                 varchar(50),
  `stationguid`          varchar(50),
  `songguid`             varchar(50),

/* Keys */
  PRIMARY KEY (`id`)
) ENGINE = MyISAM;

CREATE FULLTEXT INDEX `songstation_IndexSongGuid`
  ON `songstation`
  (`songguid`);

In short an entry in 'medialib' can have one ore more references in 'songstation' defending on who parent it.

So in my select I tell with 'songstation' is the parent, then I get the data from 'medialib' selected by first name in artist and sorted by artist.

hope that helped.

Options: ReplyQuote


Subject
Written By
Posted
Re: Slow answer when using ORDER BY
March 15, 2009 03:05PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.