@@ -112,20 +112,6 @@ pub(crate) struct VidBatcher {
112112}
113113
114114impl VidBatcher {
115- fn histogram_bounds (
116- conn : & mut PgConnection ,
117- nsp : & Namespace ,
118- table : & Table ,
119- range : VidRange ,
120- ) -> Result < Vec < i64 > , StoreError > {
121- let bounds = catalog:: histogram_bounds ( conn, nsp, & table. name , VID_COLUMN ) ?
122- . into_iter ( )
123- . filter ( |bound| range. min < * bound && range. max > * bound)
124- . chain ( vec ! [ range. min, range. max] . into_iter ( ) )
125- . collect :: < Vec < _ > > ( ) ;
126- Ok ( bounds)
127- }
128-
129115 /// Initialize a batcher for batching through entries in `table` with
130116 /// `vid` in the given `vid_range`
131117 ///
@@ -138,7 +124,7 @@ impl VidBatcher {
138124 table : & Table ,
139125 vid_range : VidRange ,
140126 ) -> Result < Self , StoreError > {
141- let bounds = Self :: histogram_bounds ( conn, nsp, table, vid_range ) ?;
127+ let bounds = catalog :: histogram_bounds ( conn, nsp, & table. name , VID_COLUMN ) ?;
142128 let batch_size = AdaptiveBatchSize :: new ( table) ;
143129 Self :: new ( bounds, vid_range, batch_size)
144130 }
@@ -150,6 +136,12 @@ impl VidBatcher {
150136 ) -> Result < Self , StoreError > {
151137 let start = range. min ;
152138
139+ let bounds = bounds
140+ . into_iter ( )
141+ . filter ( |bound| range. min < * bound && range. max > * bound)
142+ . chain ( vec ! [ range. min, range. max] . into_iter ( ) )
143+ . collect :: < Vec < _ > > ( ) ;
144+
153145 let mut ogive = if range. is_empty ( ) {
154146 None
155147 } else {
0 commit comments