Skip to content

Commit

Permalink
Add index for join table for jobs-featuresets relation (#566, #647)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen Zhiling authored and ches committed Apr 27, 2020
1 parent 1a35764 commit a68ddf2
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions core/src/main/java/feast/core/model/JobInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,7 @@
package feast.core.model;

import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
Expand Down Expand Up @@ -66,8 +55,13 @@ public class JobInfo extends AbstractTimestampEntity {
// FeatureSets populated by the job
@ManyToMany
@JoinTable(
joinColumns = {@JoinColumn(name = "job_id")},
inverseJoinColumns = {@JoinColumn(name = "feature_set_id")})
name = "jobs_feature_sets",
joinColumns = @JoinColumn(name = "job_id"),
inverseJoinColumns = @JoinColumn(name = "feature_set_id"),
indexes = {
@Index(name = "idx_jobs_feature_sets_job_id", columnList = "job_id"),
@Index(name = "idx_jobs_feature_sets_feature_set_id", columnList = "feature_set_id")
})
private List<FeatureSet> featureSets;

// Job Metrics
Expand Down

0 comments on commit a68ddf2

Please sign in to comment.