You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
1. 概要 SQLiteを使うと小さなBLOB(例:サムネイル画像など)を読み書きする場合、fread()やfwrite()を使って個別のファイル上に記録されたBLOBを読み書きするよりも35%も速く (*1) 読み書きができます。 さらに、10キロバイトのBLOBを扱うようなSQLiteデータベースを考えた場合、個別のファイルにそれぞれのBLOBを格納する場合に比べてディスク領域を約20%も節約可能です。 このようなパフォーマンスの差が生じる理由は、(私たちの考えでは)SQLiteデータベースの場合、open()やclose()システムコールが呼び出されるのが1回だけなのに対して、個別のファイルに格納されているBLOBを使用する場合は、open()やclose()がBLOBの数だけ呼び出されるためだと思われます。どうやらopen()とclose()を呼び出すオーバーヘッドは、データベース
As part of an iPhone SDK project, I have an sqlite database with a table full of geographic locations, each stored as a latitude and longitude value in degrees. I wanted to be able to perform an SQL SELECT on this table and ORDER BY each row’s distance from an arbitrary point. I’ve achieved this by defining a custom sqlite function. This article contains the code for the function, together with in
sqlite3にはlog関数がない。 ただ、SQLite3 Contributionsというのがあって、そこにextension-functions.cがある。これを使えればlog/log10だけじゃなくて、 Provide mathematical and string extension functions for SQL queries using the loadable extensions mechanism. Math: acos, asin, atan, atn2, atan2, acosh, asinh, atanh, difference, degrees, radians, cos, sin, tan, cot, cosh, sinh, tanh, coth, exp, log, log10, power, sign, sqrt, square, ceil, floo
Information and Links Categories iDevices Information October 25th, 2008 31 Responses Feeds and Links Comment Feed From This Author Other Posts Stripping out a set of characters from an NSString Range.intersectsNode, Mozilla and WebKit As part of an iPhone SDK project, I have an sqlite database with a table full of geographic locations, each stored as a latitude and longitude value in degrees. I w
まえがき ある日突然Twitterで@TeamMOSA2さんが@glassonion1さんのつぶやきをリツイットしてくれました。なんか面白そうなイベントだなと思って、 すぐにATNDに参加しました。時期が早かった!6人目になって、自動的に12月6日の担当になってしまいました。しかし、製作中のtuneTVの新しいバージョンがサブミット予定日辺りなので、無理やりに@glassonion1にお願いして、12月12日にリスケして頂きました。本当にありがとうございます。 前回は@happy_ryoさんの記事:XCodeからappCodeへ乗り換える8つの理由でした。面白い記事ので、ぜひご覧ください。 さて、今回僕の記事はSQLiteを使って、全文検索をする方法を紹介しようと思っています。皆さんに少し役に立てばと思います。 えぇ?SQLiteを使って全文検索ができるの? SQLiteがFTSをサポート
Android 2.1のSQLiteにはsin, cos関数がないため例示されているMySQLでの経度緯度からの距離検索はそのままの形では利用できない。解決のヒントをもとに実装したので要点まとめ。 ▼元の公式からクエリに利用できる形へ変換 距離 = C * acos ( sin(lat)*sin(qlat)+cos(lat)*cos(qlat)*cos(lng-qlng) ) [lat, lng] 座標1の緯度経度(DB内を想定) …青字はDB格納時に予め算出できる部分 [qlat, qlng] 座標2の緯度経度(基準位置を想定) …緑字はクエリ投入時に算出できる部分 C=6371 (距離の単位がkmの場合) または 3959 (単位がmiの場合) cos(a-b) = cos(a)*cos(b)+sin(a)*sin(b) なので、 距離 = C * acos ( sin(lat)*si
研究でSQLiteを使ってる。ファイル1つでポータブル、受け渡しも楽だしバージョン管理もできるし割りと気に入ってる。 日付のデータを大量に扱うのが遅くて困ったので速くする方法を調べた。ちゃんとインデックスが効くようにしたい。 SQLite3 には、SQL99 の DATE や DATETIME に対応する日時を表す型は存在しません。SQLite3 で日時を扱う場合、Date And Time Functions で説明されている日付処理関数を使用し、TEXT 型や NUMERIC 型の列に日付データを作成します。 http://www.tamandua-webtools.net/sqlite3-date.html TEXTを使う場合では、YYYY-MM-DD HH:MM:SSみたいな書式の文字列を日付とみなす。 NUMERIC(INTEGER or REAL)はよくあるUnixエポックから
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く