Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add one more condition for data querying to limit the end of date field #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JamesYangJian
Copy link

When we use it for prometheus remote read, we met an issue that if we query data in a period long ago, it will cost such a long time to get the result.

Through the log, we found out that the query condition is as below:

"date >= toDate(1574999700) AND ts >= toDateTime(1574999700) and ts <= toDateTime(1575021600)"

But since the table should be partitioned by date, so, such query condition will seach all records from the start point till now.

So I made this change to make the query condition as below to guarantee clickhouse just search records in the specified range:

"date >= toDate(1574999700) AND ts >= toDateTime(1574999700) and ts <= toDateTime(1575021600) and date<=toDate(1575021600)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant