目的 PerlでSQLiteとCSVのどちらを使ったほうが検索が速いかを検証する 検証方法 データの最後尾にあるレコードを検索する際の速度を比べる。 DBの検索項目にはIndexを追加した。 結果 1秒間に実行できる回数(回数が多いほど高速) CSVSQLite 100件3333回714回 1,000件333回666回 10,000件33回714回 100,000件3回714回 SQLiteはIndexで検索を行っているので、検索速度がデータ件数に依存しなかった。 CSVの読み込みはデータの件数分順次リードを行っている為、検索速度がデータ件数に依存した。 データが100件の場合は、CSVのほうが速かった。 データが1,000件以上の場合は、SQLiteのほうが速かった。 結論 扱うデータが1,000件以上になってきた場合はSQLite等のDBを使うことを考えたほうが良いかもしれない。 デー