mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-09 22:51:02 +00:00
commit
7f1b1f63ef
3 changed files with 12 additions and 6 deletions
|
|
@ -302,7 +302,7 @@ The config file is in the [toml format](https://github.com/toml-lang/toml) and h
|
|||
|
||||
```toml
|
||||
[metric]
|
||||
service = “statsd”
|
||||
service = "statsd"
|
||||
```
|
||||
|
||||
#### Metric Host
|
||||
|
|
@ -319,7 +319,7 @@ The config file is in the [toml format](https://github.com/toml-lang/toml) and h
|
|||
#### Metric Poll Interval
|
||||
|
||||
* Description: Rate at which runtime metrics (such as open file handles and memory usage) are collected.
|
||||
* Flag: `metric.poll-interval=”0m15s”`
|
||||
* Flag: `metric.poll-interval="0m15s"`
|
||||
* Env: `PILOSA_METRIC_POLL_INTERVAL=0m15s`
|
||||
* Config:
|
||||
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ lfm := pdk.LinearFloatMapper{
|
|||
}
|
||||
```
|
||||
|
||||
`Min` and `Max` define the linear function, and `Res` determines the maximum allowed value for the output row ID - we chose these values to produce a “round to nearest integer” behavior. Other predefined mappers have their own specific parameters, usually two or three.
|
||||
`Min` and `Max` define the linear function, and `Res` determines the maximum allowed value for the output row ID - we chose these values to produce a "round to nearest integer" behavior. Other predefined mappers have their own specific parameters, usually two or three.
|
||||
|
||||
This mapper function is the core operation, but we need a few other pieces to define the overall process, which is encapsulated in the ColumnMapper object. This object defines which field(s) of the input data source to use (`Fields`), how to parse them (`Parsers`), what mapping to use (`Mapper`), and the name of the field to use (`Field`). <!-- TODO update so this makes sense -->
|
||||
```go
|
||||
|
|
|
|||
|
|
@ -615,9 +615,15 @@ have the attribute specified by `attrName` with one of the values specified in
|
|||
|
||||
**Caveats:**
|
||||
|
||||
* Performing a TopN() query on a field with cache type ranked will return the top rows sorted by count in descending order.
|
||||
* Fields with cache type lru will maintain an LRU (Least Recently Used replacement policy) cache, thus a TopN query on this type of field will return rows sorted in order of most recently set bit.
|
||||
* The field's cache size determines the number of sorted rows to maintain in the cache for purposes of TopN queries. There is a tradeoff between performance and accuracy; increasing the cache size will improve accuracy of results at the cost of performance.
|
||||
In general, the order of the resulting row keys is not guaranteed to reflect the true order of bit counts across an index. The exact solution to the problem of computing the TopN counts is prohibitively expensive, so TopN is instead implemented as a heuristic. This provides a significant performance improvement, at the cost of uncertainty in the result order.
|
||||
|
||||
The implementation is based on a per-shard cache. The accuracy of the results depends on how well the counts for the overall index are reflected in the individual shards (so TopN queries on a single-shard index are exact). If the distribution of bits across shards is uniform, shard counts are representative. This is often a reasonable assumption, especially for the top results for large data sets, in which counts might follow Zipfian, exponential, or other long-tail distributions. However, this assumption may not hold for some applications.
|
||||
|
||||
Additional implementation details:
|
||||
|
||||
* The field's cache size determines the number of sorted rows to maintain in the cache for purposes of TopN queries. There is a tradeoff between performance and accuracy; increasing the cache size will improve accuracy of results at the cost of performance. Note that this per-shard tradeoff is independent of the per-index performance/accuracy tradeoff mentioned above.
|
||||
* Fields with cache type `ranked` will return the top rows sorted by count in descending order.
|
||||
* Fields with cache type `lru` will maintain an LRU (Least Recently Used replacement policy) cache, thus a TopN query on this type of field will return rows sorted in order of most recently set bit.
|
||||
* Once full, the cache will truncate the set of rows according to the field option CacheSize. Rows that straddle the limit and have the same count will be truncated in no particular order.
|
||||
* The TopN query's attribute filter is applied to the existing sorted cache of rows. Rows that fall outside of the sorted cache range, even if they would normally pass the filter, are ignored.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue