@@ -55,6 +55,7 @@ import WhereLanguageControlled from '@/components/WhereLanguageControlled';
55
55
import { IS_LOCAL_MODE } from '@/config' ;
56
56
import { DisplayType } from '@/DisplayType' ;
57
57
import { useQueriedChartConfig } from '@/hooks/useChartConfig' ;
58
+ import { useExplainQuery } from '@/hooks/useExplainQuery' ;
58
59
import { withAppNav } from '@/layout' ;
59
60
import {
60
61
ChartConfig ,
@@ -151,6 +152,33 @@ function SearchTotalCount({
151
152
) ;
152
153
}
153
154
155
+ function SearchNumRows ( {
156
+ config,
157
+ enabled,
158
+ } : {
159
+ config : ChartConfigWithDateRange ;
160
+ enabled : boolean ;
161
+ } ) {
162
+ const { data, isLoading, error } = useExplainQuery ( config , {
163
+ enabled,
164
+ } ) ;
165
+
166
+ if ( ! enabled ) {
167
+ return null ;
168
+ }
169
+
170
+ const numRows = data ?. [ 0 ] ?. rows ;
171
+ return (
172
+ < Text size = "xs" c = "gray.4" mb = { 4 } >
173
+ { isLoading
174
+ ? 'Scanned Rows ...'
175
+ : error || ! numRows
176
+ ? ''
177
+ : `Scanned Rows: ${ numRows } ` }
178
+ </ Text >
179
+ ) ;
180
+ }
181
+
154
182
function SaveSearchModal ( {
155
183
searchedConfig,
156
184
opened,
@@ -1006,26 +1034,40 @@ function DBSearchPage() {
1006
1034
) }
1007
1035
< div style = { { display : 'flex' , flexDirection : 'column' } } >
1008
1036
{ analysisMode === 'results' && (
1009
- < Box style = { { height : 120 , minHeight : 120 } } p = "xs" mb = "md" >
1037
+ < Box
1038
+ style = { { height : 140 , minHeight : 140 } }
1039
+ p = "xs"
1040
+ pb = "md"
1041
+ mb = "md"
1042
+ >
1010
1043
{ chartConfig && (
1011
1044
< >
1012
- < SearchTotalCount
1013
- config = { {
1014
- ...chartConfig ,
1015
- select : [
1016
- {
1017
- aggFn : 'count' ,
1018
- aggCondition : '' ,
1019
- valueExpression : '' ,
1020
- } ,
1021
- ] ,
1022
- orderBy : undefined ,
1023
- granularity : 'auto' ,
1024
- dateRange : searchedTimeRange ,
1025
- displayType : DisplayType . StackedBar ,
1026
- } }
1027
- queryKeyPrefix = { QUERY_KEY_PREFIX }
1028
- />
1045
+ < Group justify = "space-between" mb = { 4 } >
1046
+ < SearchTotalCount
1047
+ config = { {
1048
+ ...chartConfig ,
1049
+ select : [
1050
+ {
1051
+ aggFn : 'count' ,
1052
+ aggCondition : '' ,
1053
+ valueExpression : '' ,
1054
+ } ,
1055
+ ] ,
1056
+ orderBy : undefined ,
1057
+ granularity : 'auto' ,
1058
+ dateRange : searchedTimeRange ,
1059
+ displayType : DisplayType . StackedBar ,
1060
+ } }
1061
+ queryKeyPrefix = { QUERY_KEY_PREFIX }
1062
+ />
1063
+ < SearchNumRows
1064
+ config = { {
1065
+ ...chartConfig ,
1066
+ dateRange : searchedTimeRange ,
1067
+ } }
1068
+ enabled = { isReady }
1069
+ />
1070
+ </ Group >
1029
1071
< DBTimeChart
1030
1072
sourceId = { searchedConfig . source ?? undefined }
1031
1073
showLegend = { false }
0 commit comments