binarycat0 commented on code in PR #2465:
URL: https://github.com/apache/polaris/pull/2465#discussion_r2316003751


##########
persistence/relational-jdbc/src/main/resources/h2/schema-v2.sql:
##########
@@ -63,6 +63,8 @@ CREATE INDEX IF NOT EXISTS idx_locations ON 
entities(realm_id, catalog_id, locat
 
 -- TODO: create indexes based on all query pattern.
 CREATE INDEX IF NOT EXISTS idx_entities ON entities (realm_id, catalog_id, id);
+CREATE INDEX IF NOT EXISTS idx_entities_lookup
+    ON entities (realm_id, catalog_id, parent_id, type_code, sub_type_code, 
id, name);

Review Comment:
   Regarding the H2 doc - `INCLUDE clause may only be specified for UNIQUE 
indexes`
   - https://www.h2database.com/html/commands.html#create_index
   
   This subset of fields can be not unique `(realm_id, catalog_id, parent_id, 
type_code, sub_type_code)` and INCLUDE can not be applied so I put (id, name) 
in the main index.
   
   



-- 
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]

Reply via email to