@@ -135,7 +135,7 @@ fn append_utf8_view_value(builder: &mut StringViewBuilder, value: &str) {
135135/// * Number of RowSelections = 14054784
136136/// * Average run length of each RowSelection: 99997497 / 14054784 = 7.114
137137///
138- /// The properties of this array are :
138+ /// A 100K-row reference generated by this shape has :
139139/// * Selectivity is: 15144 / 100000 = 0.15144
140140/// * Number of RowSelections = 12904
141141/// * Average run length of each RowSelection: 100000 / 12904 = 7.75
@@ -173,7 +173,8 @@ fn create_ts_array(size: usize) -> ArrayRef {
173173 Arc :: new ( TimestampMillisecondArray :: from ( values) ) as ArrayRef
174174}
175175
176- /// Creates a RecordBatch with 100K rows and 4 columns: int64, float64, utf8View, and ts.
176+ /// Creates a RecordBatch with `size` rows and 4 columns: int64, float64,
177+ /// utf8View, and ts.
177178pub ( crate ) fn create_record_batch ( size : usize ) -> RecordBatch {
178179 let fields = vec ! [
179180 Field :: new( "int64" , DataType :: Int64 , false ) ,
@@ -319,13 +320,134 @@ impl std::fmt::Display for AsyncStrategy {
319320/// The variants correspond to the different filter patterns.
320321#[ derive( Clone , Copy , Debug ) ]
321322pub ( crate ) enum FilterType {
323+ /// point lookup: selects a single row in 500K.
324+ /// ```text
325+ /// ┌───────────────┐ ┌───────────────┐
326+ /// │ │ │ │
327+ /// │ │ │ ... │
328+ /// │ │ │ │
329+ /// │ │ │ │
330+ /// │ ... │ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
331+ /// │ │ │ │
332+ /// │ │ │ ... │
333+ /// │ │ │ │
334+ /// │ │ │ │
335+ /// └───────────────┘ └───────────────┘
336+ /// ```
322337 PointLookup ,
338+ /// selective (1%) unclustered filter: approx 5K selected rows in 500K.
339+ /// ```text
340+ /// ┌───────────────┐ ┌───────────────┐
341+ /// │ ... │ │ │
342+ /// │ │ │ │
343+ /// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │ │
344+ /// │ │ │ ... │
345+ /// │ │ │ │
346+ /// │ │ │ │
347+ /// │ ... │ │ │
348+ /// │ │ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
349+ /// │ │ │ │
350+ /// └───────────────┘ └───────────────┘
351+ /// ```
323352 SelectiveUnclustered ,
353+ /// moderately selective (10%) clustered filter: 50 selected runs of 1K
354+ /// rows each in 500K.
355+ /// ```text
356+ /// ┌───────────────┐ ┌───────────────┐
357+ /// │ │ │ │
358+ /// │ │ │ │
359+ /// │ ... │ │ ... │
360+ /// │ │ │ │
361+ /// │ │ │ │
362+ /// │ │ │ │
363+ /// │ │ │ │
364+ /// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
365+ /// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
366+ /// └───────────────┘ └───────────────┘
367+ /// ```
324368 ModeratelySelectiveClustered ,
369+ /// moderately selective (~9%) unclustered filter: approx 45K selected
370+ /// rows in 500K.
371+ /// ```text
372+ /// ┌───────────────┐ ┌───────────────┐
373+ /// │ ... │ │ │
374+ /// │ │ │ │
375+ /// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
376+ /// │ │ │ │
377+ /// │ │ │ │
378+ /// │ │ │ ... │
379+ /// │ ... │ │ │
380+ /// │ │ │ │
381+ /// │ │ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
382+ /// └───────────────┘ └───────────────┘
383+ /// ```
325384 ModeratelySelectiveUnclustered ,
385+ /// unselective (99%) unclustered filter: approx 495K selected rows in
386+ /// 500K.
387+ /// ```text
388+ /// ┌───────────────┐ ┌───────────────┐
389+ /// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
390+ /// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
391+ /// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
392+ /// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
393+ /// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
394+ /// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │ │
395+ /// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
396+ /// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
397+ /// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
398+ /// └───────────────┘ └───────────────┘
399+ /// ```
326400 UnselectiveUnclustered ,
401+ /// unselective (90%) clustered filter: 50 selected runs of 9K rows each
402+ /// in 500K.
403+ /// ```text
404+ /// ┌───────────────┐ ┌───────────────┐
405+ /// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
406+ /// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
407+ /// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
408+ /// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
409+ /// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
410+ /// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
411+ /// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
412+ /// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │ ... │
413+ /// │ │ │ │
414+ /// └───────────────┘ └───────────────┘
415+ /// ```
327416 UnselectiveClustered ,
417+ /// composite sparse filter: `SelectiveUnclustered` AND
418+ /// `ModeratelySelectiveClustered`, approx 0.1% selected rows in 500K.
419+ /// ```text
420+ /// ┌───────────────┐ ┌───────────────┐
421+ /// │ │ │ │
422+ /// │ │ │ ... │
423+ /// │ │ │ │
424+ /// │ │ │ │
425+ /// │ ... │ │ │
426+ /// │ │ │ │
427+ /// │ │ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
428+ /// │ │ │ │
429+ /// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │ │
430+ /// └───────────────┘ └───────────────┘
431+ /// ```
328432 Composite ,
433+ /// `utf8View <> ''` modeling [ClickBench] [Q21-Q27] with fragmented
434+ /// short string runs and sentinel values every 1K rows.
435+ /// ```text
436+ /// ┌───────────────┐ ┌───────────────┐
437+ /// │ │ │ │
438+ /// │ ... │ │ ... │
439+ /// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │ │
440+ /// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │ │
441+ /// │ │ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
442+ /// │ │ │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│
443+ /// │ ... │ │ ... │
444+ /// │ │ │ │
445+ /// │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ │ │
446+ /// └───────────────┘ └───────────────┘
447+ /// ```
448+ ///
449+ /// [ClickBench]: https://github.com/ClickHouse/ClickBench
450+ /// [Q21-Q27]: https://github.com/apache/datafusion/blob/b7177234e65cbbb2dcc04c252f6acd80bb026362/benchmarks/queries/clickbench/queries.sql#L22-L28
329451 Utf8ViewNonEmpty ,
330452}
331453
0 commit comments