Add indices on frequent queries (#12401)
Fixes #12165 Also changed the index naming convention because some were not properly name and would have caused conflicts in the long run
This commit is contained in:
@ -32,7 +32,7 @@ export class IndexFieldMetadataEntity {
|
||||
indexMetadata: Relation<IndexMetadataEntity>;
|
||||
|
||||
@Column({ nullable: false })
|
||||
@Index('IndexOnFieldMetadataId')
|
||||
@Index('IDX_INDEX_FIELD_METADATA_FIELD_METADATA_ID', ['fieldMetadataId'])
|
||||
fieldMetadataId: string;
|
||||
|
||||
@ManyToOne(
|
||||
|
||||
@ -2,6 +2,7 @@ import {
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
Entity,
|
||||
Index,
|
||||
JoinColumn,
|
||||
ManyToOne,
|
||||
OneToMany,
|
||||
@ -19,11 +20,15 @@ export enum IndexType {
|
||||
GIN = 'GIN',
|
||||
}
|
||||
|
||||
@Unique('IndexOnNameAndWorkspaceIdAndObjectMetadataUnique', [
|
||||
@Unique('IDX_INDEX_METADATA_NAME_WORKSPACE_ID_OBJECT_METADATA_ID_UNIQUE', [
|
||||
'name',
|
||||
'workspaceId',
|
||||
'objectMetadataId',
|
||||
])
|
||||
@Index('IDX_INDEX_METADATA_WORKSPACE_ID_OBJECT_METADATA_ID', [
|
||||
'workspaceId',
|
||||
'objectMetadataId',
|
||||
])
|
||||
@Entity('indexMetadata')
|
||||
export class IndexMetadataEntity {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
|
||||
Reference in New Issue
Block a user