1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2025-01-14 14:43:17 +08:00

Reverting Indexing as it did not improve performance

This commit is contained in:
Patrik J. Braun 2021-05-12 21:56:52 +02:00
parent 96e8ec0d89
commit eb84723523
4 changed files with 15 additions and 32 deletions

View File

@ -16,15 +16,8 @@ export class MediaDimensionEntity implements MediaDimension {
} }
const arrayTransformer: ValueTransformer = {
to: (value: string[]): string => value ? value.join(',') : null,
from: (value: string): string[] => value ? value.split(',') : null
};
export class MediaMetadataEntity implements MediaMetadata { export class MediaMetadataEntity implements MediaMetadata {
@Column('text')
@Index()
@Column('varchar', {length: 128})
caption: string; caption: string;
@Column(type => MediaDimensionEntity) @Column(type => MediaDimensionEntity)
@ -46,11 +39,8 @@ export class MediaMetadataEntity implements MediaMetadata {
@Column('int', {unsigned: true}) @Column('int', {unsigned: true})
fileSize: number; fileSize: number;
@Index()
@Column({ @Column({
type: 'varchar', type: 'simple-array',
length: 512,
transformer: arrayTransformer,
charset: columnCharsetCS.charset, charset: columnCharsetCS.charset,
collation: columnCharsetCS.collation collation: columnCharsetCS.collation
}) })
@ -62,7 +52,6 @@ export class MediaMetadataEntity implements MediaMetadata {
@Column(type => PositionMetaDataEntity) @Column(type => PositionMetaDataEntity)
positionData: PositionMetaDataEntity; positionData: PositionMetaDataEntity;
@Index()
@Column('tinyint', {unsigned: true}) @Column('tinyint', {unsigned: true})
rating: 0 | 1 | 2 | 3 | 4 | 5; rating: 0 | 1 | 2 | 3 | 4 | 5;
@ -75,12 +64,8 @@ export class MediaMetadataEntity implements MediaMetadata {
/** /**
* Caches the list of persons. Only used for searching * Caches the list of persons. Only used for searching
*/ */
@Index()
@Column({ @Column({
type: 'varchar', type: 'simple-array', select: false, nullable: true,
select: false, nullable: true,
length: 512,
transformer: arrayTransformer,
charset: columnCharsetCS.charset, charset: columnCharsetCS.charset,
collation: columnCharsetCS.collation collation: columnCharsetCS.collation
}) })
@ -104,7 +89,6 @@ export abstract class MediaEntity implements MediaDTO {
@PrimaryGeneratedColumn({unsigned: true}) @PrimaryGeneratedColumn({unsigned: true})
id: number; id: number;
@Index()
@Column(columnCharsetCS) @Column(columnCharsetCS)
name: string; name: string;

View File

@ -10,8 +10,7 @@ export class CameraMetadataEntity implements CameraMetadata {
@Column({ @Column({
type: 'varchar', nullable: true, type: 'text', nullable: true,
length: 64,
charset: columnCharsetCS.charset, charset: columnCharsetCS.charset,
collation: columnCharsetCS.collation collation: columnCharsetCS.collation
}) })
@ -19,8 +18,7 @@ export class CameraMetadataEntity implements CameraMetadata {
@Column({ @Column({
type: 'varchar', nullable: true, type: 'text', nullable: true,
length: 64,
charset: columnCharsetCS.charset, charset: columnCharsetCS.charset,
collation: columnCharsetCS.collation collation: columnCharsetCS.collation
}) })
@ -58,8 +56,7 @@ export class PositionMetaDataEntity implements PositionMetaData {
@Index() @Index()
@Column({ @Column({
type: 'varchar', nullable: true, type: 'text', nullable: true,
length: 64,
charset: columnCharsetCS.charset, charset: columnCharsetCS.charset,
collation: columnCharsetCS.collation collation: columnCharsetCS.collation
}) })
@ -67,8 +64,7 @@ export class PositionMetaDataEntity implements PositionMetaData {
@Index() @Index()
@Column({ @Column({
type: 'varchar', nullable: true, type: 'text', nullable: true,
length: 64,
charset: columnCharsetCS.charset, charset: columnCharsetCS.charset,
collation: columnCharsetCS.collation collation: columnCharsetCS.collation
}) })
@ -76,8 +72,7 @@ export class PositionMetaDataEntity implements PositionMetaData {
@Index() @Index()
@Column({ @Column({
type: 'varchar', nullable: true, type: 'text', nullable: true,
length: 64,
charset: columnCharsetCS.charset, charset: columnCharsetCS.charset,
collation: columnCharsetCS.collation collation: columnCharsetCS.collation
}) })

View File

@ -1 +1 @@
export const DataStructureVersion = 20; export const DataStructureVersion = 21;

View File

@ -42,8 +42,12 @@ export class IndexingSettingsComponent extends SettingsComponentDirective<Server
} }
get Config(): any {
return {indexChangesOnly: true};
}
get Progress(): JobProgressDTO { get Progress(): JobProgressDTO {
return this.jobsService.progress.value[JobDTOUtils.getHashName(DefaultsJobs[DefaultsJobs.Indexing])]; return this.jobsService.progress.value[JobDTOUtils.getHashName(DefaultsJobs[DefaultsJobs.Indexing], this.Config)];
} }
@ -77,7 +81,7 @@ export class IndexingSettingsComponent extends SettingsComponentDirective<Server
this.inProgress = true; this.inProgress = true;
this.error = ''; this.error = '';
try { try {
await this.jobsService.start(DefaultsJobs[DefaultsJobs.Indexing], {indexChangesOnly: true}); await this.jobsService.start(DefaultsJobs[DefaultsJobs.Indexing], this.Config);
this.notification.info($localize`Folder indexing started`); this.notification.info($localize`Folder indexing started`);
this.inProgress = false; this.inProgress = false;
return true; return true;