Page Not Found
35 |Something went wrong! Please try again
10 |Error: {error.message}
11 | 15 |Something went wrong! Please try again
14 |Error: {error.message}
15 | 19 |PK | 42 |FK | 43 |Column | 44 |Type | 45 |Constraints | 46 |
---|
{databaseSizeTotal}
28 |{`${table.tableName}: ${table.numberOfFields}`}
49 | // ) 50 | // }) 51 | 52 | 53 | 54 | return ( 55 | 56 | <> 57 |{tablesArray.length}
62 |{totalNumberOfFields}
68 |{averagePrimaryKeys}
76 |{averageForeignKeys}
82 |{averageForeignKeys}
*/} -------------------------------------------------------------------------------- /src/components/charts/IndexPerTable.tsx: -------------------------------------------------------------------------------- 1 | import { Bar } from 'react-chartjs-2'; 2 | import { Chart as ChartJS, ArcElement, Tooltip, Legend, ChartOptions } from 'chart.js'; 3 | import React from 'react'; 4 | import useAppStore from '../../store/appStore'; 5 | import { TableInfo } from '../../store/appStore'; 6 | 7 | ChartJS.register(ArcElement, Tooltip, Legend); 8 | 9 | 10 | 11 | export const IndexPerTable: React.FC = () => { 12 | const { metricsData, theme } = useAppStore(); 13 | const tablesArray: TableInfo[] = Object.values(metricsData.databaseInfo); 14 | const indexData = tablesArray.map(table => { 15 | return { 16 | tableName: table.tableName, 17 | numberOfIndexes: table.numberOfIndexes, 18 | }; 19 | }); 20 | // Sort the indexData array based on the numberOfIndexes in descending order 21 | indexData.sort((a, b) => b.numberOfIndexes - a.numberOfIndexes); 22 | 23 | const options: ChartOptions = { 24 | indexAxis: "y", 25 | responsive: true, 26 | maintainAspectRatio: false, 27 | layout: { 28 | padding: 0 29 | }, 30 | plugins: { 31 | title: { 32 | display: true, 33 | text: 'Indexes Per Table', 34 | color: theme === "light" ? '#17012866' : '#ffffffac', 35 | font: { 36 | size: 14 37 | } 38 | }, 39 | legend: { 40 | display: true, 41 | position: 'bottom' as const, 42 | labels:{ 43 | font: { 44 | size: 12 45 | }, 46 | }, 47 | }, 48 | 49 | }, 50 | }; 51 | const data = { 52 | labels: indexData.map(table => table.tableName), 53 | datasets: [ 54 | { 55 | label: 'Number of Indexes', 56 | data: indexData.map(table => table.numberOfIndexes), 57 | backgroundColor: 'rgba(53, 162, 235, 0.5)', 58 | scaleFontColor: '#FFFFFF', 59 | // backgroundColor: [ 60 | // 'rgba(190, 99, 255, 0.2)', 61 | // 'rgba(54, 162, 235, 0.2)', 62 | // 'rgba(235, 86, 255, 0.2)', 63 | // 'rgba(16, 39, 215, 0.2)', 64 | // 'rgba(129, 75, 236, 0.2)', 65 | // 'rgba(64, 118, 255, 0.2)', 66 | // ], 67 | borderColor: [ 68 | '#dbdbdbdf', 69 | // "rgba(54, 162, 235, 1)", 70 | // "rgba(255, 206, 86, 1)", 71 | // "rgba(75, 192, 192, 1)", 72 | // "rgba(153, 102, 255, 1)", 73 | // "rgba(255, 159, 64, 1)", 74 | ], 75 | borderWidth: 1, 76 | } 77 | ] 78 | }; 79 | return ( 80 |{tablesObject.nodeType}
31 |{tablesObject.actualRows}
37 |{tablesObject.actualLoops}
39 |{tablesObject.sharedHitBlocks}
45 |{tablesObject.sharedReadBlocks}
47 |{tablesObject.startUpCosts}
53 |{tablesObject.totalCosts}
55 |Invalid URI
} 39 | 45 |© 2023 ScanQL | MIT License
59 |1. Click on the Dropdown icon on the top right of the page.
34 |2. Click on the "Connect to Database" button.
35 |3. Enter your Postgres URI string.
36 | 37 |Custom Query
38 |To generate custom query metrics enter a valid query.
39 |General Tips
42 |Click on the Refresh Icon found in the dashboard in order for the most recent database information.
43 | 44 | 45 |