Felix Castillo
04/24/2023, 1:39 PM2022-07.19659/
2022-08.19662/
2022-09.19664/
What does this mean? Am I doing something wrong?Bolek Ziobrowski
04/24/2023, 1:46 PMFelix Castillo
04/24/2023, 3:05 PMBolek Ziobrowski
04/24/2023, 3:24 PMcreate table trades ( ts timestamp, code int, value int ) timestamp(ts) partition by day;
insert into trades
select dateadd('s', x::int, '2023-04-20T00:00:00.000000Z'), rnd_int(1,10,0), rnd_int()
from long_sequence(10000000);
show partitions from trades;
insert into trades
select dateadd('s', x::int, '2023-04-20T00:00:00.000000Z'), rnd_int(1,10,0), rnd_int()
from long_sequence(86300);
show partitions from trades;
insert into trades
select dateadd('s', x::int, '2023-04-20T00:00:00.000000Z'), rnd_int(1,10,0), rnd_int()
from long_sequence(86300);
Felix Castillo
04/24/2023, 3:28 PMshow partitions
run with 7.1? It's not working with my versions usedBolek Ziobrowski
04/24/2023, 3:30 PMFelix Castillo
04/24/2023, 3:31 PMJaromir Hamala
04/24/2023, 3:33 PM1
2
3
4
When you want to insert 5
then you just append a new row:
1
2
3
4
5
The problem is when you need to insert a row in between already existing row. Imagine this:
1
2
3
5
and you want to insert 4
. QuestDB will do this:
1. create a new partition version
2. insert all rows from before the row you want to insert. So it’ll look like this:
1
2
3
3. insert the 4
So the table looks like this:
1
2
3
4
4. insert the rest of the original table:
1
2
3
4
5
The beauty of this system is that the old partition is not obstructed in any way. Readers can keep query it while the new version is being created. QuestDB will automatically remove the old version when they are no readers.Felix Castillo
04/24/2023, 3:37 PMBolek Ziobrowski
04/24/2023, 3:48 PMFelix Castillo
04/25/2023, 6:33 AMBolek Ziobrowski
04/25/2023, 6:34 AMFelix Castillo
04/25/2023, 5:41 PM