dengzhhu653 commented on code in PR #4569:
URL: https://github.com/apache/hive/pull/4569#discussion_r1331745899
##########
standalone-metastore/metastore-server/src/main/sql/mssql/hive-schema-4.0.0-beta-2.mssql.sql:
##########
@@ -661,6 +661,8 @@ ALTER TABLE NOTIFICATION_LOG ADD CONSTRAINT
NOTIFICATION_LOG_PK PRIMARY KEY (NL_
CREATE UNIQUE INDEX NOTIFICATION_LOG_EVENT_ID ON NOTIFICATION_LOG (EVENT_ID);
+CREATE UNIQUE INDEX NOTIFICATION_LOG_UNIQUE_DB ON NOTIFICATION_LOG (DB_NAME,
EVENT_ID);
Review Comment:
I'm wondering for some back dbs, for the case: event_id > 10 and db_name =
'default'
1. use index with event_id to filter the matched rows (event_id > 10)
2. on the result of the first step, apply the index with db_name (db_name =
'default')
if the event_id > 10 is only return one row from 1000 rows, then this is
better than using the index with db_name and event_id.
As the API is aim to fetch the latest event in most cases, so I think this
is common in real production.
--
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]