<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Un-optimize queries are running on metastore_db that's are causing the slowness and high resource uses.. in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Un-optimize-queries-are-running-on-metastore-db-that-s-are/m-p/388154#M246553</link>
    <description>&lt;P&gt;This is the query which is running on metastore_db&lt;BR /&gt;&lt;BR /&gt;SELECT&lt;BR /&gt;`A0` . `PART_NAME`&lt;BR /&gt;FROM&lt;BR /&gt;`PARTITIONS` `A0`&lt;BR /&gt;LEFT OUTER JOIN&lt;BR /&gt;`TBLS` `B0`&lt;BR /&gt;ON&lt;BR /&gt;`A0` . `TBL_ID` = `B0` . `TBL_ID`&lt;BR /&gt;LEFT OUTER JOIN&lt;BR /&gt;`DBS` `C0`&lt;BR /&gt;ON&lt;BR /&gt;`B0` . `DB_ID` = `C0` . `DB_ID`&lt;BR /&gt;WHERE&lt;BR /&gt;`C0` . `NAME` = ?&lt;BR /&gt;AND `C0` . `CTLG_NAME` = ?&lt;BR /&gt;AND `B0` . `TBL_NAME` = ?&lt;BR /&gt;AND `A0` . `PART_NAME` LIKE ? ESCAPE ?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;how we can optimize it ? Is it system generated?&lt;BR /&gt;or from where it is coming at metastore_db database that is inside mysql.&lt;BR /&gt;&lt;BR /&gt;SELECT&lt;BR /&gt;"AO"&lt;BR /&gt;"PART NAME' FROM 'PARTITIONS&lt;BR /&gt;AO' LEFT OUTER JOIN 'TBLS&lt;BR /&gt;"RO' ON 'AO'&lt;BR /&gt;• 'TBL ID'&lt;BR /&gt;&lt;BR /&gt;** Note ** I am using Trino hive architecture.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks in advance for your help....&lt;/P&gt;</description>
    <pubDate>Tue, 21 Apr 2026 06:30:39 GMT</pubDate>
    <dc:creator>shrikantverma</dc:creator>
    <dc:date>2026-04-21T06:30:39Z</dc:date>
    <item>
      <title>Un-optimize queries are running on metastore_db that's are causing the slowness and high resource uses..</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Un-optimize-queries-are-running-on-metastore-db-that-s-are/m-p/388154#M246553</link>
      <description>&lt;P&gt;This is the query which is running on metastore_db&lt;BR /&gt;&lt;BR /&gt;SELECT&lt;BR /&gt;`A0` . `PART_NAME`&lt;BR /&gt;FROM&lt;BR /&gt;`PARTITIONS` `A0`&lt;BR /&gt;LEFT OUTER JOIN&lt;BR /&gt;`TBLS` `B0`&lt;BR /&gt;ON&lt;BR /&gt;`A0` . `TBL_ID` = `B0` . `TBL_ID`&lt;BR /&gt;LEFT OUTER JOIN&lt;BR /&gt;`DBS` `C0`&lt;BR /&gt;ON&lt;BR /&gt;`B0` . `DB_ID` = `C0` . `DB_ID`&lt;BR /&gt;WHERE&lt;BR /&gt;`C0` . `NAME` = ?&lt;BR /&gt;AND `C0` . `CTLG_NAME` = ?&lt;BR /&gt;AND `B0` . `TBL_NAME` = ?&lt;BR /&gt;AND `A0` . `PART_NAME` LIKE ? ESCAPE ?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;how we can optimize it ? Is it system generated?&lt;BR /&gt;or from where it is coming at metastore_db database that is inside mysql.&lt;BR /&gt;&lt;BR /&gt;SELECT&lt;BR /&gt;"AO"&lt;BR /&gt;"PART NAME' FROM 'PARTITIONS&lt;BR /&gt;AO' LEFT OUTER JOIN 'TBLS&lt;BR /&gt;"RO' ON 'AO'&lt;BR /&gt;• 'TBL ID'&lt;BR /&gt;&lt;BR /&gt;** Note ** I am using Trino hive architecture.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks in advance for your help....&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2026 06:30:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Un-optimize-queries-are-running-on-metastore-db-that-s-are/m-p/388154#M246553</guid>
      <dc:creator>shrikantverma</dc:creator>
      <dc:date>2026-04-21T06:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Un-optimize queries are running on metastore_db that's are causing the slowness and high resource uses..</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Un-optimize-queries-are-running-on-metastore-db-that-s-are/m-p/388176#M246560</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/110732"&gt;@shrikantverma&lt;/a&gt;&amp;nbsp;Welcome to the Cloudera Community!&lt;BR /&gt;&lt;BR /&gt;To help you get the best possible solution, I have tagged our Hive and Spark experts&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/45798"&gt;@james_jones&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/38161"&gt;@cravani&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/12885"&gt;@mszurap&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt; who may be able to assist you further.&lt;BR /&gt;&lt;BR /&gt;Please keep us updated on your post, and we hope you find a satisfactory solution to your query.&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 18:21:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Un-optimize-queries-are-running-on-metastore-db-that-s-are/m-p/388176#M246560</guid>
      <dc:creator>DianaTorres</dc:creator>
      <dc:date>2024-05-21T18:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: Un-optimize queries are running on metastore_db that's are causing the slowness and high resource uses..</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Un-optimize-queries-are-running-on-metastore-db-that-s-are/m-p/388203#M246572</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/110732"&gt;@shrikantverma&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This indeed seems to be a generated query, however based on this only it is not clear if this is coming from the Hive Metastore. You can review with your DB tools which user is submitting these queries, for example for MySQL use "show processlist" or slow query logging to capture which user is submitting these. Alternatively stop the Hive metastore (if allowed) and observe if those queries are still appearing.&lt;/P&gt;&lt;P&gt;As I see this query might be used by HMS while listing partitions by name in &lt;A href="https://github.com/apache/hive/blob/18c434f346dc590201afa4159aeec62b7dd5e2cf/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java#L792" target="_self"&gt;MetaStoreDirectSql.java#getPartitionsUsingProjectionAndFilterSpec()&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Is this inefficient in your database? Have you checked that with an "explain &amp;lt;query&amp;gt;" or why do you want to optimize this?&lt;/P&gt;&lt;P&gt;The HMS database should have indexes on the affected tables (DBS, TBLS, PARTITIONS) to speed up these queries, the only scan needed is to match the partition names - which can be slower if the Hive table has too many partitions.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;Miklos&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 09:14:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Un-optimize-queries-are-running-on-metastore-db-that-s-are/m-p/388203#M246572</guid>
      <dc:creator>mszurap</dc:creator>
      <dc:date>2024-05-22T09:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Un-optimize queries are running on metastore_db that's are causing the slowness and high resource uses..</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Un-optimize-queries-are-running-on-metastore-db-that-s-are/m-p/388365#M246649</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/110732"&gt;@shrikantverma&lt;/a&gt;&amp;nbsp;Has the reply helped resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future.&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 03:28:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Un-optimize-queries-are-running-on-metastore-db-that-s-are/m-p/388365#M246649</guid>
      <dc:creator>DianaTorres</dc:creator>
      <dc:date>2024-05-28T03:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: Un-optimize queries are running on metastore_db that's are causing the slowness and high resource uses..</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Un-optimize-queries-are-running-on-metastore-db-that-s-are/m-p/388366#M246650</link>
      <description>&lt;P&gt;Hi had checked the&amp;nbsp;&lt;SPAN&gt;"show processlist" and this query is running there and multiple time it's running problem is that it is scanning all rows, means not in optimize state&lt;BR /&gt;and if it is auto generated query then how we can pass the partition information.&lt;BR /&gt;and this query is not run by user, they are running optimize query it seems it taking some metadata from mysql, something like below.....&lt;BR /&gt;So that's why i was thinking it meta generated query.&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;| id | select_type | table | partitions | type &amp;nbsp;| possible_keys &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| key &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | key_len | ref &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | rows &amp;nbsp; &amp;nbsp;| filtered | Extra &amp;nbsp; &amp;nbsp; &amp;nbsp; |&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;+----+-------------+-------+------------+-------+----------------------------------+-----------------+---------+-------------+---------+----------+-------------+&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| &amp;nbsp;1 | SIMPLE &amp;nbsp; &amp;nbsp; &amp;nbsp;| C0 &amp;nbsp; &amp;nbsp;| NULL &amp;nbsp; &amp;nbsp; &amp;nbsp; | const | PRIMARY,UNIQUE_DATABASE,CTLG_FK1 | UNIQUE_DATABASE | 389 &amp;nbsp; &amp;nbsp; | const,const | &amp;nbsp; &amp;nbsp; &amp;nbsp; 1 | &amp;nbsp; 100.00 | Using index |&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| &amp;nbsp;1 | SIMPLE &amp;nbsp; &amp;nbsp; &amp;nbsp;| B0 &amp;nbsp; &amp;nbsp;| NULL &amp;nbsp; &amp;nbsp; &amp;nbsp; | const | PRIMARY,UNIQUETABLE,TBLS_N49 &amp;nbsp; &amp;nbsp; | UNIQUETABLE &amp;nbsp; &amp;nbsp; | 268 &amp;nbsp; &amp;nbsp; | const,const | &amp;nbsp; &amp;nbsp; &amp;nbsp; 1 | &amp;nbsp; 100.00 | Using index |&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| &amp;nbsp;1 | SIMPLE &amp;nbsp; &amp;nbsp; &amp;nbsp;| A0 &amp;nbsp; &amp;nbsp;| NULL &amp;nbsp; &amp;nbsp; &amp;nbsp; | ref &amp;nbsp; | PARTITIONS_N49 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | PARTITIONS_N49 &amp;nbsp;| 9 &amp;nbsp; &amp;nbsp; &amp;nbsp; | const &amp;nbsp; &amp;nbsp; &amp;nbsp; | &lt;STRONG&gt;5555098 | &amp;nbsp; &amp;nbsp;11.11 | Using where&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 03:43:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Un-optimize-queries-are-running-on-metastore-db-that-s-are/m-p/388366#M246650</guid>
      <dc:creator>shrikantverma</dc:creator>
      <dc:date>2024-05-28T03:43:00Z</dc:date>
    </item>
  </channel>
</rss>

