*既存のDBを用いてRailsアプリケーションを立ち上げる Railsでは、ヘルプや本の手順どおり構築しようとすると、DBは新たに新規作成するパターンで教わる。 でも実際の仕事ではDB設計が先→Railsアプリケーションが後、も当たり前のように必要となるため、その手順について調べてみた。 ちなみにテスト環境は、AptanaStudio + InstantRails1.7 、よってDBはMySQLです。 *大まかな手順 **既存のDBからスキーマ情報を取り込む Railsの rake コマンドには、構築済みDBのスキーマ情報をRails表現で吸い出してくれるコマンドがある。 http://tam.qmix.org/wiki/Migration.html ***手順 ※データベース名を db1 とする +Rails Project を作成 (プロジェクト名:sample とする) +datab
外部キーの削除がALTERのリファレンスに無かったんで調べてみたら過去のニュースにヒントがあった。 InnoDB が ALTER TABLE DROP FOREIGN KEY をサポートするようになった。外部キーを破棄する場合は、SHOW CREATE TABLE を使って、内部で生成された外部キー ID を検出する必要がある。 http://dev.mysql.com/doc/refman/4.1/ja/innodb-news-4-0-13.html -- 外部キーID名を参照する。 SHOW CREATE TABLE tbl_title;↑を実行すると↓の結果が返ってくる。この場合だと外部キーIDはfk_tbl_title_tbl_categoryになる。 : CONSTRAINT `fk_tbl_title_tbl_category` FOREIGN KEY (`category_i
See related links to what you are looking for.
This webpage was generated by the domain owner using Sedo Domain Parking. Disclaimer: Sedo maintains no relationship with third party advertisers. Reference to any specific service or trade mark is not controlled by Sedo nor does it constitute or imply its association, endorsement or recommendation.
This guide covers the association features of Active Record. After reading this guide, you will know how to: Declare associations between Active Record models. Understand the various types of Active Record associations. Use the methods added to your models by creating associations. 1 Why Associations?In Rails, an association is a connection between two Active Record models. Why do we need associat
ウィリアムのいたずらが、街歩き、食べ物、音楽等の個人的見解を主に書くブログです(たま~にコンピューター関係も) OpenOfficeの話で、いままで印刷とデータベースの話を書いたので、2つあわせて データベース(Base)の内容を、表計算(Calc)に書いて印刷するマクロについて取り上げてみます。 ■仕様 ●C:¥temp¥テスト.ods(¥は、本当は半角)にあるOpenOffice Calc(表計算)の"テスト"というシートを開き、 ●データベース名が"テスト用"という名前の、データベースをアクセスして、 "Select * From 顧客テーブル" を実行して、顧客テーブルの内容を受け取り ●DBの内容を 1項目目をA桁、 2項目目をB桁、 3項目目をC桁、 4項目目をD桁、 に、1行目から、1レコードづつ、順に、上記の「テスト」というシートに書いて 印刷する ■ソース ソースはこんな
第一種過誤(だいいっしゅかご、英: Type I error)または偽陽性(ぎようせい、英: False positive[1])と第二種過誤(だいにしゅかご、英: Type II error)または偽陰性(ぎいんせい、英: False negative[2])は、仮説検定において過誤を表す統計学用語である。第一種過誤をα過誤(α error)やあわてものの誤り[3]、第二種過誤をβ過誤(β error)やぼんやりものの誤り[3]とも呼ぶ。なお「過誤」とは、誤差によって二項分類などの分類を間違うことを意味する。 統計的過誤と系統過誤[編集] 過誤は次の2種類がある[注釈 1]。 統計的過誤(Statistical error) 計算や計測で得られた値と真の理論上の値との誤差が、無作為で本質的に予測不可能な変動によって生じている場合[注釈 2]。 系統過誤(Systematic error)
Distributed key-value database Features Built on Tokyo Tyrant. One of the fastest key-value databases. Tokyo Tyrant has been in development for many years and is used in production by Plurk.com, mixi.jp and scribd.com (to name a few)... Great performance (comparable to memcached!) Can store millions of keys on very few servers - tested in production Scale out by just adding nodes Nodes are replica
MySQL 5.1からデフォルトで有効になっている便利な機能としてプロファイリングというものがある。MySQL 5.0でも利用出来たのだが、実験的な機能という位置づけであり、搭載されていたのはGPL版のMySQL Community Server限定だった。MySQL 5.1からは全てのエディションでプロファイリングを利用することができる。 プロファイリング機能を利用すると、クエリの状態(特に状態遷移やリソースの消費状況)を詳細に分析できるのでとても便利だ。MySQLエンジニア必携の機能といって良いだろう。というわけでプロファイリング機能の使い方を説明しよう。 MySQLサーバにログインしたら、まずは次のようにしてプロファイリングを有効にする。 mysql> SET profiling=1; すると、クエリの情報が記録されるようになる。次に、分析したいクエリを実行する。クエリはなんでもいい
もう完璧にうまく行った!と喜んでいた、アクセスログ解析の「AWStats」だが、実はデータが5/12からの1週間ちょっとしか表示されていないことが気になった。 過去のログを取り込むため、「いつものサイト」に従って、AWStatsデータベースの初期作成もバッチリおこなったはずなのに…。 試しに何回か繰り返してみたが、新しいデータが追加されるばかりだ。どうやら、最初に設定でつまずいたとき、最新のログしか処理できてなくて、それ以降は何をどうやっても、それより新しいデータしか入って行かないようなのだ。 そうと判れば、データベースを何とか初期化して作り直すしかなさそうだ。どうやれば初期化できるのかググってみたが、明確な答えは得られない。 そもそもデータベースはどこに作られるのか、一番最初に編集した設定ファイルをながめてみると、 DirData="/var/lib/awstats" とある。早速このデ
多くのベンチャー企業が起業後に、同じような失敗、トラブル、ヒヤリとした経験をしており、成長に伸び悩む企業が多いと言われています。そこで、ベンチャー企業の経営者が様々な場面で決断を下す際の「転ばぬ先の杖」として、将来起こりうるリスクを予見できるような失敗、トラブル、ヒヤリとした経験の事例を収集・データベース化しました。ベンチャー企業の成長に向けた経営判断の材料としてご利用いただければ幸甚に存じます。 本データベースには、平成19年度にベンチャー企業にインタビュー調査を実施して収集した83の失敗、トラブル、ヒヤリとした経験に関する事例を掲載しています。事例は、ベンチャー企業の成長ステージや失敗、トラブル、ヒヤリとした経験の原因及び結果といった分類項目をもとに検索が可能となっています。
Update 4:: Introducing Digg’s IDDB Infrastructure by Joe Stump. IDDB is a way to partition both indexes (e.g. integer sequences and unique character indexes) and actual tables across multiple storage servers (MySQL and MemcacheDB are currently supported with more to follow). Update 3:: Scaling Digg and Other Web Applications. Update 2:: How Digg Works and How Digg Really Works (wear ear plugs). Br
This section does not cite any sources. Please help improve this section by adding citations to reliable sources. Unsourced material may be challenged and removed. (June 2013) (Learn how and when to remove this message) The system uses a client–server architecture. The servers maintain a key–value associative array; the clients populate this array and query it by key. Keys are up to 250 bytes long
Appleの07年度第3四半期決算が発表されました。地域別のMacの出荷台数を見ると、欧米のほうが日本より伸び率が高いんですね。話はガラッと変わりますが、ウチの3歳の娘が、幼稚園で覚えてきたのか事あるごとに「欧米か!」を連発して困ります……。 さて、今回は「SQLite」について。Tiger/Spotlightの登場以降、急速に増えつつあるSQLite内蔵アプリケーションの一端を知ろう、という主旨だ。 SQLiteを使うというトレンド SQLiteは、スタンドアロンのデータベース管理ソフト(DBMS)。名前が示すとおり、PostgreSQLやMySQLなどと同じSQL構文を使うDBMSだが、サーバとしてシステムに常駐することはなく、ライブラリとして他のアプリケーションから呼び出される形での利用が一般的。大規模なDBの管理こそ不向きだが、SQLの命令やトランザクション処理を実行できる。
いろいろな本からメモってきたメモのメモ。出典を書いておくのを忘れた。思い出し次第補完するかも。 deleteのコストは高いので、無効化を示すフィールドを作ってupdateすべき slow query logに要注意 多くのエントリでほとんどのフィールドが同じ値を持つ場合はインデックスの効果が小さい →複合インデックスの効果が大きい 複合インデックスは指定の順番が大切。AとBという指定の場合、A単独でもインデックスの効果がある。逆は真でない。 インデックスが使われる場面は フィールド値を定数と比較するとき (where name = 'hogehoge') フィールド値でJOINするとき (where a.name = b.name) フィールド値の範囲を求めるとき (<,>,between) LIKE句が文字列から始まるとき (where name like 'hoge%') min(),
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く