Skip to content

Adhoc filter for regex uses ILIKE by default #1443

@sukhada369

Description

@sukhada369

What happened:
This is for Adhoc filters feature and its interpretation in additional_table_filters. When I have to do a "Matches regex" or "Does not match regex" via filters it uses ILIKE in the additional_table_filters. I have indexed a field and when ILIKE is used, the query execution time increases a lot as Clickhouse is no more honoring the indexed data.

What you expected to happen:
Please change the default to LIKE or provide a way where user can explicitly choose what they want to use

How to reproduce it (as minimally and precisely as possible):

  • Create a table in clickhouse with minimal fields as time, message, logLevel, applicationName
  • Connect this as a datasource on Grafana Logs panel
  • Editor Type: SQL Editor, Query Type: Logs
  • Add an Adhoc filter for any field for "Matches regex" or "Does not match regex"
  • Check the query created via query inspector and notice content of additional_table_filters

Screenshots

Image

Anything else we need to know?:
This is for an airgapped environment

Environment:

  • Grafana version: 11.6.2
  • Plugin version: 4.11.3 and earlier versions
  • OS Grafana is installed on: OEL8
  • User OS & Browser: MAC, Google Chrome
  • Others:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Incoming

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions