How can I ensure that the entire table in the TSDB engine remains sorted when performing a tableInsert? Even after defining sortColumns, the data is not being sorted as expected. A similar issue was encountered previously.
Here is the code:
enter image description here
To test the effectiveness of sortColumns = [symbol, time]
, I took the time
as now() + random seconds
; the symbol
was randomly selected from two symbols. The output result is as follows. The symbol
is sorted correctly in the output table, but the time
is not sorted in the expected order.
enter image description here
What may be the reason for this? Is it due to the TSDB, the tableInsert
, or the Python API?
After reviewing the documentation, I found that sorting can only be maintained within a level file, and there are two specific issues:
(1) The order of data between level files cannot be guaranteed.
(2) The orderliness of data within each partition cannot be guaranteed.
Is there a way to ensure that the entire table remains sorted during insertion?
I tried flushTSDBCache()
but it didn’t work.
xueli qian is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1