mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-11-30 17:37:01 +00:00
Initial add of index advisor tab.
This commit is contained in:
parent
ceed162491
commit
7c0d1642fd
46
src/Explorer/Controls/Query/IndexAdvisorComponent.tsx
Normal file
46
src/Explorer/Controls/Query/IndexAdvisorComponent.tsx
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
import {
|
||||||
|
Checkbox,
|
||||||
|
CheckboxVisibility,
|
||||||
|
DetailsHeader,
|
||||||
|
DetailsList,
|
||||||
|
IDetailsHeaderProps,
|
||||||
|
IDetailsListCheckboxProps,
|
||||||
|
IRenderFunction,
|
||||||
|
Stack,
|
||||||
|
Text
|
||||||
|
} from "@fluentui/react";
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
|
interface IndexAdvisorComponentProps { };
|
||||||
|
|
||||||
|
export const IndexAdvisorComponent: React.FC = (): JSX.Element => {
|
||||||
|
|
||||||
|
const onRenderCheckbox = (props: IDetailsListCheckboxProps, _defaultRender?: IRenderFunction<IDetailsListCheckboxProps>) => {
|
||||||
|
return <Checkbox {...props} />;
|
||||||
|
};
|
||||||
|
|
||||||
|
const onRenderDetailsHeader = (props: IDetailsHeaderProps, _defaultRender?: IRenderFunction<IDetailsHeaderProps>) => {
|
||||||
|
return <DetailsHeader {...props} ariaLabelForSelectAllCheckbox="Select all" />;
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Stack>
|
||||||
|
<Text>
|
||||||
|
Here is an analysis on the indexes utilized for executing this query.
|
||||||
|
Based on the analysis, Cosmos DB recommends adding the selected index(es) to your indexing policy to
|
||||||
|
optimize your query performance.
|
||||||
|
</Text>
|
||||||
|
<Text>Indexes analysis</Text>
|
||||||
|
<DetailsList
|
||||||
|
items={[]}
|
||||||
|
groups={[]}
|
||||||
|
columns={[]}
|
||||||
|
onRenderCheckbox={onRenderCheckbox}
|
||||||
|
checkboxVisibility={CheckboxVisibility.always}
|
||||||
|
onRenderDetailsHeader={onRenderDetailsHeader}
|
||||||
|
groupProps={{
|
||||||
|
showEmptyGroups: true,
|
||||||
|
}}/>
|
||||||
|
</Stack>
|
||||||
|
);
|
||||||
|
};
|
@ -195,7 +195,10 @@ export default class QueryTabComponent extends React.Component<IQueryTabComponen
|
|||||||
this.props.collection.databaseId,
|
this.props.collection.databaseId,
|
||||||
this.props.collection.id(),
|
this.props.collection.id(),
|
||||||
this.state.selectedContent || this.state.sqlQueryEditorContent,
|
this.state.selectedContent || this.state.sqlQueryEditorContent,
|
||||||
{ enableCrossPartitionQuery: HeadersUtility.shouldEnableCrossPartitionKey() } as FeedOptions
|
{
|
||||||
|
enableCrossPartitionQuery: HeadersUtility.shouldEnableCrossPartitionKey(),
|
||||||
|
populateIndexMetrics: userContext.apiType === "SQL",
|
||||||
|
} as FeedOptions
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user