5 ms·
Not sure if SQLite is still a 'lite' database
by Dinux 8y ago
Not sure if SQLite is still a 'lite' database
- felixge 8y agoIn the category of SQL databases, it certainly is. I mean it's not called LiteDB for a reason I suppose ;).
- MarkusWinand 8y agoI've just built the snapshot. The binary is still less than 2MB. And it works: sqlite> with t(x) as (values (1), (2)) select sum(x) over (order by x) from t; 1 3
- unixhero 8y agoInsightful. Thanks!
- davidgould 8y agoI just checked a stripped copy of postgresql-10 built with all options on and it is 7MB. That could be reduced a little by leaving out language support and ssl support etc.
- est 8y agoDo you have tutorials to strip lang and ssl? Is it possible to dynamic link system openssl to reduce size?
- davidgould 8y agoIf you look at the build instructions you will see that in the ./configure step you can enable and disable different features. Try ./configure --help to get a list. It is dynamically linked to openssl, but you can configure out the internal code to support the functionality. "strip" however meant the unix strip command to remove debug symbols.
- plq 8y agoWhile binary size could certainly be a factor in a good deal of embedded environments, we also need to look at the resource requirements of the binary in question as well. Sqlite doesn't need too much more memory than what its binary needs whereas with postgresql, you need all sorts of bells and whistles just to get the database system to boot.
- davidgould 8y agoWell, sure, sqllite is smaller than postgres, but database system performance is largely dictated by the size of the buffer cache. For something like a configuration database (a great use of sqllite) this does not matter. But for more than a very modest amount of data more memory for buffers will benefit both postgresql and sqllite. Anyway, not trying to make the case that postgresql is small compared to sqllite, it obviously isn't, just wanted to point out that it's not _that_ big either.
- mamcx 8y agoAnd how possible to embeb it in a mobile device? Too crazy, I imagine...
- interfixus 8y agoI just had a look at the executable of my latest - extremely simple - webapp. A 64 bit elf, statically linked with Musl libc and SQLite, written in Nim. 1.4MB all told, with no optimizations whatsoever. In the year 2018 AD, we count that as light.
- MrEfficiency 8y agoInteresting, I noticed how big my database file was as well. I considered the Lite meant offline storage. Still a huge fan, I went from noob programmer to knowing databases because how quickly I could make and play with databases in sqlite.
- cryptonector 8y agoThe "lite" refers to things like: - it only has b*-tree indexes - it only has one index per-table source
- SQLite 8y ago> it only has one index per-table source I don't know for sure what this means, but it sounds like it is incorrect.
- cryptonector 8y agoI could swear I've seen you say this. Maybe I'm mis-remembering? ISTR it was that for each table source in a query SQLite3 uses just one index (or the table itself) for indexing or scanning to find relevant rows in that table source.
- SQLite 8y agoSQLite can use multiple indexes if there are OR terms in the WHERE clause. SQLite tries to only uses indexes in situations where they help the query run faster. SQLite is not limited in its use of indexes. It is just that the use of multiple indexes for a single FROM-clause term is rarely helpful.
- cryptonector 8y agoAh, OK, thanks!
- amyjess 8y agoTo me, what makes it 'lite' is that it doesn't have a client-server architecture that requires a running daemon. It's just a file format and a library designed to interact with it.