Using LIKE statement causing slower performance in Lakehouse Federation query

Replace the LIKE statement in your query with filter options that can be passed as pushdown filters.

Written by allan.soares

Last published at: March 19th, 2025

Problem

When using Lakehouse Federation to run a query that uses a LIKE statement and references tables that are connected to Lakehouse Federation, you notice slower performance compared to executing the query directly on the underlying database.

 

Cause

In Lakehouse Federation, the LIKE command is not passed as a pushdown filter. This means the underlying query runs more slowly than running the statement directly on the target system.

 

Solution

Replace LIKE statements with alternative filter options when performing pushdowns Lakehouse Federation. 

  • CONTAINS to search for a specific string within a column.
  • STARTSWITH to search for a specific string at the beginning of a column.
  • ENDSWITH to search for a specific string at the end of a column.