saihemanth-cloudera commented on code in PR #4569:
URL: https://github.com/apache/hive/pull/4569#discussion_r1297873585
##########
standalone-metastore/metastore-server/src/main/sql/mssql/upgrade-4.0.0-alpha-2-to-4.0.0-beta-1.mssql.sql:
##########
@@ -44,6 +44,8 @@ UPDATE "SERDES"
LEFT JOIN "SDS" ON "TBLS"."SD_ID" = "SDS"."SD_ID"
WHERE "TBL_ID" IN (SELECT "TBL_ID" FROM "TABLE_PARAMS" WHERE
"PARAM_VALUE" LIKE '%KuduStorageHandler%')
);
+-- HIVE-27499
+CREATE UNIQUE INDEX NOTIFICATION_LOG_UNIQUE_DB ON NOTIFICATION_LOG (DB_NAME,
EVENT_ID);
Review Comment:
> Is it possible to add table name, catalog name to the index? looks like
the EVENT_ID is helpless when using the index
The idea of using an index with DB_NAME, EVENT_ID is that, requirement from
the HMS/Impala client is that they would like to know what are latest events in
the notification_log table from the specified event id in a particular database
or for a specified table(s) in the database.
So following are the fields that would be specified fromEventId, database
name, catalog name, table name(s).
Coming to your question, does it help adding table name and catalog name to
the index, I think it would worsen the performance of index because
notification_log table would have an entry every second on average basis and
every single entry the index would have to be updated. So it becomes costly to
maintain a composite key will the above fields. Instead, if we have an index
only on database name and event id, it is less costly to manage the index and
much more efficient to required info.
> I couldn't find searching the notification by the range of event_id in the
changes, am I miss something?
range of event_ids is already supported. no changes are required in that
perspective. Above mentioned is the required use case.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]