I've compiled the latest version of SQLite with the patches from sqlite3_3.6.14-1maemo4+0m5 and uploaded the debs and the source code to drop box. (Is this the preferred place to upload it?)
Below is a speed quick comparison:
The select statements just show how many times you've missed a call from a specified phone number (I've edited out the remote uid).
Code:
--.stats on /* 3.6.14.1 doesnt have stats */
.explain on
.timer on
SELECT COUNT(*) FROM EVENTS
JOIN EVENTTYPES ON EVENT_TYPE_ID = EVENTTYPES.ID
WHERE EVENTTYPES.NAME = 'RTCOM_EL_EVENTTYPE_CALL_MISSED'
AND REMOTE_UID = '+xxxxxxxxxxx'
AND LOCAL_UID = 'ring/tel/ring'
AND EVENTS.ID > (
SELECT CASE MAX(events.id) IS NOT NULL WHEN 1 THEN MAX(EVENTS.ID) ELSE 0 END
FROM EVENTS
JOIN EVENTTYPES ON EVENT_TYPE_ID = eventtypes.id
JOIN services ON service_id = services.id
where services.name = 'RTCOM_EL_SERVICE_CALL'
AND REMOTE_UID = '+xxxxxxxxxxx'
AND LOCAL_UID = 'ring/tel/ring'
AND EVENTTYPES.NAME != 'RTCOM_EL_EVENTTYPE_CALL_MISSED');
SELECT COUNT(*) FROM EVENTS, EVENTTYPES
WHERE EVENT_TYPE_ID = EVENTTYPES.ID
AND EVENTTYPES.NAME = 'RTCOM_EL_EVENTTYPE_CALL_MISSED'
AND REMOTE_UID = '+xxxxxxxxxxx'
AND LOCAL_UID = 'ring/tel/ring'
AND EVENTS.ID > (
SELECT IFNULL(MAX(events.id),0)
FROM EVENTS, eventtypes, services
Where EVENT_TYPE_ID = eventtypes.id
and service_id = services.id
and services.name = 'RTCOM_EL_SERVICE_CALL'
AND REMOTE_UID = '+xxxxxxxxxxx'
AND LOCAL_UID = 'ring/tel/ring'
AND EVENTTYPES.NAME != 'RTCOM_EL_EVENTTYPE_CALL_MISSED');
Results:
Code:
Before (3.6.14.1):
COUN
----
0
CPU Time: user 0.039063 sys 0.000000
COUN
----
0
CPU Time: user 0.000000 sys 0.000000
After (3.5.0):
COUN
----
0
Run Time: real 0.025 user 0.015625 sys 0.000000
COUN
----
0
Run Time: real 0.030 user 0.000000 sys 0.000000
I was going to test memory usage but stats weren't implemented until 3.3.8.1.
I've compiled the latest version of SQLite with the patches from sqlite3_3.6.14-1maemo4+0m5 and uploaded the debs and the source code to drop box. (Is this the preferred place to upload it?)
Download:
https://www.dropbox.com/sh/oqizqlps5...EdfpcKfaPmqQda
To install:
The select statements just show how many times you've missed a call from a specified phone number (I've edited out the remote uid).
You can look up the changes if you have time to kill (The one in the repo is 3.6.14.1)
http://www.sqlite.org/changes.html