feat(gaussdb): make count query parallelism configurable
This commit is contained in:
1 parent
4ce27f8ae5
commit
f6b91e93dc
16 files changed
+235
-3
No files matched your search
@@ -121,13 +121,16 @@ import {
|
||||
import {
|
||||
GAUSSDB_M_JDBC_DRIVER_CLASS,
|
||||
gaussdbConnectionMode,
|
||||
gaussdbCountQueryDop,
|
||||
gaussdbIdentifierQuoteStyle,
|
||||
gaussdbTargetServerType,
|
||||
setGaussdbConnectionMode,
|
||||
setGaussdbCountQueryDop,
|
||||
setGaussdbIdentifierQuoteStyle,
|
||||
setGaussdbTargetServerType,
|
||||
supportsGaussdbIdentifierQuoteStyle,
|
||||
type GaussdbConnectionMode,
|
||||
type GaussdbCountQueryDop,
|
||||
type GaussdbIdentifierQuoteStyle,
|
||||
type GaussdbTargetServerType,
|
||||
} from "@/lib/database/jdbcDialect";
|
||||
@@ -551,6 +554,14 @@ const gaussdbTargetServerTypeComputed = computed<GaussdbTargetServerType>({
|
||||
},
|
||||
});
|
||||
|
||||
const gaussdbCountQueryDopComputed = computed<GaussdbCountQueryDop>({
|
||||
get: () => gaussdbCountQueryDop(form.value),
|
||||
set: (value) => {
|
||||
setGaussdbCountQueryDop(form.value, value);
|
||||
resetTestState();
|
||||
},
|
||||
});
|
||||
|
||||
const gaussdbHostEntries = ref<GaussdbHostEntry[]>(parseGaussdbHosts(form.value.host, form.value.port));
|
||||
|
||||
watch(
|
||||
@@ -8010,6 +8021,26 @@ function openExternalUrl(url: string) {
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="showGaussdbConnectionMode" class="grid grid-cols-4 items-start gap-4">
|
||||
<Label :class="connectionLabelSmallPaddedClass">{{ t("connection.gaussdbCountQueryDop") }}</Label>
|
||||
<div class="col-span-3 grid gap-1">
|
||||
<Select v-model="gaussdbCountQueryDopComputed">
|
||||
<SelectTrigger class="h-9">
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem :value="1">1 ({{ t("common.disabled") }})</SelectItem>
|
||||
<SelectItem :value="2">2</SelectItem>
|
||||
<SelectItem :value="4">4</SelectItem>
|
||||
<SelectItem :value="8">8</SelectItem>
|
||||
<SelectItem :value="16">16</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<p class="text-xs leading-5 text-muted-foreground">
|
||||
{{ t("connection.gaussdbCountQueryDopHint") }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid grid-cols-4 items-center gap-4">
|
||||
<Label :class="connectionLabelSmallClass">{{ t("connection.connectTimeout") }}</Label>
|
||||
<div class="col-span-3 grid grid-cols-2 gap-2">
|
||||
|
||||
@@ -265,7 +265,7 @@ import { buildColumnIndexMap, columnIndexColorClass, columnIndexMetadataRequestC
|
||||
import { supportsTableStructureEditing } from "@/lib/database/databaseCapabilities";
|
||||
import { rememberDataGridConditionHistory } from "@/lib/dataGrid/dataGridConditionHistory";
|
||||
import { restoreDataGridLocalColumnFilters, serializeDataGridLocalColumnFilters } from "@/lib/dataGrid/dataGridLocalColumnFilterState";
|
||||
import { effectiveDatabaseTypeForConnection } from "@/lib/database/jdbcDialect";
|
||||
import { effectiveDatabaseTypeForConnection, gaussdbCountQueryDopHint } from "@/lib/database/jdbcDialect";
|
||||
import { mongoCollectionSupportsIndexes, supportsMongoIndexMutations } from "@/lib/mongo/mongoCapabilities";
|
||||
import { refreshLoadedMongoIndexes } from "@/lib/mongo/mongoIndexMetadata";
|
||||
import { isProtectedMongoIndex, mongoDropAllIndexesPreview, mongoDropIndexFailureCount, mongoDropIndexPreview } from "@/lib/sidebar/mongoCollectionMutation";
|
||||
@@ -3286,6 +3286,7 @@ async function lastPage() {
|
||||
async function buildCurrentCountTarget(): Promise<{ sql: string; schema?: string } | undefined> {
|
||||
if (props.countSql) return { sql: props.countSql, schema: props.schema };
|
||||
if (props.tableMeta) {
|
||||
const countHint = resolvedDatabaseType.value === "gaussdb" && props.connectionId ? gaussdbCountQueryDopHint(connectionStore.getConfig(props.connectionId)) : undefined;
|
||||
const sql = await buildDataGridCountSql({
|
||||
databaseType: props.databaseType,
|
||||
identifierQuote: connectionStore.connectionIdentifierQuote?.(props.connectionId),
|
||||
@@ -3294,6 +3295,7 @@ async function buildCurrentCountTarget(): Promise<{ sql: string; schema?: string
|
||||
schema: props.tableMeta.schema,
|
||||
tableName: props.tableMeta.tableName,
|
||||
whereInput: currentWhereInput(),
|
||||
countHint,
|
||||
});
|
||||
return {
|
||||
sql,
|
||||
|
||||
Reference in new issue
Block a user