MySQL Forums
Forum List  »  PHP

Re: Seeks Improved Efficency: Redundant Query Data
Posted by: Rick James
Date: May 06, 2013 09:05PM

Please explain the purpose of two date-like fields in your first table.

> $sql = "SELECT * FROM `cartoonplanet`.`cp_details`\n" .
"WHERE `details_toonname` LIKE \'TOON_NAME\' ORDER BY `cp_details`.`details_pk` " .
"ASC LIMIT 0, 30 ";

If the toon_name is to be an exact match, use "=", not "LIKE". LIKE allows for wildcards, and is more costly to execute.

> `details_fk` int(11) NOT NULL COMMENT 'insert foreign key',
MyISAM does not handle FOREIGN KEYs; perhaps you want to switch to InnoDB?

> . ' WHERE `details_date` = \'XXXX-XX-XX\';';
There is only one row per day? (I ask because it seems unusual, and I have no concept of the game you are modeling.)

Options: ReplyQuote




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.