yasithdev opened a new pull request, #656:
URL: https://github.com/apache/airavata/pull/656

   ## Summary
   
   The per-file data-product-URI resolution added in #653 (file listings) looks 
up a data product by its replica file path (`getDataProductByReplicaFilePath`). 
Listing a directory resolves one such lookup **per file**, so without an index 
on `FILE_PATH` each lookup was a full scan of `DATA_REPLICA_LOCATION` — N scans 
for an N-file directory.
   
   Add an index on `FILE_PATH` via `@Index` on `DataReplicaLocationEntity` 
(`IDX_DATA_REPLICA_FILE_PATH`), created by Hibernate `ddl-auto=update` on the 
running schema. `FILE_PATH` is `varchar(255)`, so it indexes without a prefix 
length.
   
   ## Validation
   
   - **Live:** the lookup query's plan is now an index ref seek on the replica 
table (`type=ref, key=IDX_DATA_REPLICA_FILE_PATH, rows=1`) joining to 
`DATA_PRODUCT` by primary key, instead of a per-file full scan; confirmed the 
index is created in the DB after restart. Listing behavior is unchanged — 
`data_product_uri` is still stable/deduped across calls and resolves.
   - `mvn test -pl airavata-api/research-service` → 53 pass, 0 failures.
   
   Follow-up to #653 (the get-or-create-by-path feature).


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