https://questdb.io logo
Title
j

Jetsukda Janthornthao

03/23/2023, 3:39 AM
How to
UPSERT
in QuestDB?
j

Jaromir Hamala

03/23/2023, 7:56 AM
hi, you typically treat QuestDB as an append-only storage. It means that instead of UPDATEs you do a new INSERT. The new INSERT will have a newer timestamps. This way you keep the entire history - as time-series databases tend to work with historical data quite a bit. And If you are interested in the most recent snapshot, then you do SQL SELECT with the latest timestamp.
@Amy Wang ☝️ sounds like a nice blog post
n

Nicolas Hourcard

03/23/2023, 10:05 AM
@Jetsukda Janthornthao could you please let us know how UPSERT would help for your use case?
is it a case of avoiding deduplicated rows?
j

Jetsukda Janthornthao

03/25/2023, 9:54 AM
Sure, I wish to utilize QuestDB as a data warehouse, however I still get repeated rows when data pipelines run again on the same day.
n

Nicolas Hourcard

03/25/2023, 11:13 AM
thanks, what kind of data is it? market data, metrics etc?
j

Jetsukda Janthornthao

03/25/2023, 11:13 AM
It’s blockchain data
n

Nicolas Hourcard

03/25/2023, 11:15 AM
Ok, so the idea is to pull data from the blockchain, store it in questdb for the long term, and then run some queries from questdb to do some charts?
j

Jetsukda Janthornthao

03/25/2023, 11:15 AM
yes