News for hackers. Stuff that matters.
Re:Launch HN: QuestDB (YC S20) – Fast open source time serie... by beagle3 on Tuesday July 28, 2020 @06:55PM (#23981564)
One differentiating feature is "as of" join. You have records of the form (time, value), and you ask "what's the most recent value as of $time?"; On a non-TS oriented DBMS, this query is usually slow and hard to write. Window extensions to SQL can make it a little better, but - you can assume that a proper TSDB answers this query x10 to x10,000 times faster on the same hardware, especially when done in bulk (e.g.: I have one million (time,bid_price) records, and one million (time,transaction_price) records; For each transaction record, I want to know what the most-recent bid price was at that time.

That's something kdb+ and ClickHouse do in milliseconds; and I assume QuestDB can to, though I didn't check.

Re:Launch HN: QuestDB (YC S20) – Fast open source time serie... by einpoklum on Wednesday July 29, 2020 @05:31AM (#23984911)
> On a non-TS oriented DBMS, this query is usually slow and hard to write.

I don't see why this is hard to write:

SELECT max(time) as most_recent_time, transaction_price INTO newtable FROM oldtable WHERE time > $my_datetime GROUP BY time;

As for being slow - can you provide some references about this being slow in non-time-series columnar DBMSes? MonetDB, Vectorwise, Vertica?

Re:Launch HN: QuestDB (YC S20) – Fast open source time serie... by beagle3 on Wednesday July 29, 2020 @09:01AM (#23986148)
"most recent" is min(time) where time>=$my_datetime ;

I don't understand your query - max(time) .. GROUP BY time means that every record is its own group, so max(time)==time; also, you will have a result for every single point in time after the requested time.

There is no way in standard SQL (without window extensions) to do this with just one clause; you need the price associated with the min(time) associated with time>=$my_datetime ; You need either a subquery, a join, or some other correlated query. e.g.

SELECT time, price FROM trades WHERE time IN (SELECT min(time) FROM trades WHERE time>=$my_datetime)

And that's for one record; It gets more complicated when you try to do a batch.

> As for being slow - can you provide some references about this being slow in non-time-series columnar DBMSes? MonetDB, Vectorwise, Vertica?

I've timed kdb2 against Vertica a decade or so ago, and kdb2 was about x10 faster, I didn't do a proper benchmark but monetdb was in the x10-x100 slower than kdb2 at the time.

Re:Launch HN: QuestDB (YC S20) – Fast open source time serie... by einpoklum on Wednesday July 29, 2020 @07:28PM (#23992686)
Ah yes, I should have grouped by the non-time key fields.
Re:Launch HN: QuestDB (YC S20) – Fast open source time serie... by beagle3 on Thursday July 30, 2020 @07:49AM (#23997018)
I still don't understand how that would give the right result.