Monday, February 13, 2006

InstantQuery technology

I have developed/invented/discovered (which is the right term here?) a new way to perform queries in the upcoming SQLiteManager 2.0. As an example I have created a database with 2 millions records in the "test" table and I have executed a query like "SELECT * FROM test".

I have tried two of the top sqlite managers application available for Windows (SQLiteSpy and SQLiteAnalyzer) and both fails with with this query (out of memory error, it seems that they try to load the entire RecordSet in memory).

SQLiteManager 1.x was smart enough to change the query to "SELECT rowid FROM test" and then query just for a particular rowid when the row is requested in the ListBox, but even with this smart optimization you have to wait about 90secs. in order to get results from the modified query.

I have now developed a new technology called InstantQuery (thanks to SQLite3ProfessionalPlugin) that enable you to get results in about 0.2 seconds. Yes, true, you query 2 millions of records and you start getting results after 0.2 seconds. Memory requirements for this operations is:
2 millions * 4 bytes = 8MB.

I am quite sure no one can be faster, even if you develop your application in C or in any other language. I think this is the best way to prove that you can develop a blazing fast and fully featured application with REALbasic, just try to be smart with algorithms and just try to hazard with new ideas and concepts.

This new InstantQuery technology will be available to anyone who purchase SQLite3ProfessionalPlugin.
The new SQLiteManager 2.0 will be available this month (OSX, Linux and Windows).

Thursday, February 09, 2006

SQLite3ProfessionalPlugin

I plan to release final version next week (with also RB 5.5 compatibility). In the meantime I have written a small RB project to show you why it is so important to have access to the sqlite3 virtual machine and what real numbers are when it is correctly used.

As a real world test, we have created an sqlite 3 database with 10 columns and 200,000 rows (database size is about 200MB), and we have execute a "SELECT * from test" query.
These are the results of the test:

SQLite3ProfessionalREALSQLDatabase
Memory usage:44 Bytes200 MB
Query Time (sec.):0.000115.879
Time to scan RecordSet (sec.):4.3310.037
Total Time (sec.):4.33115.916


As you can see SQLite3ProfessionalPlugin is always 300% / 400% faster than REALSQLDatabase and it requires about near null memory.

You can run this test yourself, just download the full REALbasic project here (12KB - RB2006 syntax)

I have posted more details in the forum section.