Note that the measurements in the paper were made before they fixed a bug where they confused bits and bytes. So SQLite only used 1/8 of the reserved bloom filter space, thus increasing the false positive rate significantly: https://sqlite.org/src/info/56d9bb7aa63043f5 I found and reported the bug because I wanted to know how the bloom filters work in SQLite for my uni seminar paper. Still wondering if one can find t…
How bloom filters made SQLite 10x faster
61–70 of 127 posts
Re: How bloom filters made SQLite 10x faster
#62Note that the measurements in the paper were made before they fixed a bug where they confused bits and bytes. So SQLite only used 1/8 of the reserved bloom filter space, thus increasing the false positive rate significantly: https://sqlite.org/src/info/56d9bb7aa63043f5 I found and reported the bug because I wanted to know how the bloom filters work in SQLite for my uni seminar paper. Still wondering if one can find t…
On top of that I don't think it's fair to say it's 10x faster when it btree was tested only on integer index primary key column. Benchmarks with that bold statements should include short string (1-16 chars maybe) and UUID indexes at least.
Re: How bloom filters made SQLite 10x faster
#63What happens if the table is one with a big number of deletes? The Bloom filter false positive rate will keep increasing as time goes on. One way to address this is to recalculate it every n deletes, but this sounds similar to AUTOVACUUM issues in PostgreSQL and might result in unexpected drops in performance
Another option is a cuckoo filter; it is like a bloom but allows deletion
Re: How bloom filters made SQLite 10x faster
#64Earlier quoted context omitted.
Maybe not such a great fit for sqlite: > One of the challenges with binary fuse filters, is that they are immutable once populated, so data cannot be added incrementally, and they consume a significant amount of memory during the populate process
You can convert static data structures like these into dynamic ones with about a logarithmic slowdown. So it might still be worthwhile. (You could also combine a static filter with a dynamic bloom filter in front. A bit like generational garbage collection.)
A recent paper trying to systematically apply the idea to databases "Towards Systematic Index Dynamization" ( https://bpb-us-e1.wpmucdn.com/sites.psu.edu/dist/b/123163/fi... )
Re: How bloom filters made SQLite 10x faster
#65Earlier quoted context omitted.
On top of that I don't think it's fair to say it's 10x faster when it btree was tested only on integer index primary key column. Benchmarks with that bold statements should include short string (1-16 chars maybe) and UUID indexes at least.
Why do you want a UUID index? Use an integer index and have the UUID in another column.
Re: How bloom filters made SQLite 10x faster
#66> SQLite does Nested Loop join Only that? Never anything better? Really? EDIT: Really. Section titled Joins here https://sqlite.org/optoverview.html states: "SQLite implements joins as nested loops." That's quite shocking. While doing MySQL and Postgres when nested loop showed up in EXPLAIN in almost all cases I knew I botched my query and/or indexes.
If you mean in mysql explain: "Using join buffer (Block Nested Loop)", its not slow because nested loop algorithm is being used, its slow because of the join buffer part, which is an optimization used when its not possible to immediately get the right row of the inner table via an index. As far as i know (might be wrong,im not really familiar with mysql internals), mysql (like sqlite) generally uses nested loop joins…
Though I remember one instance where while using MySQL in a web app it turned out that N+1 was faster than doing a JOIN.
Re: How bloom filters made SQLite 10x faster
#67Re: How bloom filters made SQLite 10x faster
#68Earlier quoted context omitted.
Why do you want a UUID index? Use an integer index and have the UUID in another column.
Because if you want to refer to things by a UUID, now you have two indexes
Re: How bloom filters made SQLite 10x faster
#69Re: How bloom filters made SQLite 10x faster
#70Earlier quoted context omitted.
Because if you want to refer to things by a UUID, now you have two indexes
UUIDs are very wasteful [1]. For most use cases you can replace them with much shorter strings and still have very low chances of collisions [2] [1] https://henvic.dev/posts/uuid/ [2] https://alex7kom.github.io/nano-nanoid-cc/