-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
BugIncorrect or unexpected behaviorIncorrect or unexpected behaviorSQLIssues or changes relating to SQL executionIssues or changes relating to SQL execution
Description
Describe the bug
Looks like in latest release queries that use limit -N without explicit order by issued against tables with designated timestamp traverse partitions from first to last . This can make a big difference for tables with many partitions that get queried rarely enough to not be present in os cache .
To reproduce
create table test ( ts timestamp, d double, f float, i int, l long, s1 string, s2 string, sy symbol index) timestamp(ts) partition by day;
insert into test
SELECT cast( (x*2500000) as timestamp), x, x, cast(x as int), x, 's1' || (x%10), 's2' || (x%10), 'sy' || (x%10)
from long_sequence(100000000);
selecT count(*) from test limit -5;
--observe many 'open partition' messages in logs
--after restart run
selecT * from test order by ts desc limit 5;
--check that there's only 1 'open partition' messageExpected Behavior
No response
Environment
- **QuestDB version**: 6.4.4-snapshot
- **OS**: Windows
- **Browser**: ChromeAdditional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugIncorrect or unexpected behaviorIncorrect or unexpected behaviorSQLIssues or changes relating to SQL executionIssues or changes relating to SQL execution