dimas-b commented on code in PR #2465:
URL: https://github.com/apache/polaris/pull/2465#discussion_r2308806855


##########
persistence/relational-jdbc/src/main/resources/postgres/schema-v2.sql:
##########
@@ -60,6 +60,7 @@ CREATE INDEX IF NOT EXISTS idx_entities ON entities 
(realm_id, catalog_id, id);
 CREATE INDEX IF NOT EXISTS idx_locations
     ON entities USING btree (realm_id, parent_id, location_without_scheme)
     WHERE location_without_scheme IS NOT NULL;
+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:
   Could you post an explain plan that shows how this index is used in 
Persistence API calls?



##########
persistence/relational-jdbc/src/main/resources/h2/schema-v2.sql:
##########
@@ -63,6 +63,7 @@ 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:
   Do we care for this index in H2? Does anything break if it's not present? 
Performance is not a concern with H2, I assume.



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