[
https://issues.apache.org/jira/browse/NIFI-15634?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sejal Gupta updated NIFI-15634:
-------------------------------
Attachment: Screenshot from 2026-10-08 15-18-11.png
> Full query execution during metadata discovery for Generic/MySQL in
> QueryDatabaseTableRecord causes high heap usage.
> --------------------------------------------------------------------------------------------------------------------
>
> Key: NIFI-15634
> URL: https://issues.apache.org/jira/browse/NIFI-15634
> Project: Apache NiFi
> Issue Type: Bug
> Affects Versions: 2.7.2
> Reporter: gaurav kadaskar
> Priority: Major
> Labels: heap, querydatabasetablerecord
> Attachments: Screenshot from 2026-10-08 15-18-11.png
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> h3. Problem
> When Database Type is set to Generic or MySQL in QueryDatabaseTableRecord,
> getDatabaseDialectService() returns DatabaseAdapterDatabaseDialectService.
> During metadata discovery, NiFi executes the full user query instead of using
> a
> metadata-only query. Since no guard condition is applied, the query scans the
> entire dataset, which leads to high heap usage and JVM memory pressure for
> large result sets.
> h3. Previous Behavior
> Earlier NiFi versions generated a metadata-safe query by appending:
> {code:sql}
> WHERE 1=0
> {code}
> This allowed schema retrieval without reading actual data.
> h3. Expected Behavior
> Metadata discovery should use a metadata-only query and must not execute the
> full user query.
> h3. Current Behavior
> Full user query is executed to obtain metadata.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)