Blocking is a technique in entity resolution that partitions records into candidate groups, or blocks, to reduce the number of pairwise comparisons required for matching. Instead of comparing every record to every other record—an O(n²) operation—the process first applies a blocking key (e.g., the first three letters of a surname or a phonetic code) to assign records to subsets. Only records within the same block are then compared using more expensive similarity functions or machine learning models, dramatically improving computational efficiency.
Glossary
Blocking

What is Blocking?
A computational technique used to reduce the quadratic complexity of entity resolution.
Common blocking strategies include standard blocking, where a single function creates partitions, and multi-pass blocking, which uses several keys to increase recall. Advanced methods like locality-sensitive hashing (LSH) create probabilistic blocks. The core trade-off is between recall (missing fewer true matches) and precision (reducing false positive comparisons), making blocking a critical design decision in any scalable record linkage or deduplication pipeline.
Key Blocking Techniques
Blocking partitions records into candidate groups to reduce the quadratic complexity of pairwise comparisons. These are the primary algorithmic strategies for creating those groups.
Standard Blocking
The most fundamental blocking technique. Records are assigned to the same block if they share an identical value for a chosen blocking key, such as a ZIP code or the first three letters of a last name. It is deterministic and highly efficient but suffers from the curse of dimensionality—records with minor variations in the key are placed in different blocks and never compared.
- Example: Blocking all customer records on
postal_code='90210'. - Use Case: Initial, high-recall pass in a multi-pass strategy where speed is critical.
Sorted Neighborhood
A technique that sorts the entire dataset based on a sorting key (e.g., concatenated last_name, first_name). A fixed-size sliding window (e.g., 10 records) moves down the sorted list, and only records within the same window are compared. This method is more robust to minor errors at the beginning of the key than standard blocking.
- Process: 1) Create sorting key, 2) Sort all records, 3) Slide window and compare within it.
- Advantage: Captures matches where standard blocking fails due to transpositions or typos early in the key.
Q-Gram Blocking
A flexible method that uses overlapping substrings of length q (typically q=2 or 3, called bigrams or trigrams) as blocking keys. Each record generates multiple q-grams from an attribute, and records sharing any q-gram are placed in the same block. This dramatically increases recall for fuzzy matches.
- Example: The string 'Miller' generates bigrams:
#M,Mi,il,ll,le,er,r#. - Trade-off: Higher recall but produces larger, overlapping blocks, increasing comparison costs. Often used with prefix filtering to prune the number of q-grams considered.
Locality-Sensitive Hashing (LSH)
An approximate, probabilistic blocking method designed for high-dimensional data like text embeddings. LSH uses special hash functions where the probability of collision is high for similar inputs and low for dissimilar ones. Similar records are hashed into the same bucket with high probability.
- Key Property: It is locality-sensitive.
- Common Use: Blocking for deep learning models where records are represented as dense vectors. Provides a sub-linear time alternative to comparing all pairs.
- Families: Includes MinHash for Jaccard similarity and SimHash for cosine similarity.
Canopy Clustering
A fast, unsupervised pre-clustering technique used to create overlapping blocks (canopies). It uses two distance thresholds: a loose threshold T1 and a tight threshold T2 (T1 > T2). A record forms a new canopy if it is not within T2 of an existing canopy center. All records within T1 of a center are placed in that canopy.
- Result: Records can belong to multiple canopies.
- Purpose: Not a final clustering solution, but a cheap way to create candidate sets for more expensive pairwise matching or agglomerative clustering algorithms.
Multi-Pass Blocking
A robust production strategy that applies multiple, independent blocking schemes in sequence or parallel and takes the union of candidate pairs. This mitigates the risk of any single blocking key failing.
- Typical Workflow:
- Pass 1 (High Recall): Use a lenient key (e.g., Soundex of last name).
- Pass 2 (High Precision): Use a strict key (e.g., exact date of birth + first initial).
- Engineering Benefit: Allows tuning of the recall/precision trade-off systematically. The final candidate set is the union from all passes, ensuring no potential match is missed due to a single data error.
Blocking vs. Other Filtering Methods
A comparison of techniques used to reduce the candidate pair space in entity resolution, highlighting the trade-offs between computational efficiency and matching accuracy.
| Method | Blocking | Sorted Neighborhood | Locality-Sensitive Hashing (LSH) |
|---|---|---|---|
Primary Mechanism | Partitions records into groups (blocks) based on exact or hashed key values. | Sorts records by a key and slides a fixed-size window over the sorted list for comparisons. | Hashes records into buckets such that similar items collide with high probability. |
Comparison Complexity | O(n) to O(n log n) | O(n log n) for sort, O(wn) for comparisons (w = window size) | O(n) for hashing, sub-linear for similarity search |
Guarantee of Recall | No guarantee; similar records with different blocking keys are never compared. | Limited guarantee within the fixed window; records far apart in sort order are missed. | Probabilistic guarantee; tuning parameters control the recall probability. |
Handles Typographical Errors | |||
Scalability for Large n | High. Drastically reduces pairs (e.g., from O(n²) to O(n)). | Moderate. Window size is fixed, but sorting becomes expensive. | Very High. Designed for approximate nearest neighbor search in high dimensions. |
Common Use Case | Initial high-reduction step in batch ER pipelines. | Streaming data or datasets where a good, clean sort key exists. | Finding near-duplicates in high-dimensional data (e.g., text embeddings). |
Parameter Sensitivity | High. Choice of blocking key(s) critically impacts recall. | Moderate. Sensitive to sort key quality and window size. | High. Requires tuning of hash functions, bands, and rows for target similarity. |
Integration with ML | Often used as a pre-filter before classifier-based matching. | Less common; typically a deterministic pre-processing step. | Core component of many scalable similarity search and clustering algorithms. |
Frequently Asked Questions
Blocking is a foundational technique in entity resolution used to make the computationally intensive task of comparing all possible record pairs tractable. These questions address its core mechanisms, trade-offs, and practical implementation.
Blocking is a computational technique in entity resolution that partitions a dataset into candidate groups, or blocks, to drastically reduce the number of pairwise comparisons required to find matching records. It works by applying a blocking key—a function derived from record attributes—to assign records with similar keys to the same block. Only records within the same block are then compared for potential matches. For example, all records where the first three letters of the last name are 'SMI' might be placed in one block. This transforms an intractable O(n²) comparison problem into a manageable set of smaller, independent sub-problems, enabling scalable entity resolution on large datasets.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Blocking is a critical pre-processing step in entity resolution. These related concepts define the algorithms, models, and evaluation metrics used to build a complete resolution pipeline.
Locality-Sensitive Hashing (LSH)
A family of algorithmic techniques used to create blocking keys. LSH functions hash input items so that similar items map to the same hash buckets (blocks) with high probability, while dissimilar items map to different buckets. This enables approximate nearest neighbor search at scale.
- Core Mechanism: Uses random projections or permutations to create signatures that preserve similarity.
- Common Variants: MinHash for Jaccard similarity; SimHash for cosine similarity.
- Use Case in Blocking: Efficiently groups high-dimensional embeddings (e.g., from text) into candidate pairs without exhaustive comparison.
Fellegi-Sunter Model
The foundational probabilistic framework for record linkage, upon which many modern blocking and matching systems are built. It models the likelihood that two records refer to the same entity based on the pattern of agreements and disagreements across their attributes.
- Key Components: Defines match and non-match probabilities for each attribute.
- Linkage Rule: Uses the calculated likelihood ratio to classify pairs as matches, non-matches, or requiring clerical review.
- Relation to Blocking: The model's probability estimates can inform the selection of high-discriminatory attributes for creating effective blocking keys.
Canonicalization
The process of converting data into a standard, consistent format before blocking and matching. It creates a single authoritative representation (a canonical form) for values like names, addresses, or product codes.
- Purpose: Reduces variation, making blocking keys more reliable and comparisons more accurate.
- Common Techniques: Standardizing date formats, normalizing text case, expanding abbreviations, and applying business rules.
- Example: Converting "International Business Machines," "IBM," and "I.B.M." all to the canonical form "IBM" for consistent blocking.
Deterministic Matching
A rule-based entity resolution method that declares records a match if they exactly agree on a predefined set of attributes or derived match keys. It is intrinsically linked to blocking strategies.
- Blocking Key as Rule: A deterministic blocking key (e.g., first 3 letters of surname + ZIP code) creates a strict partition. Records are only compared if they fall into the same block.
- Pros and Cons: Highly transparent and fast, but lacks flexibility for handling typographical errors or missing data.
- Contrast with Probabilistic: Does not calculate likelihoods; uses Boolean logic for decision-making.
Transitive Closure
A graph-based operation critical for resolving entity clusters after pairwise matching within blocks. It infers that if record A matches B and B matches C, then A also matches C, ensuring logical consistency in the final entity set.
- Graph Representation: Records are nodes; match decisions are edges. Transitive closure finds all connected components in this graph.
- Challenge with Blocking: If blocking is too restrictive, transitive links between records in different blocks may be missed, leading to under-merging.
- Solution: Iterative blocking or recall-oriented blocking strategies help capture these transitive relationships.
Precision and Recall
The fundamental metrics for evaluating the effectiveness of a blocking strategy within an entity resolution pipeline.
- Recall (Completeness): The fraction of all true matching record pairs that are placed into the same block for comparison. Low recall means true matches are never compared.
- Precision (Efficiency): The fraction of record pairs within a block that are true matches. Low precision means the block contains many non-matches, wasting compute resources.
- The Trade-off: Blocking design is an optimization problem balancing high recall (few missed matches) against acceptable precision (manageable comparison cost).

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us