Attempt to fix index performance issues.

This commit is contained in:
FireMaskterK 2021-11-08 21:28:08 +00:00
parent d9ab303a9d
commit 6012c1cd82
No known key found for this signature in database
GPG key ID: 49451E4482CC5BCD
2 changed files with 4 additions and 2 deletions

View file

@ -7,7 +7,7 @@ import javax.persistence.Index;
import javax.persistence.Table;
@Entity
@Table(name = "pubsub", indexes = { @Index(columnList = "id", name = "id_idx") })
@Table(name = "pubsub", indexes = { @Index(columnList = "id", name = "pubsub_id_idx") })
public class PubSub {
@Id

View file

@ -37,7 +37,9 @@ public class User implements Serializable {
private String sessionId;
@ElementCollection
@CollectionTable(name = "users_subscribed", joinColumns = @JoinColumn(name = "subscriber"), indexes = @Index(columnList = "subscriber", name = "subscriber_idx"))
@CollectionTable(name = "users_subscribed", joinColumns = @JoinColumn(name = "subscriber"), indexes = {
@Index(columnList = "subscriber", name = "users_subscribed_subscriber_idx"),
@Index(columnList = "channel", name = "users_subscribed_channel_idx") })
@Column(name = "channel", length = 30)
private List<String> subscribed_ids;