This is an automated email from the ASF dual-hosted git repository.

yasithdev pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata.git


The following commit(s) were added to refs/heads/master by this push:
     new c1be7bbb7a perf(research-service): index 
DATA_REPLICA_LOCATION.FILE_PATH (#656)
c1be7bbb7a is described below

commit c1be7bbb7a2fe5d8faf8b7cecabaf624e15d5210
Author: Yasith Jayawardana <[email protected]>
AuthorDate: Tue Jun 9 02:59:41 2026 -0400

    perf(research-service): index DATA_REPLICA_LOCATION.FILE_PATH (#656)
    
    The per-file data-product-uri resolution added for 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
    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 (created 
by
    hbm2ddl on the running schema). Confirmed live: the lookup query's plan is 
now an
    index ref seek (type=ref, key=IDX_DATA_REPLICA_FILE_PATH, rows=1) joining to
    DATA_PRODUCT by primary key, instead of a per-file table scan. Listing 
behavior
    unchanged (data_product_uri still stable/deduped). research-service tests: 
53 pass.
---
 .../apache/airavata/research/model/DataReplicaLocationEntity.java  | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git 
a/airavata-api/research-service/src/main/java/org/apache/airavata/research/model/DataReplicaLocationEntity.java
 
b/airavata-api/research-service/src/main/java/org/apache/airavata/research/model/DataReplicaLocationEntity.java
index 00ea421e80..7d7a6d1a1d 100644
--- 
a/airavata-api/research-service/src/main/java/org/apache/airavata/research/model/DataReplicaLocationEntity.java
+++ 
b/airavata-api/research-service/src/main/java/org/apache/airavata/research/model/DataReplicaLocationEntity.java
@@ -30,7 +30,12 @@ import 
org.apache.airavata.model.data.replica.proto.ReplicaPersistentType;
  * The persistent class for the data_replica_location database table.
  */
 @Entity
-@Table(name = "DATA_REPLICA_LOCATION")
+@Table(
+        name = "DATA_REPLICA_LOCATION",
+        // Index FILE_PATH so the get-or-create-by-path lookup used when 
listing a
+        // directory (resolving a data product URI per file) is an index seek, 
not a
+        // full scan per file.
+        indexes = @Index(name = "IDX_DATA_REPLICA_FILE_PATH", columnList = 
"FILE_PATH"))
 public class DataReplicaLocationEntity implements Serializable {
     private static final long serialVersionUID = 1L;
 

Reply via email to