# cardinality

Published articles for cardinality.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Why your index is not being used, and why the planner is usually right

DevFeed: [Why your index is not being used, and why the planner is usually right](<https://devfeed.tech/articles/why-your-index-is-not-being-used-and-why-the-planner-is-usually-right-39590.md>)

Original publisher: [Read original article](<https://ankit-rana.com/logs/38-why-your-index-is-not-being-used/>)

Author: hello@ankit-rana.com

Published: 2026-08-16T00:00:00Z

Content type: tutorial

Language: en

Sources: [Ankit Rana | Mechanical Sympathy](<https://devfeed.tech/sources/ankit-rana-mechanical-sympathy.md>)

Topics: [Query (disambiguation)](<https://devfeed.tech/topics/query.md>), [MySQL](<https://devfeed.tech/topics/mysql.md>), [bug](<https://devfeed.tech/topics/bug.md>)

Tags: [bug](<https://devfeed.tech/tags/bug.md>), [cardinality](<https://devfeed.tech/tags/cardinality.md>), [database-performance](<https://devfeed.tech/tags/database-performance.md>), [explain](<https://devfeed.tech/tags/explain.md>), [function](<https://devfeed.tech/tags/function.md>), [indexes](<https://devfeed.tech/tags/indexes.md>), [indexing](<https://devfeed.tech/tags/indexing.md>), [mysql](<https://devfeed.tech/tags/mysql.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [predicate](<https://devfeed.tech/tags/predicate.md>), [query](<https://devfeed.tech/tags/query.md>), [query-planner](<https://devfeed.tech/tags/query-planner.md>)

### AI overview

This tutorial explains why database indexes may not be used even when they exist. It focuses on inaccurate cardinality estimates caused by stale statistics, predicates that prevent index matching, implicit casts, and cases where sequential scans are the cheaper choice.

### Source excerpt

An unused index is almost never a planner bug. It is usually a predicate the planner cannot match to the index, such as a function or an implicit cast applied to the column, or a cardinality estimate that is wrong because statistics are stale. When the estimate is right and the planner still refuses, it is often correct: past a few percent of the table, random access through an index costs more than reading the table sequentially. The diagnostic that matters is the gap between estimated and actual rows in EXPLAIN ANALYZE.

## Metric cardinality limits in OpenTelemetry: a practical guide

DevFeed: [Metric cardinality limits in OpenTelemetry: a practical guide](<https://devfeed.tech/articles/metric-cardinality-limits-in-opentelemetry-a-practical-guide-32566.md>)

Original publisher: [Read original article](<https://opentelemetry.io/blog/2026/cardinality-limits-in-opentelemetry/>)

Author: OpenTelemetry Authors; Docs CC BY

Published: 2026-08-06T07:43:47Z

Content type: article

Language: en

Sources: [Blog on OpenTelemetry](<https://devfeed.tech/sources/blog-on-opentelemetry.md>)

Topics: [OpenTelemetry](<https://devfeed.tech/topics/opentelemetry.md>), [SDK](<https://devfeed.tech/topics/sdk.md>), [telemetry](<https://devfeed.tech/topics/telemetry.md>), [dashboards](<https://devfeed.tech/topics/dashboards.md>)

Tags: [cardinality](<https://devfeed.tech/tags/cardinality.md>), [dashboards](<https://devfeed.tech/tags/dashboards.md>), [filter](<https://devfeed.tech/tags/filter.md>), [guide](<https://devfeed.tech/tags/guide.md>), [memory](<https://devfeed.tech/tags/memory.md>), [metric](<https://devfeed.tech/tags/metric.md>), [metrics](<https://devfeed.tech/tags/metrics.md>), [opentelemetry](<https://devfeed.tech/tags/opentelemetry.md>), [practical](<https://devfeed.tech/tags/practical.md>), [production](<https://devfeed.tech/tags/production.md>)

### AI overview

This practical guide explains how OpenTelemetry metric cardinality limits protect process memory from unbounded growth. When a metric stream overflows, total values remain correct, but attribute-based filtering and grouping can undercount, affecting dashboards, SLOs, and alerts.

### Source excerpt

OpenTelemetry metrics are designed to be safe to use in production. One part of that safety is the cardinality limit in the metrics SDK. The limit protects your process from unbounded memory growth when a metric receives too many unique attribute combinations. That protection is useful, but it has a consequence many users do not expect: when a metric stream overflows, the total value remains correct, while queries that filter or group by attributes can undercount. This can affect dashboards, service-level objectives (SLOs), and alerts that looked correct before overflow started.

## Leveraging PyFixest for High-Cardinality Marketplace Modeling at Instacart

DevFeed: [Leveraging PyFixest for High-Cardinality Marketplace Modeling at Instacart](<https://devfeed.tech/articles/leveraging-pyfixest-for-high-cardinality-marketplace-modeling-at-instacart-20107.md>)

Original publisher: [Read original article](<https://tech.instacart.com/leveraging-pyfixest-for-high-cardinality-marketplace-modeling-at-instacart-3913df91a04b?source=rss----587883b5d2ee---4>)

Author: Benjamin Knight

Published: 2026-06-29T16:06:24Z

Content type: article

Language: en

Sources: [Instacart](<https://devfeed.tech/sources/instacart.md>)

Topics: [benchmarking](<https://devfeed.tech/topics/benchmarking.md>), [math](<https://devfeed.tech/topics/math.md>), [Algorithms, Complexity](<https://devfeed.tech/topics/algorithms-complexity.md>), [Software](<https://devfeed.tech/topics/software.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Routing (disambiguation)](<https://devfeed.tech/topics/routing.md>)

Tags: [benchmarking](<https://devfeed.tech/tags/benchmarking.md>), [bias](<https://devfeed.tech/tags/bias.md>), [cardinality](<https://devfeed.tech/tags/cardinality.md>), [data-science](<https://devfeed.tech/tags/data-science.md>), [delivery](<https://devfeed.tech/tags/delivery.md>), [efficiency](<https://devfeed.tech/tags/efficiency.md>), [estimator](<https://devfeed.tech/tags/estimator.md>), [fixed-effects-model](<https://devfeed.tech/tags/fixed-effects-model.md>), [instacart](<https://devfeed.tech/tags/instacart.md>), [linear-regression](<https://devfeed.tech/tags/linear-regression.md>), [measurement](<https://devfeed.tech/tags/measurement.md>), [memory](<https://devfeed.tech/tags/memory.md>), [precision](<https://devfeed.tech/tags/precision.md>), [pyfixest](<https://devfeed.tech/tags/pyfixest.md>), [regression](<https://devfeed.tech/tags/regression.md>), [routing](<https://devfeed.tech/tags/routing.md>), [speed](<https://devfeed.tech/tags/speed.md>), [statistics](<https://devfeed.tech/tags/statistics.md>), [techniques](<https://devfeed.tech/tags/techniques.md>)

### AI overview

This Instacart article explains why ordinary least squares regression becomes computationally impractical for marketplace experiments with high-cardinality categories. It presents the mathematical basis for using Fixest and Pyfixest, discusses switchback experiment designs for addressing treatment spillover, and describes benchmarks comparing processing speed, memory efficiency, and estimator precision.

### Source excerpt

Benjamin S. Knight Scaling Marketplace experiments requires specialized statistical techniques. We examine why standard ordinary least squares regression (OLS) becomes computationally intractable when controlling for high-cardinality categories. We then dive into the underlying math and demonstrate how modern packages -- specifically Fixest and Pyfixest -- bypass these limitations. We conclude by benchmarking these methods to show their real-world impact on processing speed, memory efficiency, and estimator precision. At Instacart we strive to give our customers access to all the fresh foods and ingredients that they would normally get from a trip to the grocery store, but without the hassle of driving, finding parking, waiting in line, etc. Instacart's Marketplace team is responsible for surfacing customers' orders to shoppers, aligning Instacart's delivery windows with shoppers' projected availabilities as efficiently as possible. This entails a careful balancing act. If we offer delivery windows that are sooner / more popular, then we risk overextending shoppers' ability to fulfill those orders on time. If we are too conservative in our delivery option offerings, then we risk losing potential orders. Accurately measuring the impact of changes in our batching and routing algorithms requires thoughtful experiment design and software. Better predictions of future demand / time-to-fulfill allow Instacart to offer more convenient delivery windows.Experimentation on Marketplace One of our primary concerns in Marketplace is treatment spillage. For example, if we adjust our batching algorithm and increase the rate at which multiple orders are combined into batches in Brooklyn and Queens, then we face a real risk of also influencing the rate of batch creation / completion in Staten Island, the Bronx, and Manhattan. In this case the treatment impacts the control group -- a classic source of measurement bias as a consequence of violating the Stable Unit Treatment Value Assumpt

## Deep Dive: Telemetry cardinality in the Apollo GraphOS Router

DevFeed: [Deep Dive: Telemetry cardinality in the Apollo GraphOS Router](<https://devfeed.tech/articles/deep-dive-telemetry-cardinality-in-the-apollo-graphos-router-23529.md>)

Original publisher: [Read original article](<https://www.apollographql.com/blog/telemetry-cardinality-in-the-apollo-graphos-router>)

Author: Nick Marsh

Published: 2026-02-10T09:00:00Z

Content type: tutorial

Language: en

Sources: [Apollo Blog](<https://devfeed.tech/sources/apollo-blog.md>)

Topics: [GraphOS](<https://devfeed.tech/topics/graphos.md>), [OpenTelemetry](<https://devfeed.tech/topics/opentelemetry.md>), [telemetry](<https://devfeed.tech/topics/telemetry.md>), [Instrumentation](<https://devfeed.tech/topics/instrumentation.md>), [SDK](<https://devfeed.tech/topics/sdk.md>), [Rust](<https://devfeed.tech/topics/rust.md>)

Tags: [announcement](<https://devfeed.tech/tags/announcement.md>), [cardinality](<https://devfeed.tech/tags/cardinality.md>), [config](<https://devfeed.tech/tags/config.md>), [graphos](<https://devfeed.tech/tags/graphos.md>), [instrumentation](<https://devfeed.tech/tags/instrumentation.md>), [metric](<https://devfeed.tech/tags/metric.md>), [metrics](<https://devfeed.tech/tags/metrics.md>), [observability](<https://devfeed.tech/tags/observability.md>), [opentelemetry](<https://devfeed.tech/tags/opentelemetry.md>), [rust](<https://devfeed.tech/tags/rust.md>), [scale](<https://devfeed.tech/tags/scale.md>), [sdk](<https://devfeed.tech/tags/sdk.md>), [telemetry](<https://devfeed.tech/tags/telemetry.md>), [traces](<https://devfeed.tech/tags/traces.md>)

### AI overview

This technical article explains how the Apollo GraphOS Router uses OpenTelemetry for metrics and traces, including instrumentation, metric providers, readers, and exporters. It also describes the OpenTelemetry SDK's 2,000-cardinality limit and how reaching that limit affects metric attributes.

### Source excerpt

Learn how telemetry works in the Apollo GraphOS Router, from OpenTelemetry instrumentation to metric exporters. Understand cardinality limits, diagnose overflow issues, and tune your router config for production-scale observability.

## ClickStack: A High-Performance OSS Observability Stack on ClickHouse

DevFeed: [ClickStack: A High-Performance OSS Observability Stack on ClickHouse](<https://devfeed.tech/articles/clickstack-a-high-performance-oss-observability-stack-on-clickhouse-5186.md>)

Original publisher: [Read original article](<https://clickhouse.com/blog/clickstack-a-high-performance-oss-observability-stack-on-clickhouse>)

Author: Mike Shi

Published: 2025-05-29T00:00:00Z

Content type: news

Language: en

Sources: [ClickHouse Blog](<https://devfeed.tech/sources/clickhouse-blog.md>)

Topics: [clickhouse](<https://devfeed.tech/topics/clickhouse.md>), [observability](<https://devfeed.tech/topics/observability.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>), [OpenTelemetry](<https://devfeed.tech/topics/opentelemetry.md>), [telemetry](<https://devfeed.tech/topics/telemetry.md>), [session replay](<https://devfeed.tech/topics/session-replay.md>), [Traces](<https://devfeed.tech/topics/traces.md>)

Tags: [announce](<https://devfeed.tech/tags/announce.md>), [cardinality](<https://devfeed.tech/tags/cardinality.md>), [clickhouse](<https://devfeed.tech/tags/clickhouse.md>), [compression](<https://devfeed.tech/tags/compression.md>), [logs](<https://devfeed.tech/tags/logs.md>), [metrics](<https://devfeed.tech/tags/metrics.md>), [observability](<https://devfeed.tech/tags/observability.md>), [opentelemetry](<https://devfeed.tech/tags/opentelemetry.md>), [oss](<https://devfeed.tech/tags/oss.md>), [performance](<https://devfeed.tech/tags/performance.md>), [saas](<https://devfeed.tech/tags/saas.md>), [session-replay](<https://devfeed.tech/tags/session-replay.md>), [traces](<https://devfeed.tech/tags/traces.md>)

### AI overview

ClickHouse announces ClickStack, an open-source observability stack powered by ClickHouse and HyperDX. It provides logs, metrics, traces, and session replay through an integrated experience with OpenTelemetry collection, a wide-events UI, natural-language querying, alerting, and high-performance storage and analytics.

### Source excerpt

We're delighted to announce ClickStack: the open-source observability stack built on ClickHouse - logs, metrics, traces, and session replay in one blazing-fast, developer-friendly platform.

## Evaluating Equality Predicates with RangeBitmap

DevFeed: [Evaluating Equality Predicates with RangeBitmap](<https://devfeed.tech/articles/evaluating-equality-predicates-25641.md>)

Original publisher: [Read original article](<https://richardstartin.github.io/posts/range-bitmap-equality-queries>)

Author: Richard Startin's Blog

Published: 2022-12-18T00:00:00Z

Content type: article

Language: en

Sources: [Richard Startin's Blog](<https://devfeed.tech/sources/richard-startin-s-blog.md>)

Topics: [Data structures](<https://devfeed.tech/topics/data-structures.md>), [Library](<https://devfeed.tech/topics/library.md>), [benchmarking](<https://devfeed.tech/topics/benchmarking.md>), [data observability](<https://devfeed.tech/topics/data-observability.md>)

Tags: [benchmarking](<https://devfeed.tech/tags/benchmarking.md>), [cardinality](<https://devfeed.tech/tags/cardinality.md>), [comparison](<https://devfeed.tech/tags/comparison.md>), [data-engineering](<https://devfeed.tech/tags/data-engineering.md>), [data-structure](<https://devfeed.tech/tags/data-structure.md>), [java](<https://devfeed.tech/tags/java.md>), [library](<https://devfeed.tech/tags/library.md>), [memory](<https://devfeed.tech/tags/memory.md>), [pinot](<https://devfeed.tech/tags/pinot.md>), [range](<https://devfeed.tech/tags/range.md>), [roaring](<https://devfeed.tech/tags/roaring.md>), [speed](<https://devfeed.tech/tags/speed.md>)

### AI overview

This article evaluates equality and inequality queries using RangeBitmap in the RoaringBitmap library. It explains how the enhancement can support equality filtering as a compact inverted-index alternative, including as a fallback for Apache Pinot range indexes, and reports faster selection than a stream-based scan in the described example while using less space than some inverted indexes.

### Source excerpt

I have just implemented support for (in)equality queries against a RangeBitmap, a succinct data structure in the RoaringBitmap library which supports range queries. RangeBitmap was designed to support range queries in Apache Pinot (more details here) but this enhancement would allow a range index to be used as a fallback for (in)equality queries in case nothing better is available. Supporting (in)equality queries allows a RangeBitmap to be used as a kind of compact inverted index, trading space for time, capable of supporting high cardinality gracefully. Since RangeBitmap supports memory mapping from files, I think that it could be used for data engineering beyond Apache Pinot.

## Modelling UI State on Android

DevFeed: [Modelling UI State on Android](<https://devfeed.tech/articles/modelling-ui-state-on-android-25873.md>)

Original publisher: [Read original article](<http://lordraydenmk.github.io//2021/modelling-ui-state/>)

Author: Stojan Anastasov

Published: 2021-01-29T00:00:00Z

Content type: tutorial

Language: en

Sources: [Stojan Anastasov's blog](<https://devfeed.tech/sources/stojan-anastasov-s-blog.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [android-development](<https://devfeed.tech/topics/android-development.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Data structures](<https://devfeed.tech/topics/data-structures.md>), [Development](<https://devfeed.tech/topics/development.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-development](<https://devfeed.tech/tags/android-development.md>), [cardinality](<https://devfeed.tech/tags/cardinality.md>), [data-class](<https://devfeed.tech/tags/data-class.md>), [data-structure](<https://devfeed.tech/tags/data-structure.md>), [fp](<https://devfeed.tech/tags/fp.md>), [functional](<https://devfeed.tech/tags/functional.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [livedata](<https://devfeed.tech/tags/livedata.md>), [rxjava](<https://devfeed.tech/tags/rxjava.md>), [sealed-class](<https://devfeed.tech/tags/sealed-class.md>), [stateflow](<https://devfeed.tech/tags/stateflow.md>), [types](<https://devfeed.tech/tags/types.md>), [ui](<https://devfeed.tech/tags/ui.md>), [viewmodel](<https://devfeed.tech/tags/viewmodel.md>)

### AI overview

This article explains how to model Android UI state in Kotlin using data classes and sealed classes. It connects types with sets and cardinality, then describes product types and sum types as tools for representing valid application states.

### Source excerpt

The recommended approach from Google for Android development is holding the UI state in a ViewModel and having the View observe it. To achieve that one can use LiveData, StateFlow, RxJava or a similar tool. But how to model the UI state? Use a data class or a sealed class? Use one observable property or many? I will describe the tradeoffs between the approaches and present a tool to help you decide which one to use. This article is heavily inspired by Types as Sets from the Elm guide, a large part is a translation from Elm to Kotlin. Photo by Marc-Olivier Jodoin on Unsplash Types as sets By Making Data Structure we can make sure the possible values in code exactly match the valid values in real life. Doing that helps to avoid a whole class of bugs related to invalid data. To achieve that, first we need to understand the relationship between Types and Sets. We can think of Types as sets of values, they contain unique elements and there is no ordering between them. For example: Nothing - the empty set, it contains no elements Unit - the singleton set, it contains one element - Unit Boolean - contains the elements true and false Int - contains the elements: ... -2, -1, 0, 1, 2 ... Float - contains the elements: 0.1, 0.01, 1.0 .... String - contains the elements: "", "a", "b", "Kotlin", "Android", "Hello world!"... So when you write: val x: Boolean it means x belongs to the set of Boolean values and can be either true or false. Cardinality In Mathematics, Cardinality is the measure of "number of elements" of a Set. For example the set of Boolean contains the elements [true, false] so it has a cardinality = 2. Let's take a look at the cardinality of the sets mentioned above: Nothing - 0 Unit - 1 Boolean - 2 Short - 65535 Int - ∞ Float - ∞ String- ∞ Note: The cardinality of Int and Float is not exactly infinity, it's 2^32 however that is a huge number. When building apps, we use built-in types and create custom types using constructs like data classes and sealed classes. Product

## Better URL Search with Elasticsearch

DevFeed: [Better URL Search with Elasticsearch](<https://devfeed.tech/articles/better-url-search-with-elasticsearch-27985.md>)

Original publisher: [Read original article](<https://tech.trivago.com/post/2020-02-11-betterurlsearchwithelasticsearch/>)

Author: Jorge Luis Betancourt Follow

Published: 2020-02-11T00:00:00Z

Content type: tutorial

Language: en

Sources: [Trivago](<https://devfeed.tech/sources/trivago.md>)

Topics: [elasticsearch](<https://devfeed.tech/topics/elasticsearch.md>), [Logging](<https://devfeed.tech/topics/logging.md>), [log management](<https://devfeed.tech/topics/log-management.md>), [tokenization](<https://devfeed.tech/topics/tokenization.md>), [Query (disambiguation)](<https://devfeed.tech/topics/query.md>)

Tags: [ascii](<https://devfeed.tech/tags/ascii.md>), [cardinality](<https://devfeed.tech/tags/cardinality.md>), [elasticsearch](<https://devfeed.tech/tags/elasticsearch.md>), [kibana](<https://devfeed.tech/tags/kibana.md>), [logging](<https://devfeed.tech/tags/logging.md>), [logs](<https://devfeed.tech/tags/logs.md>), [logstash](<https://devfeed.tech/tags/logstash.md>), [monitoring](<https://devfeed.tech/tags/monitoring.md>), [pipeline](<https://devfeed.tech/tags/pipeline.md>), [protocol](<https://devfeed.tech/tags/protocol.md>), [tokenization](<https://devfeed.tech/tags/tokenization.md>)

### AI overview

This article explains how trivago searches URL components stored in Elasticsearch within an ELK-based logging pipeline. It examines how the Standard Analyzer tokenizes URL-like query strings and discusses preprocessing and flattened-field approaches for matching query-parameter key/value pairs, including their tradeoffs.

### Source excerpt

At trivago, we generate a huge amount of logs and we have our own custom setup for shipping logs using mostly

## Methods of Proof -- Diagonalization

DevFeed: [Methods of Proof -- Diagonalization](<https://devfeed.tech/articles/methods-of-proof-diagonalization-40384.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2015/06/08/methods-of-proof-diagonalization/>)

Published: 2015-06-08T09:00:00Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Mathematics](<https://devfeed.tech/topics/mathematics.md>), [Math and Logic](<https://devfeed.tech/topics/math-and-logic.md>), [Collections](<https://devfeed.tech/topics/collections.md>)

Tags: [bijections](<https://devfeed.tech/tags/bijections.md>), [cardinality](<https://devfeed.tech/tags/cardinality.md>), [diagonalization](<https://devfeed.tech/tags/diagonalization.md>), [halting-problem](<https://devfeed.tech/tags/halting-problem.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [methods-of-proof](<https://devfeed.tech/tags/methods-of-proof.md>), [turing-machines](<https://devfeed.tech/tags/turing-machines.md>), [uncountability](<https://devfeed.tech/tags/uncountability.md>)

### AI overview

This tutorial introduces diagonalization as an advanced method of mathematical proof. It explains the table-and-diagonal construction and presents the theorem that no bijection exists between the natural numbers and the real numbers.

### Source excerpt

A while back we featured a post about why learning mathematics can be hard for programmers, and I claimed a major issue was not understanding the basic methods of proof (the lingua franca between intuition and rigorous mathematics). I boiled these down to the "basic four," direct implication, contrapositive, contradiction, and induction. But in mathematics there is an ever growing supply of proof methods. There are books written about the "probabilistic method," and I recently went to a lecture where the "linear algebra method" was displayed.

## Abbreviated keys for numeric to accelerate numeric sorts

DevFeed: [Abbreviated keys for numeric to accelerate numeric sorts](<https://devfeed.tech/articles/abbreviated-keys-for-numeric-to-accelerate-numeric-sorts-33651.md>)

Original publisher: [Read original article](<https://pgeoghegan.blogspot.com/2015/04/abbreviated-keys-for-numeric-to.html>)

Author: Peter Geoghegan (noreply@blogger.com)

Published: 2015-04-04T16:19:00Z

Content type: article

Language: en

Sources: [Peter Geoghegan's blog](<https://devfeed.tech/sources/peter-geoghegan-s-blog.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Sorting](<https://devfeed.tech/topics/sorting.md>), [Development](<https://devfeed.tech/topics/development.md>)

Tags: [abbreviation](<https://devfeed.tech/tags/abbreviation.md>), [benchmarks](<https://devfeed.tech/tags/benchmarks.md>), [c](<https://devfeed.tech/tags/c.md>), [cardinality](<https://devfeed.tech/tags/cardinality.md>), [commit](<https://devfeed.tech/tags/commit.md>), [count](<https://devfeed.tech/tags/count.md>), [fast](<https://devfeed.tech/tags/fast.md>), [improvements](<https://devfeed.tech/tags/improvements.md>), [indexes](<https://devfeed.tech/tags/indexes.md>), [internals](<https://devfeed.tech/tags/internals.md>), [maintenance](<https://devfeed.tech/tags/maintenance.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [sorting](<https://devfeed.tech/tags/sorting.md>), [table](<https://devfeed.tech/tags/table.md>)

### AI overview

The article discusses PostgreSQL numeric abbreviated keys, a committed patch intended to accelerate numeric sorting. It reports 6x-7x improvements for representative in-memory queries and a 12x improvement in a PostgreSQL 9.5 text-column CREATE INDEX benchmark compared with PostgreSQL 9.4.

### Source excerpt

Andrew Gierth's numeric abbreviated keys patch was committed recently. This commit added abbreviation/sortsupport for the numeric type (the PostgreSQL type which allows practically arbitrary precision, typically recommended for representing monetary values). The encoding scheme that Andrew came up with is rather clever - it has an excellent tendency to concentrate entropy from the original values into the generated abbreviated keys in real world cases. As far as accelerating sorts goes, numeric abbreviation is at least as effective as the original text abbreviation scheme. I easily saw improvements of 6x-7x with representative queries that did not spill to disk (i.e. that used quicksort). In essence, the patch makes sorting numeric values almost as cheap as sorting simple integers, since that is often all that is actually required during sorting proper (the abbreviated keys compare as integers, except that the comparison is inverted to comport with how abbreviation builds abbreviated values from numerics as tuples are copied into local memory ahead of sorting - see the patch for exact details). Separately, over lunch at pgConf.US in New York, Corey Huinker complained about a slow, routine data warehousing CREATE INDEX operation that took far too long. The indexes in question were built on a single text column. I suggested that Corey check out how PostgreSQL 9.5 performs, where this operation is accelerated by text abbreviation, often very effectively. Corey chose an organic set of data that could be taken as a reasonable proxy for how PostgreSQL behaves when he performs these routine index builds. In all cases maintenance_work_mem was set to 64MB, meaning that an external tapesort is always required - those details were consistent. This was a table with 18 million rows. Apparently, on PostgreSQL 9.4, without abbreviation, the CREATE INDEX took 10 minutes and 19 seconds in total. On PostgreSQL 9.5, with identical settings, it took only 51.3 seconds - a 12x improvemen

## ThingMonk 2014: Toward a more intelligent IoT

DevFeed: [ThingMonk 2014: Toward a more intelligent IoT](<https://devfeed.tech/articles/thingmonk-2014-toward-a-more-intelligent-iot-33407.md>)

Original publisher: [Read original article](<https://timkellogg.me/blog/2014/12/05/thingmonk-recap>)

Published: 2014-12-05T00:00:00Z

Content type: opinion

Language: en

Sources: [Tim Kellogg](<https://devfeed.tech/sources/tim-kellogg.md>)

Topics: [Internet of things](<https://devfeed.tech/topics/iot.md>), [data](<https://devfeed.tech/topics/data.md>), [MQTT](<https://devfeed.tech/topics/mqtt.md>), [CoAP](<https://devfeed.tech/topics/coap.md>)

Tags: [bloom-filter](<https://devfeed.tech/tags/bloom-filter.md>), [cardinality](<https://devfeed.tech/tags/cardinality.md>), [data](<https://devfeed.tech/tags/data.md>), [data-structures](<https://devfeed.tech/tags/data-structures.md>), [iot](<https://devfeed.tech/tags/iot.md>), [london](<https://devfeed.tech/tags/london.md>), [mqtt](<https://devfeed.tech/tags/mqtt.md>)

### AI overview

A recap of ThingMonk 2014 argues that the Internet of Things needs shared ways to organize, interpret, and connect sensor data, beyond efficient communication protocols. The article highlights metadata, open data, and data structures such as Bloom filters and HyperLogLog.

### Source excerpt

This week I was fortunate enough to attend ThingMonk in London. RedMonk were excellent hosts and managed to put together a tremendous lineup of speakers and talks that I hadn't anticipated. There were only 150 attendees, but each one of them brought something unique. Here I attempt to summarize some of the day, I know I've missed several truly great talks, but I just wanted to keep it short.

## Redis new data structure: the HyperLogLog

DevFeed: [Redis new data structure: the HyperLogLog](<https://devfeed.tech/articles/redis-new-data-structure-the-hyperloglog-20666.md>)

Original publisher: [Read original article](<http://antirez.com/news/75>)

Published: 2014-04-01T08:16:35Z

Content type: release

Language: en

Sources: [Antirez](<https://devfeed.tech/sources/antirez.md>)

Topics: [Redis](<https://devfeed.tech/topics/redis.md>), [Data structures](<https://devfeed.tech/topics/data-structures.md>), [Algorithms](<https://devfeed.tech/topics/algorithms.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [algorithms](<https://devfeed.tech/tags/algorithms.md>), [cardinality](<https://devfeed.tech/tags/cardinality.md>), [data-structure](<https://devfeed.tech/tags/data-structure.md>), [memory](<https://devfeed.tech/tags/memory.md>), [redis](<https://devfeed.tech/tags/redis.md>)

### AI overview

The article introduces HyperLogLog as a new Redis data structure for approximating the number of unique elements in a set. It explains that the algorithm uses a small, constant amount of memory and reports that the Redis implementation uses 12 kB per key with a standard error of 0.81%.

### Source excerpt

Generally speaking, I love randomized algorithms, but there is one I love particularly since even after you understand how it works, it still remains magical from a programmer point of view. It accomplishes something that is almost illogical given how little it asks for in terms of time or space. This algorithm is called HyperLogLog, and today it is introduced as a new data structure for Redis. Counting unique things === Usually counting unique things, for example the number of unique IPs that connected today to your web site, or the number of unique searches that your users performed, requires to remember all the unique elements encountered so far, in order to match the next element with the set of already seen elements, and increment a counter only if the new element was never seen before. This requires an amount of memory proportional to the cardinality (number of items) in the set we are counting, which is, often absolutely prohibitive. There is a class of algorithms that use randomization in order to provide an approximation of the number of unique elements in a set using just a constant, and small, amount of memory. The best of such algorithms currently known is called HyperLogLog, and is due to Philippe Flajolet. HyperLogLog is remarkable as it provides a very good approximation of the cardinality of a set even using a very small amount of memory. In the Redis implementation it only uses 12kbytes per key to count with a standard error of 0.81%, and there is no limit to the number of items you can count, unless you approach 2^64 items (which seems quite unlikely). The algorithm is documented in the original paper [1], and its practical implementation and variants were covered in depth by a 2013 paper from Google [2]. [1] http://algo.inria.fr/flajolet/Publications/FlFuGaMe07.pdf [2] http://static.googleusercontent.com/media/research.google.com/en//pubs/archive/40671.pdf How it works? === There are plenty of wonderful resources to learn more about HyperLogLog, s

## HyperLogLog Unions

DevFeed: [HyperLogLog Unions](<https://devfeed.tech/articles/hyperloglog-unions-34492.md>)

Original publisher: [Read original article](<https://tapoueh.org/blog/2013/02/hyperloglog-unions/>)

Author: Dimitri Fontaine PostgreSQL Major Contributor; Author

Published: 2013-02-26T11:44:00Z

Content type: article

Language: en

Sources: [Dimitri Fontaine](<https://devfeed.tech/sources/dimitri-fontaine.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Algorithm](<https://devfeed.tech/topics/algorithm.md>), [Data structures](<https://devfeed.tech/topics/data-structures.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [data](<https://devfeed.tech/topics/data.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [article](<https://devfeed.tech/tags/article.md>), [cardinality](<https://devfeed.tech/tags/cardinality.md>), [data-structure](<https://devfeed.tech/tags/data-structure.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [sql](<https://devfeed.tech/tags/sql.md>)

### AI overview

This article explains how PostgreSQL's HyperLogLog extension maintains a fixed-size data structure for estimating cardinality and supports union operations for counting unique values across sets, including use through SQL aggregates and window functions.

### Source excerpt

In the article from yesterday we talked about PostgreSQL HyperLogLog with some details. The real magic of that extension has been skimmed over though, and needs another very small article all by itself, in case you missed it. *Which Set Operation do you want for counting unique values?* The first query here has the default level of magic in it, really. What happens is that each time we do an update of the HyperLogLog hash value, we update some data which are allowing us to compute its cardinality.

## PostgreSQL HyperLogLog

DevFeed: [PostgreSQL HyperLogLog](<https://devfeed.tech/articles/postgresql-hyperloglog-34496.md>)

Original publisher: [Read original article](<https://tapoueh.org/blog/2013/02/postgresql-hyperloglog/>)

Author: Dimitri Fontaine PostgreSQL Major Contributor; Author

Published: 2013-02-25T09:23:00Z

Content type: tutorial

Language: en

Sources: [Dimitri Fontaine](<https://devfeed.tech/sources/dimitri-fontaine.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Algorithm](<https://devfeed.tech/topics/algorithm.md>), [Statistics](<https://devfeed.tech/topics/statistics.md>), [Extension](<https://devfeed.tech/topics/extension.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [bug](<https://devfeed.tech/tags/bug.md>), [cardinality](<https://devfeed.tech/tags/cardinality.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [extension](<https://devfeed.tech/tags/extension.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [statistics](<https://devfeed.tech/tags/statistics.md>)

### AI overview

This tutorial explains how to use the postgresql-hll extension with PostgreSQL for HyperLogLog cardinality estimation. It covers installation, estimating unique values such as IP addresses, handling concurrency with queued asynchronous updates, and protecting against empty-set and NULL behavior. The article also discusses a possible aggregate bug.

### Source excerpt

If you've been following along at home the newer statistics developments, you might have heard about this new State of The Art Cardinality Estimation Algorithm called HyperLogLog. This technique is now available for PostgreSQL in the extension postgresql-hll available at https://github.com/aggregateknowledge/postgresql-hll and soon to be in debian.

## Set Theory--A Primer

DevFeed: [Set Theory--A Primer](<https://devfeed.tech/articles/set-theory-a-primer-40223.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2011/07/09/set-theory-a-primer/>)

Published: 2011-07-09T18:14:59Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Mathematics](<https://devfeed.tech/topics/mathematics.md>), [Math and Logic](<https://devfeed.tech/topics/math-and-logic.md>)

Tags: [axiom-of-choice](<https://devfeed.tech/tags/axiom-of-choice.md>), [bijections](<https://devfeed.tech/tags/bijections.md>), [cardinality](<https://devfeed.tech/tags/cardinality.md>), [countability](<https://devfeed.tech/tags/countability.md>), [example](<https://devfeed.tech/tags/example.md>), [functions](<https://devfeed.tech/tags/functions.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [numbers](<https://devfeed.tech/tags/numbers.md>), [power-set](<https://devfeed.tech/tags/power-set.md>), [primer](<https://devfeed.tech/tags/primer.md>), [set](<https://devfeed.tech/tags/set.md>), [set-theory](<https://devfeed.tech/tags/set-theory.md>), [symbols](<https://devfeed.tech/tags/symbols.md>), [theory](<https://devfeed.tech/tags/theory.md>), [variable](<https://devfeed.tech/tags/variable.md>)

### AI overview

This primer introduces set theory by defining sets, elements, membership, cardinality, notation, and several ways to construct sets. It uses numerical examples and introduces natural numbers, integers, and rational numbers while noting that unrestricted operations can lead to paradoxes.

### Source excerpt

It's often that a student's first exposure to rigorous mathematics is through set theory, as originally studied by Georg Cantor. This means we will not treat set theory axiomatically (as in ZF set theory), but rather we will take the definition of a set for granted, and allow any operation to be performed on a set. This will be clear when we present examples, and it will be clear why this is a bad idea when we present paradoxes.