Help Center/ Log Tank Service/ FAQs/ Log Search and Analysis/ What Are the Advantages of the New Pipe-Character-Based SQL Engine?
Updated on 2025-08-11 GMT+08:00

What Are the Advantages of the New Pipe-Character-Based SQL Engine?

The new SQL engine, which combines search and analysis using the pipe character (|), offers several advantages and is recommended. The old engine, which supports only SQL analysis, will be phased out from all regions in the second half of 2025. For more information about the pipe character, see Log Search and Analysis Overview.

Features and Advantages

Features:

Combined search and SQL analysis: The new engine allows you to combine a search statement and a SQL analysis statement using the pipe character (|).

For example, to count logs that contain the keyword error, you can use the following syntax:

error* | select count(*) as cnt

Advantages:

  • Better performance: The new SQL engine dramatically improves calculation efficiency, especially with a high volume of raw logs.

    The old engine was inefficient, as it performed a full fuzzy match on all logs. For example, to count logs that contain the keyword error, you can use the following syntax:

    select count(*) as cnt where status like "%error%"

    In contrast, the new engine uses an inverted index to quickly filter logs with the keyword error before counting, making it significantly faster. The syntax is:

    status : "error" | select count(*) as pv 

    Using the pipe character (|) to search for a specific keyword like error is related to the delimiters set in your index settings. The new engine can only find the keywords that are fully retained after being delimited by these delimiters. For more rules, see Using Search Syntax.

  • More SQL functions: The new SQL engine supports over 300 SQL functions, compared to just over 100 in the old engine.
  • More standard SQL syntax: The new engine's SQL syntax is fully compatible with SQL-92 standards, making it more standard and easier to understand.

LTS Console Entries

The entries for the old and new engines on the LTS console have been updated for different scenarios.

Scenario

New SQL Engine (Search | Analysis)

Old Engine (SQL Analysis)

Log analysis and visualization

Log alarms

SQL scheduled jobs