mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-15 00:31:58 +00:00
行数的来源分清「逐行数出来的准数」和「数到整表统计行数上限为止」:以前没超过上限、已经数全的表也写「数到上限为止」,读着像被截断了
This commit is contained in:
@@ -2988,8 +2988,9 @@ export const PROFILE_TEXT = {
|
||||
rowsCount: (n: number) => `${formatNumber(n)} 行`,
|
||||
rowsAtLeast: (n: number) => `超过 ${formatNumber(n - 1)} 行`,
|
||||
rowsUnknown: '没能得到行数',
|
||||
rowsHint: { stats: '数据库统计信息中的估算值', count: '计数到整表统计行数上限为止' } as Record<string, string>,
|
||||
rowsSource: { stats: '来自数据库统计信息', count: '数到整表统计行数上限为止' } as Record<string, string>,
|
||||
// count 是逐行数完了(没超过整表统计行数上限,是准数);capped 是数到上限还没数完,只知道至少多少行
|
||||
rowsHint: { stats: '数据库统计信息中的估算值', count: '逐行数出来的准数,没超过整表统计行数上限', capped: '计数到整表统计行数上限为止' } as Record<string, string>,
|
||||
rowsSource: { stats: '来自数据库统计信息', count: '逐行数出来的', capped: '数到整表统计行数上限为止' } as Record<string, string>,
|
||||
openTable: '打开',
|
||||
openTableLabel: (name: string) => `打开「${name}」`,
|
||||
findingRelations: '关联关系',
|
||||
|
||||
@@ -219,7 +219,7 @@ export function agoText(v: string | null | undefined, now = Date.now()): string
|
||||
return days <= 30 ? `${days} 天前` : formatTime(d)
|
||||
}
|
||||
|
||||
/** 行数估算写成人话,带来源(统计信息 / 数到上限);没有估算为 null */
|
||||
/** 行数估算写成人话,带来源(统计信息 / 逐行数出来的 / 数到上限);没有估算为 null */
|
||||
export function sizeText(size: CatalogProfileSize | null | undefined): { text: string; hint?: string; source?: string } | null {
|
||||
if (!size) return null
|
||||
if (size.rows != null) {
|
||||
@@ -227,7 +227,7 @@ export function sizeText(size: CatalogProfileSize | null | undefined): { text: s
|
||||
hint: PROFILE_TEXT.rowsHint[size.method], source: PROFILE_TEXT.rowsSource[size.method] }
|
||||
}
|
||||
if (size.at_least != null) {
|
||||
return { text: PROFILE_TEXT.rowsAtLeast(size.at_least), hint: PROFILE_TEXT.rowsHint.count, source: PROFILE_TEXT.rowsSource.count }
|
||||
return { text: PROFILE_TEXT.rowsAtLeast(size.at_least), hint: PROFILE_TEXT.rowsHint.capped, source: PROFILE_TEXT.rowsSource.capped }
|
||||
}
|
||||
return { text: PROFILE_TEXT.rowsUnknown }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user