0

I'm having some major issues with my sqlite database performance. I'm using it for storing small amount of data, which should be really fast, but somehow takes way too long. First of all, I create Zend_Db object with factory static method:

$this->db = Zend_Db::factory('PDO_SQLITE', $params);

Afterwards I run some simple query:

$this->db->query($q)

And here goes time from logs:

2012-04-26 13:08:06.752855 : UPDATE session SET value='542M',timeStamp='1335438486' , type='999',ip='62.21.30.77' WHERE name='code1' AND id_session='8fac3359f5c352b64a807745667746ce' 0.1453s

0.1453s seems really huge for such simple query. Moreover sometimes similar queries last almost 0.5s.

The database have created indexes.

Any ideas what might be the issue? Or is this how Zend_Db works with sqlite?

  • Some more facts - system works as Soap server. Just tested the very same queries without soap client (just called those methods from controller) and it's way faster (from 0.002s to 0.05s). Now I'm even more confused :) – Maciej Jaśniaczyk Apr 26 '12 at 12:56
  • How big is your db file at this point? For session data this can grow quite quickly – Adrian World Apr 26 '12 at 13:25
  • 1000 records. Each record is deleted after 24h so it won't grow enormously – Maciej Jaśniaczyk Apr 26 '12 at 13:33
  • Huh, I don't have any problems with my SQLite db but in general these are not updates. What about your server; disk I/O may also be a factor here. Zend_DB does nothing magic btw, so the problem is really more with using SQLite. – Adrian World Apr 26 '12 at 13:39
  • Both updates and inserts work this way. Server is fine - there are other, not zend based, applications and these work rly fast. I'm thinking it's rather Zend Soap Server issue rather then SQLite after all - 0.002-0.05s is quite typical for single insert/update isn't it? (in single transaction) – Maciej Jaśniaczyk Apr 26 '12 at 13:43
  • It must be zend soap server issue - Just tested 10 request as controller action from server itself, and from WS client. 0.2-0.3s for 1st test, 10-15s for 2nd. Thanks for answer then - will keep looking for different problem solution now :P – Maciej Jaśniaczyk Apr 26 '12 at 13:50

0 Answers0