From: Chris Jaekl Date: Tue, 5 Dec 2017 13:24:49 +0000 (+0900) Subject: Track SQL statement execution times, so that they can be profiled. X-Git-Url: http://jaekl.net/gitweb/?p=quanlib.git;a=commitdiff_plain;h=872d620121706ad345b7e667521be1c7326c2e00 Track SQL statement execution times, so that they can be profiled. As it happens, this revealed one missing index (primary key on the EFS table was not declared). Fixing that offers a modest speed-up. --- diff --git a/store.rb b/store.rb index 69e1278..bf24b0e 100644 --- a/store.rb +++ b/store.rb @@ -3,6 +3,7 @@ require 'csv' require 'fileutils' require 'inifile' require 'pg' +require 'tconn' require 'series' @@ -33,7 +34,8 @@ class Store def connect # @conn = PGconn.connect('localhost', 5432, '', '', 'quanlib', 'quanlib', 'quanlib') - @conn = PG.connect(@dbhost, @dbport, '', '', @dbname, @dbuser, @dbpass) + # @conn = PG.connect(@dbhost, @dbport, '', '', @dbname, @dbuser, @dbpass) + @conn = TimedConn.new(PG.connect(@dbhost, @dbport, '', '', @dbname, @dbuser, @dbpass)) return @conn end @@ -90,7 +92,7 @@ EOS create_efs = <