Closed YuanchengJiang closed 11 months ago
Adding a time.sleep(2)
in write_query
can have linear output
As CrateDB does not support transaction so commit()
won't do anything.
CrateDB is eventual consistent, such writes are not immediately visible to select queries. One exception is primary-key lookup queries like SELECT ... WHERE pk_col = <val>
, these queries will always return the most-recent values.
One can force writes to be visible immediately by issuing a
REFRESH TABLE <table_name>;
As this isn't a cheap operation, it will slow down write throughput a lot when issued after every write. By default CrateDB will refresh in the background every 1sec, see also https://cratedb.com/docs/crate/reference/en/5.4/sql/statements/create-table.html#refresh-interval.
After inserting data into the table, it requires some time to sync up even with the commit() function. What shall I do if I would like a linear output from the following script?
output: