タグ

databaseに関するtaketyanのブックマーク (5)

  • Reddit - Dive into anything

    Accidentally destroyed production database on first day of a job, and was told to leave, on top of this i was told by the CTO that they need to get legal involved, how screwed am i? Today was my first day on the job as a Junior Software Developer and was my first non-internship position after university. Unfortunately i screwed up badly. I was basically given a document detailing how to setup my l

    Reddit - Dive into anything
    taketyan
    taketyan 2017/07/04
    大学卒業後の入社初日に本番データベース吹っ飛ばして CTO から裁判持ちかけられてる人。GitLab のデータベース吹っ飛ばした Database (removal) specialist が色々フォローしてくれてる
  • Goodbye MongoDB, Hello PostgreSQL

    Olery was founded almost 5 years ago. What started out as a single product (Olery Reputation) developed by a Ruby development agency grew into a set of different products and many different applications as the years passed. Today we have not only Reputation as a product but also Olery Feedback, the Hotel Review Data API, widgets that can be embedded on a website and more products/services in the n

  • 主キーはインデックスではない - 設計者の発言

    仕事柄、奇妙なDB構造を目にすることが多い。どういう発想からそんな設計がされるのかを理解したいと思っていたのだが、モデラー仲間の秋里さんが先日うまい指摘をした。「主キーをインデックスみたいなものと勘違いしているからではないでしょうか」。インデックス(キー)というのは、レコードの並び順を規定するキーのことだ。 たしかに思い当たる節がある。「こんな順にレコードが並んでいれば処理上都合がよさそうだ」という考えで主キーが設定される。さらに主キーはユニーク制約でもあるので、重複が起こらないように「多め」に項目を突っ込んでおく。つまり「ユニーク制約をともなう代表的インデックス」程度に主キーが理解された結果として、グダグダなDB構造が出来上がるのではないか。 じっさい、昔こんなことがあった。{a,b,c,d}の複合主キーをもつテーブルXがある。ところが、別のテーブルYからテーブルXの特定レコードにアクセ

    主キーはインデックスではない - 設計者の発言
    taketyan
    taketyan 2014/08/28
    難しくてあんま理解できてないけど、データベースは単なるデータの入れ物じゃない、ってことは常に意識してる。現実世界のオブジェクトを表現するようにして、同一性は PK の id でのみ判別。
  • MySQL :: MySQL 8.0 Reference Manual :: 10.2.1.19 LIMIT Query Optimization

    Optimizing Subqueries, Derived Tables, View References, and Common Table Expressions

    taketyan
    taketyan 2014/03/25
    "MySQL ends the sorting" じゃなくて正しくは "MySQL ends the fetching" なのかな。MySQL ドキュメントの間違いどこから報告したらいいんだ。 http://karupanerura.hateblo.jp/entry/2014/03/24/200850
  • ORDER BY狙いのキーが何故速いか - 時計を壊せ

    どの最適化が効くんや…とググった。 以前も調べた気がしたが思いだせず、ひたすらググる羽目になったので、 反省してブログに残す。ふつーにmysqlのdocumentに書いてあった。 http://dev.mysql.com/doc/refman/5.7/en/limit-optimization.html If you use LIMIT row_count with ORDER BY, MySQL ends the sorting as soon as it has found the first row_count rows of the sorted result, rather than sorting the entire result. If ordering is done by using an index, this is very fast. バージョン古いけど日語のほ

    ORDER BY狙いのキーが何故速いか - 時計を壊せ
    taketyan
    taketyan 2014/03/25
    非クラスタ化インデックスだとクラスタ化インデックスと比べて余計な I/O が発生する分性能的には劣るけど、ORDER BY 狙いのキーが有効なのは変わんないという認識でいるけどどうなんでしょう
  • 1