• Welcome to SQLitening Support Forum.


Welcome to the SQLitening support forums!

Main Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Jos? Roca

Registration and properties are requirements of visual designers. If they aren't registered, the visual designer can't display a list of controls available to let you pick one and couldn't initialize it if you don't introduce first the path and the ClsID, that they retrieve from the registry. Properties are used to allow you to enter individual values at design time.

Both COM servers and ActiveX controls can be used without registering them first. In the case of visual ActiveX controls, the OLE container must allow to accept a path and a ClsID instead of a ProgID.
Internally, the "fast" query is using sqlite3_prepare() and sqlite3_step until all records are returned when it finally calls sqlite_finalize. The "slow" query is using sqlite3_get_table to get all of the records into memory at one time (this is the approach that I use and most other sqlite database managers use). The benefit is that after the query executes you will know exactly the number of returned rows. Using the other method you will not know the number of rows until you iterate through the entire recordset. A downside of the sqlite3_get_table approach is that the whole recordset is created in memory.... what if your query retruns a billion records? Ouch, I expect that the query would then fail whereas the other approach would continue to work. There are pros and cons with both approaches.

Obviously, the most efficient method with queries that will return many results is to use sqlite3_exec and a callback function, since sqlite only will allocate memory for a record. Yes, you won't know the number of returned rows until you have retrieved all the records, but calling sqlite3_get_table you won't get anything until sqlite has done this work for you. So you will end waiting the same amount of time and using much more memory. No doubt sqlite3_get_table is nice for small queries, but not for big queries, specially when you don't need to know the number of records in advance or to store the information in memory, but simply send it to a printer or a file.