Better HN
topnewbestaskshowjobs
Log inSign up

bluestreak

1,042 karma · joined May 13, 2016 (10y ago) · 171 submissions

www.questdb.io
Submissions

1.

The Windows DLL loader lock: how a Rust thread can hang your JVM(questdb.com ↗)

7 points · by bluestreak · 6mo ago · discuss

2.

A 40-line fix eliminated a 400x performance gap(questdb.com ↗)

370 points · by bluestreak · 10mo ago · 78 comments

3.

A kernel bug froze my machine: Debugging an async-profiler deadlock(questdb.com ↗)

120 points · by bluestreak · 11mo ago · 18 comments

4.

From Rust to reality: The hidden journey of fetch_max(questdb.com ↗)

259 points · by bluestreak · 1y ago · 59 comments

5.

Making a trading Gameboy: A pocket exchange and algo trading platform(questdb.io ↗)

166 points · by bluestreak · 2y ago · 24 comments

6.

Tokio-Rs: Bytes:From_owner(github.com ↗)

1 points · by bluestreak · 2y ago · discuss

7.

We opened a public Discourse forum (and you should too)(questdb.io ↗)

2 points · by bluestreak · 2y ago · discuss

comment 2y ago · link · parent

In certain situations, crossing the JNI boundary can be advantageous. When data resides in "native" memory, outside the Java heap, the coordination of concurrent execution logic can be handled in Java, while the actual execution occurs in C++ or Rust. In this context, the negligible penalty for crossing the JNI boundary once per 10 million rows pales in comparison to the substantial benefits achievable through C++ optimization or CPU-specific assembly.

comment 2y ago · link · parent

this is THE number one question being asked about QuestDB :) There is a thread that might help https://news.ycombinator.com/item?id=37557880

comment 3y ago · link · parent

One of our distribution channels is Maven Central where we ship Java 11 compatible library. Embedded users preclude us from leveraging latest Java features.

comment 3y ago · link · parent

Java tooling was excellent back when QuestDB was started and still is excellent today compared to C++.

12.

Fuzz testing: the best thing to happen to our application tests(questdb.io ↗)

103 points · by bluestreak · 3y ago · 24 comments

comment 3y ago · link · parent

great, we are on the same page! `fallocate()` (or posix one) is called on large swades of file. 16MB default. Not too often to hurt performance. I wonder if zeroing the file with `fallocate()` will result in actual disk writes or is it ephemeral?

comment 3y ago · link · parent

> On x86, and I think every architecture, when you write to a memory mapping that is not already backed by a writable page, the kernel is notified that user code is trying to write. And the kernel needs to fill in the contents of the page, which requires a read if the page isn’t already loaded.

This is very true. Perhaps there wasn't enough context to what the article is describing. The read problem started to occur on database that is subject to constant write workload. Data is flowing in all the time at variable rate. Typically blocks are "hot" and being filled in fully within seconds if not millis.

Zeroing the file is an option to try. QuestDB allocates disk with `posix_fallocate()`, which doesn't have the required flags. We would need to explore `fallocate()`. Thanks.

comment 3y ago · link · parent

It is not always read-write-modify. There is no evidence of this pattern in Ubuntu when there is no memory pressure. Merge occurs when block is partially updated after kenel had lost state of the block, which can happen under memory pressure.

16.

The Inner Workings of Distributed Databases(questdb.io ↗)

175 points · by bluestreak · 3y ago · 27 comments

comment 3y ago · link · parent

I am excited for what Memory API brings. The biggest pain with native memory management for us are "struct" or lack of those. Extremely bug prone memory arithmetic I personally am very motivated to see the back of.

FFI - we need to wait and see how this actually evolves.

We are not looking at any of this just yet. While it is undoubtedly fun, there are few other things we're busy with.

18.

Show HN: QuestDB with Python, Pandas and SQL in a Jupyter notebook – no install(play.questdb.io ↗)

53 points · by bluestreak · 3y ago · 15 comments

comment 4y ago · link · parent

I couldn't agree more. I don't think compiler vectorization is that useful even for columnar (!) database we're building. The specialized JIT doesn't even use AVX512 because too much effort for little to no gain.

comment 4y ago · link · parent

Thank you for sharing the post! I’m vlad, cto of questdb - we went all the way trying to optimize CSV ingestion with io_uring, and ended up benchmarking against some OLAP peers in the process, Any feedback is greatly appreciated !

21.

Compatible and Reproducible DBMS Benchmark(github.com ↗)

1 points · by bluestreak · 4y ago · discuss

comment 4y ago · link · parent

The query Clickhouse picked on does not actually leverage time order. Perhaps clickhouse vendors on this thread can comment on relevance of the date partitioning for this query. My best guess is that it might help the execution logic to create data chunks for parallel scan.

QuestDB does also use partitions for this purpose but we also calculate chunks dynamically based on available CPU to distribute load across cores more evenly

comment 4y ago · link · parent

"fair" means that we comparing apples to apples. Ad-hoc, unindexed predicate, compiled by QuestDB into AVX2 assembly (using AsmJIT) vs same predicate complied by Clickhouse (I'm assuming by LLVM). One can perhaps view this as comparing SIMD-based scans from both databases. Perhaps we generate better assembly, which incidentally offers better IO.

We all understand that creating very specific index might improve specific query performance. Great, Clickhouse geared the entire table storage model to be ultra specific for latitude search. What if you search by longitude, or other column? Back to the beginning.

JIT-compiled predicates offer arbitrary query optimisation with zero impact on ingestion. This is sometimes useful.

What would you offer assuming that we reached out, other than creating an index?

Clickhouse does better than we do in other areas. It JITs more complicated expressions, such as some date functions. It optimises count() queries specifically. For example we collect "found" rowed_ids in an array. Clickhouse does not specifically for count(). We still have work to do. On other hand we ingested this very dataset about 5x quicker than clickhouse, which we left out because article is not about "QuestDB is faster than Clickhouse"

comment 4y ago · link · parent

Full disclosure: I am CTO of QuestDB and I took part in JIT implementation. The quote above is not mine, it was written by Clickhouse staff. "utilizes its full indexing strategy" statement is false and is news to me.

comment 4y ago · link · parent

I am in fact very proud of my team, who worked very hard on both implementation and the article. It is disappointing to read unfounded insults where we made every effort to be fair.

comment 4y ago · link · parent

Our article in question can be found here: https://questdb.io/blog/2022/05/26/query-benchmark-questdb-v...

The intent of the article was to showcase JIT-optimised WHERE clause and we did not use any indexes on QuestDB.

comment 4y ago · link · parent

It does result in cease and desist threats quite often. We have been on the receiving end of one.

comment 4y ago · link · parent

Aggregation is also optimised quite a bit via SIMD and map-reduce. They are as fast as the “where” predicates. Multiple field keyed aggregation is not as optimal yet. I would also suggest our demo site (free and fully open) to see how queries that you use work.

Cleanup is semi manual for now. Time partitions can be removed or detached via SQL. We’re working on automating that.

comment 4y ago · link · parent

Last year we released QuestDB 6.0 and achieved an ingestion rate of 1.4 million rows per second (per server). We compared those results to popular open source databases [1] and explained how we dealt with out of order ingestion under the hood while keeping the underlying storage model read-friendly. Since then, we focused our efforts on making queries faster, in particular filter queries with WHERE clauses. To do so, we once again decided to make things from scratch and built a JIT (Just-in-Time) compiler for SQL filters, with tons of low-level optimisations such as SIMD. We then parallelized the query execution to improve the execution time even further. In this blog post, we first look at some benchmarks against Clickhouse and TimescaleDB, before digging deeper in how this all works within QuestDB's storage model. Once again, we use the Time Series Benchmark Suite (TSBS) [2], developed by TimescaleDB,: it is an open source and reproducible benchmark.

We'd love to get your feedback!

[1]:https://news.ycombinator.com/item?id=27411307

[2]:https://github.com/timescale/tsbs

30.

4Bn rows/sec query benchmark: ClickHouse vs. QuestDB vs. Timescale(questdb.io ↗)

20 points · by bluestreak · 4y ago · 15 comments

123456