Refine audit and rank tracking indexes (#378)
This commit is contained in:
parent
d7b52f0876
commit
e264ee3472
4
drizzle-pg/0009_supreme_captain_stacy.sql
Normal file
4
drizzle-pg/0009_supreme_captain_stacy.sql
Normal file
@ -0,0 +1,4 @@
|
||||
DROP INDEX "audit_issues_audit_id_idx";--> statement-breakpoint
|
||||
DROP INDEX "audit_links_audit_id_idx";--> statement-breakpoint
|
||||
DROP INDEX "audit_pages_audit_id_idx";--> statement-breakpoint
|
||||
CREATE INDEX "rank_tracking_configs_project_active_created_idx" ON "rank_tracking_configs" USING btree ("project_id","is_active","created_at");
|
||||
3392
drizzle-pg/meta/0009_snapshot.json
Normal file
3392
drizzle-pg/meta/0009_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -64,6 +64,13 @@
|
||||
"when": 1783630716543,
|
||||
"tag": "0008_yummy_annihilus",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 9,
|
||||
"version": "7",
|
||||
"when": 1783699015488,
|
||||
"tag": "0009_supreme_captain_stacy",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
4
drizzle/0032_public_shinko_yamashiro.sql
Normal file
4
drizzle/0032_public_shinko_yamashiro.sql
Normal file
@ -0,0 +1,4 @@
|
||||
DROP INDEX `audit_issues_audit_id_idx`;--> statement-breakpoint
|
||||
DROP INDEX `audit_links_audit_id_idx`;--> statement-breakpoint
|
||||
DROP INDEX `audit_pages_audit_id_idx`;--> statement-breakpoint
|
||||
CREATE INDEX `rank_tracking_configs_project_active_created_idx` ON `rank_tracking_configs` (`project_id`,`is_active`,`created_at`);
|
||||
3081
drizzle/meta/0032_snapshot.json
Normal file
3081
drizzle/meta/0032_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -225,6 +225,13 @@
|
||||
"when": 1783630714621,
|
||||
"tag": "0031_furry_monster_badoon",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 32,
|
||||
"version": "6",
|
||||
"when": 1783699001850,
|
||||
"tag": "0032_public_shinko_yamashiro",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -235,6 +235,11 @@ export const rankTrackingConfigs = sqliteTable(
|
||||
.default(sql`(current_timestamp)`),
|
||||
},
|
||||
(table) => [
|
||||
index("rank_tracking_configs_project_active_created_idx").on(
|
||||
table.projectId,
|
||||
table.isActive,
|
||||
table.createdAt,
|
||||
),
|
||||
uniqueIndex("rank_tracking_configs_national_idx")
|
||||
.on(table.projectId, table.domain, table.locationCode)
|
||||
.where(sql`${table.locationName} IS NULL`),
|
||||
|
||||
@ -113,10 +113,7 @@ export const auditPages = sqliteTable(
|
||||
// Performance
|
||||
responseTimeMs: integer("response_time_ms"),
|
||||
},
|
||||
(table) => [
|
||||
index("audit_pages_audit_id_idx").on(table.auditId),
|
||||
index("audit_pages_audit_url_idx").on(table.auditId, table.url),
|
||||
],
|
||||
(table) => [index("audit_pages_audit_url_idx").on(table.auditId, table.url)],
|
||||
);
|
||||
|
||||
// One row per unique (source page, target URL) link edge. Currently only
|
||||
@ -143,7 +140,6 @@ export const auditLinks = sqliteTable(
|
||||
.default(false),
|
||||
},
|
||||
(table) => [
|
||||
index("audit_links_audit_id_idx").on(table.auditId),
|
||||
index("audit_links_audit_target_idx").on(table.auditId, table.targetUrl),
|
||||
],
|
||||
);
|
||||
@ -168,7 +164,6 @@ export const auditIssues = sqliteTable(
|
||||
detailsJson: text("details_json"),
|
||||
},
|
||||
(table) => [
|
||||
index("audit_issues_audit_id_idx").on(table.auditId),
|
||||
index("audit_issues_audit_type_idx").on(table.auditId, table.issueType),
|
||||
],
|
||||
);
|
||||
|
||||
@ -236,6 +236,11 @@ export const rankTrackingConfigs = pgTable(
|
||||
createdAt: timestampColumn("created_at").notNull().default(isoNow),
|
||||
},
|
||||
(table) => [
|
||||
index("rank_tracking_configs_project_active_created_idx").on(
|
||||
table.projectId,
|
||||
table.isActive,
|
||||
table.createdAt,
|
||||
),
|
||||
uniqueIndex("rank_tracking_configs_national_idx")
|
||||
.on(table.projectId, table.domain, table.locationCode)
|
||||
.where(sql`${table.locationName} IS NULL`),
|
||||
|
||||
@ -112,10 +112,7 @@ export const auditPages = pgTable(
|
||||
// Performance
|
||||
responseTimeMs: integer("response_time_ms"),
|
||||
},
|
||||
(table) => [
|
||||
index("audit_pages_audit_id_idx").on(table.auditId),
|
||||
index("audit_pages_audit_url_idx").on(table.auditId, table.url),
|
||||
],
|
||||
(table) => [index("audit_pages_audit_url_idx").on(table.auditId, table.url)],
|
||||
);
|
||||
|
||||
// One row per unique (source page, target URL) link edge. Currently only
|
||||
@ -138,7 +135,6 @@ export const auditLinks = pgTable(
|
||||
isNofollow: boolean("is_nofollow").notNull().default(false),
|
||||
},
|
||||
(table) => [
|
||||
index("audit_links_audit_id_idx").on(table.auditId),
|
||||
index("audit_links_audit_target_idx").on(table.auditId, table.targetUrl),
|
||||
],
|
||||
);
|
||||
@ -163,7 +159,6 @@ export const auditIssues = pgTable(
|
||||
detailsJson: text("details_json"),
|
||||
},
|
||||
(table) => [
|
||||
index("audit_issues_audit_id_idx").on(table.auditId),
|
||||
index("audit_issues_audit_type_idx").on(table.auditId, table.issueType),
|
||||
],
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user