OurSQL Episode 22: Things To Avoid With MySQL Querie

Feature:

Things to Avoid in Queries
Subqueries and Correlated subqueries
http://dev.mysql.com/doc/refman/4.1/en/correlated-subqueries.html

Jan Kneschke’s post on Groupwise Maximum:
http://jan.kneschke.de/projects/mysql/groupwise-max

Calculated comparisons do not use indexes

INSERT IGNORE
REPLACE
INSERT…ON DUPLICATE KEY

Feedback:

Email podcast@technocation.org">podcast@technocation.org

call the comment line at +1 617-674-2369

use Odeo to leave a voice mail through your computer:
http://odeo.com/sendmeamessage/Sheeri

or use the Technocation forums:
http://www.technocation.org/forum

Direct play this episode at:
http://tinyurl.com/ywr6nt

Trackback URL for this post:

http://technocation.org/trackback/93

Calculated comparisons do

Calculated comparisons do not use indexes:
http://blog.adaniels.nl/?p=36

Can anyone tell me why to avoid INSERT IGNORE, REPLACE and INSERT…ON DUPLICATE KEY? I can't imagine that a SELECT, than splitting out rows which should be updated/skipped and then and INSERT and/or UPDATE would be quicker. Of course it isn't fair to compare it with a plain INSERT call, because it doesn't accomplish the same.

Ah, this is a potcast and it

Ah, this is a potcast and it would be smart to listen to it first before making a comment. (do I feel stupid now :s )

The postcast explains about INSERT IGNORE, REPLACE and INSERT…ON DUPLICATE KEY. It is not about how to avoid it, like the title might let you think.

Arnold -- Don't worry about

Arnold -- Don't worry about it. That's why these are "show notes" -- just notes, so to get the whole context you have to listen to the podcast.

I probably should have said "Avoid an extra SELECT by using INSERT IGNORE, REPLACE or INSERT....ON DUPLICATE KEY".

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may use <swf file="song.mp3"> to display Flash files inline
  • Avast! This website be taken over by pirates on September 19th. Yarr!
  • Each email address will be obfuscated in a human readable fashion and replaced with a spamproof clickable link, without loosing the mailto URL scheme semantics and operations.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

Captcha
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
2 + 7 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.