Store records with the same timestamp
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 25.1k
- Forks
- 5k
- Avg merge
- 4d 59m
- Merged PRs (30d)
- 7
Description
I am exploring using TDEngine to store every market ticks from stock market.
taos> create database market precision 'ns';
taos> use market;
taos> create stable ticks (time timestamp, quantity bigint) tags (symbol varchar(10));
taos> insert into ticks (tbname, time, quantity, symbol) values ('tick1', '2024-01-01 10:00:00.123456789', 10, '1.SZ');
taos> insert into ticks (tbname, time, quantity, symbol) values ('tick1', '2024-01-01 10:00:00.123456789', 11, '1.SZ');
taos> insert into ticks (tbname, time, quantity, symbol) values ('tick2', '2024-01-01 10:00:00.123456789', 12, '2.SZ');
Let's assume the timestamp precision required is nano seconds. A stock code is used for the tag.
Because TDEngine cannot store records with same timestamp and tag (stock code). The 2nd record (market tick) has overwritten the first one and only 2 records are stored at the stable.
I think it's a valid use case for storing logs or records.
Can TDEngine provide a mode to support this?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the SQL statements in the issue and inspect how TDengine handles timestamp and tag uniqueness for stable inserts. Determine the supported behavior for repeated timestamps, then verify the result by checking whether all three market-tick records can be retained and queried.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100