• Email
  • Favorite
  • Download
  • Embed
  • Private Content

Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Sql Antipatterns Strike Back

by Karwin Software Solutions LLC on Apr 21, 2009

  • 50,639 views

Common blunders of SQL database design, queries, and software development. Presented as a tutorial at the MySQL Conference & Expo 2009.

Common blunders of SQL database design, queries, and software development. Presented as a tutorial at the MySQL Conference & Expo 2009.

Accessibility

Categories

Tags

sql mysql db antipatterns database sql antipatterns patterns design performance sql patterns mysql antipatterns sql antipatterns strikes back toread programming persistence tree tables practices tips rdbms design-patterns sql anti-pattern bill karwin sql antipatterns bestpractices databasedesign anti-patterns sql antipattern best database patterns hierarchical data arch

More...

Upload Details

Uploaded via SlideShare as Adobe PDF

Usage Rights

CC Attribution-NonCommercial-NoDerivs LicenseCC Attribution-NonCommercial-NoDerivs LicenseCC Attribution-NonCommercial-NoDerivs License

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel

52 Embeds 3,530

http://jdobbie.blogspot.com 1203
http://www.it4business.ru 477
http://pwfisher.com 349
http://www.graph-database.org 272
http://www.coderholic.com 241
http://www.slideshare.net 144
http://blog.meta.ua 128
http://moskalyuk.name 86
http://kupreev.com 73
http://www.stetsenko.net 55
http://jayant7k.blogspot.com 51
http://www.kupreev.com 48
http://www.cs.vsb.cz 44
http://www.blinkoftheday.com 40
http://it4business.ru 40
http://khishigee.miniih.com 34
http://www.khishigee.miniih.com 31
http://lj-toys.com 29
http://rubyrailsandwindows.blogspot.com 29
http://blog.klaushofeditz.de 26
http://www.pwfisher.com 16
http://jdobbie.blogspot.de 12
http://twitter.com 10
http://software-testing.ru 10
http://oo-programming.blogspot.com 8
http://web 8
http://paper.li 5
http://jayantkumar.in 5
http://jdobbie.blogspot.com.au 5
http://jdobbie.blogspot.fr 5
http://hdknr.posterous.com 4
http://www.e-presentations.us 4
http://translate.googleusercontent.com 4
http://xss.yandex.net 4
https://si0.twimg.com 3
http://jdobbie.blogspot.co.uk 3
http://russomi.blogspot.com 3
http://localhost 3
http://rubyrailsandwindows.blogspot.com.au 2
http://jdobbie.blogspot.in 2
https://twitter.com 2
http://jdobbie.blogspot.com.br 2
http://jdobbie.blogspot.ca 1
http://jdobbie.blogspot.mx 1
http://209.85.229.132 1
http://www.miniih.com 1
http://feeds.feedburner.com 1
http://rubyrailsandwindows.blogspot.in 1
http://eddieawad.com 1
http://s.deeeki.com 1
http://graph-databases.org 1
https://twimg0-a.akamaihd.net 1

More...

Statistics

Favorites
123
Downloads
1,665
Comments
13
Embed Views
3,530
Views on SlideShare
47,109
Total Views
50,639

110 of 13 previous next Post a comment

  • md2perpe Per Persson , Developer at Ztorm AB Another solution to the COUNT(...) ... JOIN problem on slides #163 - 173 is to use COUNT(DISTINCT ...). 3 months ago Reply
    Are you sure you want to Yes No
  • md2perpe Per Persson , Developer at Ztorm AB For binary trees I've found a variant of nested sets.

    The idea is to let
    - the root node be represented by the interval [0, 1],
    - the two children of the root node be represented by the intervals [0, 1/2] and [1/2, 1] respectively,
    - the grandchild nodes by [0, 1/4], [1/4, 1/2], [1/2, 3/4] and [3/4, 1].

    Then it's easy to find:
    - the left and right children (one or both),
    - all descendents of a node,
    - all ancestors of a node,
    - all nodes where you only go left (or right) from a given node.
    3 months ago Reply
    Are you sure you want to Yes No
  • md2perpe Per Persson , Developer at Ztorm AB @kimprince: It's not 'O times n times n'. The the Big Oh notation for complexity. It means that the value (in this case the number of rows needed) at worst case is proportional to 'n times n'.

    You can get a more exact definition on Wikipedia:
    http://en.wikipedia.org/wiki/Big_O_notation
    3 months ago Reply
    Are you sure you want to Yes No
  • kimprince kimprince Excellent presentation. Would like to clarify a point on slide 70 though, closure tables. I think it's saying the maximum number of rows is O x n x n. What's O?

    I would have thought that, if there were 10 nodes, the maximum number of rows in the closure table would be 10 x 9 x 8 x 7 x ...etc... No?
    6 months ago Reply
    Are you sure you want to Yes No
  • alf239 Alexey Filippov , Software Engineer at EBI The quote about cat seems to be by Douglas Adams (as quoted by Richard Dawkins) 8 months ago Reply
    Are you sure you want to Yes No
  • willlahr Will Lahr I was talking about closure tables in my last comment 9 months ago Reply
    Are you sure you want to Yes No
  • willlahr Will Lahr This seems to be like a kind of loop unrolling. A recurring loop of queries which depend on previous queries is avoided because the recursion is effectively stored in the loop table. So like everything I guess it's a trade off. More space is used up front to make iterating though later less work. For the example you've used it seems like a really good fit because far more reading than writing goes on, and as you say the size of the closure table doesn't expand as alarmingly as you might expect. This was really useful for what I'm working on, thanks for putting it up. 9 months ago Reply
    Are you sure you want to Yes No
  • yurykrikun Yury Krikun at Медиа-Прайс Great presentation! Many thanks to author. 1 year ago Reply
    Are you sure you want to Yes No
  • billkarwin Karwin Software Solutions LLC at Karwin Software Solutions LLC Scott Fraser: thanks, you're right about the corrections to the tree slides. I'll upload the edits soon.

    You're right about CONNECT BY syntax in Oracle. There's also a SQL-2003 syntax for 'common table expressions' that allows you to run recursive queries for Adjacency List tree designs (among other uses). As far as I know, Microsoft SQL Server, IBM DB2, and the recently released PostgreSQL 8.4 support this syntax (see http://wiki.postgresql.org/wiki/CTEReadme).
    2 years ago Reply
    Are you sure you want to Yes No
  • nine_k Dmitry Cheryasov , Software Developer at JetBrains Just awesome. More DB developers should view this :) 2 years ago Reply
    Are you sure you want to Yes No
Post Comment
Edit your comment Cancel

Sql Antipatterns Strike Back — Presentation Transcript