4 comments (4 comments)0 reactions (0 reactions)0 assignees (0 assignees)C24,849 stars (24,849 stars)5,002 forks (5,002 forks)batch import
help wantedquestion
説明
使用这样的sql语句查询对主键排序特别慢,这是为什么呢,有什么解决办法吗 select * from alarm_log order by ts desc limit 0,10;
コントリビューターガイド
- 技術スタック
- csql
- 領域
- databaseperformance
- Issue 種別
- performance
- 難度新しい貢献者にとっての実装難度です。1 は非常に小さな変更、5 は専門的な作業です。
- 3
- 推定時間経験ある貢献者が調査、実装、テスト、pull request 準備にかけるおおよその時間範囲です。
- 1-3 hours
- 活動状況Issue が今どれだけ取り組みやすいかを示します。新しい、活発、古い、ブロック中、またはメンテナー入力待ちなどです。
- fresh
- 明確さ期待される変更、受け入れ条件、次の手順がどれだけ明確かを示します。
- needs investigation
- 前提条件
- Basic understanding of TDengineSQL query optimization concepts
- 初心者向け度初回貢献者にどれだけ取り組みやすいかを 1-100 で推定したスコアです。
- 20
- 調査方針
- The issue lacks schema details (e.g., number of columns, data volume), query execution plan, and whether the super table's primary key is properly indexed. First, check if the user has provided a reproducible test case in the comments. Look at the query execution path in TSDB: examine the order by implementation in the source code (likely in `tsdb/` directory). Verify if the query uses the primary key index or performs a full scan. Search for similar reported issues in the repository. If possible, replicate the slow query with a simple schema and measure performance with and without order by. Provide guidance on using EXPLAIN to get query plan.