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

[Bug]: zonemap does not do const folding on some functions #12322

Open
1 task done
fengttt opened this issue Oct 24, 2023 · 0 comments
Open
1 task done

[Bug]: zonemap does not do const folding on some functions #12322

fengttt opened this issue Oct 24, 2023 · 0 comments
Assignees
Labels
kind/bug Something isn't working severity/s1 High impact: Logical errors or data errors that must occur
Milestone

Comments

@fengttt
Copy link
Contributor

fengttt commented Oct 24, 2023

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Environment

- Version or commit-id (e.g. v0.1.0 or 8b23a93):
- Hardware parameters:
- OS type:
- Others:

Actual Behavior

The following query is extremely slow

mysql> select * from system.rawlog where timestamp > date_add(current_timestamp, interval -2 hour) and caller = 'client/client.go:221' limit 10;

mysql> explain select * from system.rawlog where timestamp > date_add(current_timestamp, interval -2 hour) and caller = 'client/client.go:221' limit 10;
+---------------------------------------------------------------------------------------------------------+
| QUERY PLAN |
+---------------------------------------------------------------------------------------------------------+
| Project |
| Limit: 10 |
| -> Table Scan on system.rawlog |
| Filter Cond: (rawlog.caller = 'client/client.go:221'), (cast(rawlog.timestamp AS TIMESTAMP) > ) |
+---------------------------------------------------------------------------------------------------------+
4 rows in set (0.34 sec)

On the other hand, the following, is correct folded.

mysql> explain select * from system.rawlog where timestamp > '2023-10-24 20:00:00' and caller like '%client/client%' limit 10;
+---------------------------------------------------------------------------------------------------------------------------+
| QUERY PLAN |
+---------------------------------------------------------------------------------------------------------------------------+
| Project |
| Limit: 10 |
| -> Table Scan on system.rawlog |
| Filter Cond: (rawlog.timestamp > cast('2023-10-24 20:00:00' AS DATETIME)), (rawlog.caller like '%client/client%') |
| Block Filter Cond: (rawlog.timestamp > cast('2023-10-24 20:00:00' AS DATETIME)) |
+---------------------------------------------------------------------------------------------------------------------------+
5 rows in set (0.38 sec)

mysql>

Expected Behavior

No response

Steps to Reproduce

No response

Additional information

No response

@fengttt fengttt added kind/bug Something isn't working needs-triage labels Oct 24, 2023
@matrix-meow matrix-meow added this to the 1.1.0 milestone Oct 24, 2023
@fengttt fengttt changed the title [Bug]: zonemap does not do const folding [Bug]: zonemap does not do const folding on some functions Oct 24, 2023
@Morranto Morranto assigned aunjgr and unassigned matrix-meow Oct 26, 2023
@daviszhen daviszhen added severity/s1 High impact: Logical errors or data errors that must occur and removed needs-triage labels Nov 2, 2023
@aunjgr aunjgr modified the milestones: 1.1.0, 1.2.0 Nov 8, 2023
@daviszhen daviszhen assigned matrix-meow and unassigned matrix-meow Dec 11, 2023
@aressu1985 aressu1985 modified the milestones: 1.2.0, 1.3.0-Backlog Apr 28, 2024
@sukki37 sukki37 modified the milestones: 1.3.0-Backlog, 1.3.0 Jul 8, 2024
@sukki37 sukki37 modified the milestones: 2.0.0, 2.1.0 Oct 19, 2024
@aunjgr aunjgr assigned gouhongshen and unassigned aunjgr Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working severity/s1 High impact: Logical errors or data errors that must occur
Projects
None yet
Development

No branches or pull requests

7 participants