https://questdb.io logo
Title
u

陈彦江

02/28/2023, 2:22 PM
hello
n

Nicolas Hourcard

02/28/2023, 2:23 PM
welcome to our community! I’m Nic, co founder, and we would love to see how we can help you. Are you already a user of questdb or looking to learn more ?
u

陈彦江

02/28/2023, 2:25 PM
I ready use questdb
n

Nicolas Hourcard

02/28/2023, 2:27 PM
thanks for sharing. What is your use case with qdb ?
u

陈彦江

02/28/2023, 2:39 PM
company project
now, I think questdb is great
I want to know what hanppen old data when update data, old data is deleted and insert new data, or old data don't change and insert new data
n

Nicolas Hourcard

02/28/2023, 2:53 PM
With Update, the old rows will be over-written with the new values
with updates, we do the following: • load the partition • create a new version of it (new column version) • copy old data into the new partition while modifying rows where necessary • let the old partition to be removed at some point by the purge job
u

陈彦江

02/28/2023, 3:17 PM
ok, column version is timestamp?
I understand, old data is removed after copy by purge job
n

Nicolas Hourcard

02/28/2023, 3:37 PM
yes
u

陈彦江

02/28/2023, 3:41 PM
so good, if I want to delete when I update, can you provide some idea?
n

Nicolas Hourcard

02/28/2023, 3:59 PM
do you mean that you want to delete specific rows ?
u

陈彦江

02/28/2023, 4:02 PM
yeah, I want to delete old data when update data
n

Nicolas Hourcard

02/28/2023, 4:05 PM
@Imre can you pls help here?
i

Imre

02/28/2023, 4:09 PM
hi, i have a feeling that by ‘update’ you mean sending a new row with the same timestamp via ILP, while we are talking about the
UPDATE
SQL statement which you can use to update data via postgres wire protocol or the REST API
am i correct?
so this is the SQL UPDATE doc: https://questdb.io/docs/reference/sql/update/
this will just update the row
if you send an ‘updated’ row via ILP (either you construct the message or via our official client) that will end up to be a new row. by ‘updated’ row here i mean the values for the fields are different but the designated timestamp is the same
in this case you need to take care of the filtering while running the queries on the table, making sure you get the latest row for each designated timestamp
u

陈彦江

03/01/2023, 11:54 PM
thanks. I think i see what you mean
I will practice and experiment