arXiv:2609.00783cs.DBSep 2026

Manuscript Offprint

arXiv:2609.00783

Efficient discovery of unique column combinations on disk-resident data with limited memory

Xiaolong Wan, Xixian Han

Xiaolong Wan, Xixian Han

Abstract—The discovery of unique column combinations (UCCs) is a core task in data profiling, describing the key constraints of a table. The existing algorithms cannot deal with large-scale disk-resident data well due to high memory consumption and computational cost. In this paper, a novel DUD algorithm is developed to efficiently discover UCCs on disk-resident data with limited memory, which is inspired by the relationship between UCC discovery and transversal hypergraph. Rather than complete difference set generation of quadratic complexity, DUD only generates partial difference sets for hypergraph construction, followed by minimal hitting set enumeration to generate candidates and a validation process. DUD devises a strategy to generate full useful difference sets by pairwise comparisons of tuples having the same values with respect to some selected attributes. A novel theorem is developed and proved in this paper to report the candidates including the selected attributes as true UCCs directly without validation, which reduces the number of candidates to be validated significantly. A hash-based batch validation strategy is devised to validate a set of candidates on the relation instance, which only needs to maintain a small number of tuples in memory at a time. The extensive experimental results, conducted on synthetic and real-life data sets, show that DUD can discover UCCs on disk-resident data with high efficiency and low memory consumption.

Index Terms—Unique column combination discovery, Disk-resident data, Limited memory, Hypergraph transversal.

I. INTRODUCTION

The metaphors “data is the new oil” and “analytics is the combustion engine” [1] assert that data has become a valuable resource for deriving insights that power modern industries. Before fully exploiting data, the necessary condition is to discover its metadata, which helps understand and process the data to make it truly an asset for decision-making. Data profiling is the systematic process of determining the metadata of data sets, which produces a small but informative summary of a given data set [2].

The discovery of unique column combinations (UCCs) is a core task in data profiling, describing the key constraints of a table. Given relation schema RR, a UCC XX refers to a set of attributes whose projection only contains unique values in a given relation instance rr, i.e., any two distinct tuples t1,t2∈rt_1, t_2 \in r, t1[X]≠t2[X]t_1[X] \neq t_2[X]. Since UCCs identify tuples uniquely, they can serve as candidate keys, from which the primary key can be selected. Besides key discovery, UCCs also have many important practical cases including query optimization [3], data cleansing [4], data integration [5], database reverse engineering [6]. Due to various reasons, for example,

TABLE I PART DATA RECORDS.

PKEYNAMEMFGRBRANDTYPEPRICE
1GoldenM1B13PROMO901
2BlushM1B13LARGE902
3SpringM4B42STAND903
4CornflM3B34SMALL904
5ForestM3B32STAND905
6BisqueM2B24PROMO906
7MoccasM1B11SMALL907
8MistyM4B44PROMO908
9ThistM4B43SMALL909
10LinenM5B54LARGE910

undefined, missing or outdated, the UCC information is often not annotated in the data set, which motivates the automatic UCC discovery problem. Since any superset of a UCC is also a UCC, an important property for UCC is its minimality. A UCC XX is called minimal if none of its proper subsets is a UCC. The UCC discovery problem is to determine all minimal UCCs of a relation instance, which are sufficient to infer all UCCs.

Example 1. Given a part table (Table I) of a manufacturer, each tuple keeps the information of a part, including part key (PKEY), part name (NAME), manufacturer (MFGR), brand (BRAND), type (TYPE) and retail price (PRICE). For the given relation instance, the discovered minimal UCCs are {PKEY}\{PKEY\}, {NAME}\{NAME\}, {PRICE}\{PRICE\}, {MFGR,TYPE}\{MFGR, TYPE\}, {BRAND,TYPE}\{BRAND, TYPE\}.

Because of its practical importance, the UCC discovery problem has attracted extensive attention from researchers in both academia and industry [7], [8], [9], [10], [11]. Actually, the discovery of UCC is a rather hard problem since the number of total UCC candidates is exponential to the number of attributes. The existing algorithms can be divided into three classes: attribute-based approaches, tuple-based approaches and hybrid approaches, which optimize the discovery process in different aspects. Optimizing for data sets with many tuples, attribute-based approaches [7], [9] validate the candidates one after another, which are generated through attribute lattice. Aiming at the data sets with many attributes, tuple-based approaches [11] first compare the tuples pairwise and then derive all minimal UCCs by the comparison results. Hybrid approaches [8], [10] combine the advantages of the first two approaches and switch between two approaches for better performance, optimizing for data sets with many tuples and many attributes simultaneously.

The existing algorithms assume that the required data structures can be held entirely in memory. Their executions depend on some in-memory data structures, e.g. prefix tree or stripped partitions. However, the assumption fails in many real-life

The authors are with School of Computer Science and Technology, Harbin Institute of Technology, China. (e-mail: wxl@hit.edu.cn, hanxx@hit.edu.cn) situations since the memory is limited for a specified machine and often is allocated partly to a process. On large-scale disk-resident data, the existing algorithms incur high execution cost, even cannot work when the required data structures cannot be maintained entirely in memory. Considering the ever-growing data volume, how to efficiently discover UCCs on disk-resident data under limited memory is still an important and open problem.

This paper solves UCC discovery problem inspired by the equivalency under parsimonious reduction between UCC discovery and transversal hypergraph [12]. Given relation instance, its UCCs are the minimal hitting sets of the hypergraph [13], whose vertices are attributes of relation schema and the hyperedges are the minimal difference sets generated by the complete pairwise comparisons of tuples. For a pair of tuples, the difference set is the set of attributes on which the two tuples have different values. A candidate attribute combination fails to be a UCC exactly when some pair of tuples agrees on every attribute in the candidate, that is, when the candidate shares no attribute with the difference set of that pair.

A novel DUD algorithm (Disk-resident Unique column combination Discovery) is proposed in this paper to efficiently discover all minimal UCCs on disk-resident data with limited memory. The execution of DUD consists of three phases. Since the cost of complete pairwise comparisons is prohibitively high on large-scale data, DUD first performs a subset of pairwise comparisons to build the hypergraph with partial information (phase 1). Next DUD discovers the UCC candidates by enumerating minimal hitting sets on the built hypergraph (phase 2). Then the candidates are checked by a validation process (phase 3). The candidates checked to be correct are valid UCCs, while the validation process of invalid candidates brings some conflicting tuples, which have the same projection values on the invalid candidates. The hypergraph is updated by adding new hyperedges, i.e., the difference sets generated by comparing the conflicting tuples pairwise, and DUD enumerates minimal hitting sets again on the updated hypergraph. The following processing is similar, with the only difference that the newly generated candidates already discovered to be UCCs in the previous operations should be removed. If no new UCC candidates are generated or no new candidates are validated to be invalid, the execution of DUD is over.

It is observed that the enumeration of minimal hitting sets is efficient in a hypergraph stemming from real-life data sets [13]. The emphasis of DUD lies on phase 1 and phase 3, i.e., efficient generation of partial difference sets and efficient validation of UCC candidates.

Emphasis 1: efficient generation of partial difference sets. How to acquire a subset of difference sets, which can be generated with limited memory in a reasonable time and also be helpful for efficient UCC discovery, is a non-trivial issue. A difference set spanning all attributes provides no useful information for UCC discovery, since every non-empty candidate would trivially intersect it. The useful difference sets for minimal hitting set enumeration, i.e., those that exclude at least one attribute, are generated by pairwise comparisons of tuples with at least one equal attribute value. An im-

portant theorem is proved in this paper that, if all useful difference sets with respect to an attribute are generated, any UCC candidates including the attribute are true UCCs definitely without validation. This actually introduces a trade-off between partial difference set generation and validation process. This paper sets an upper-bound for the number of full useful pairwise comparisons with respect to each attribute in order to restrict the cost of generating difference sets, and the attributes are divided into two types: attributes of full difference set generation type (FG type) and attributes of no difference set generation type (NG type). DUD only generates full useful difference sets with respect to attributes of FG type, whose comparison numbers are no more than the upper-bound. Then, random sampling is performed on relation instance to supplement difference sets, whose pairwise comparison number is linear to tuple number.

Emphasis 2: efficient validation of UCC candidates. The key to efficient validation with limited memory is not to maintain all tuples in memory. In this paper, a hash-based strategy is devised for validating the UCC candidates on the relation instance directly. Two tuples with the same projection on any candidate must have the same value for each constituent attribute. Therefore, the collision can be checked by first sorting the relation instance with respect to one constituent attribute and only maintaining the tuples with the same value of the constituent attribute in memory. The remaining validation candidates contain only NG attributes. Therefore, DUD accesses NG attributes in the ascending order of maximum run lengths of equal attribute values to minimize the number of tuples kept in memory. A set of candidates sharing current attribute of NG type are validated simultaneously on the same sorted relation instance. The candidates checked to be correct are valid UCCs, while the validation process of invalid candidates brings some conflicting tuples, which are used to update the hypergraph.

The correctness of DUD is proved in this paper, along with its cost analysis. The extensive experiments are conducted on synthetic and real-life data sets, representing the practical data characteristics comprehensively. The experimental results show that DUD achieves remarkable efficiency on disk-resident data with limited memory.

The contributions of this paper are listed as follows:

  • This paper proposes a novel DUD algorithm for efficient UCC discovery on disk-resident data.

  • The efficient generation of partial difference sets is devised in this paper, along with a novel theorem which prunes UCC candidates significantly.

  • The hash-based validation strategy is presented to validate candidates efficiently, by maintaining a small part of tuples in memory for collision checking.

  • The extensive experimental results show that DUD can discover UCCs on disk-resident data with high efficiency and low memory consumption.

The rest of the paper is organized as follows. Section II gives preliminaries, followed by the related works in Section III. DUD algorithm is introduced in Section IV. Section V evaluates the performance of DUD and Section VI concludes the paper.

relation instance r

TID1234567891011121314151617181920
A1A_{1}21102222121101201222
A2A_{2}00101110000100001000
A3A_{3}10111101100010100001
A4A_{4}11110011111000001101
A5A_{5}02210200011222201122
A6A_{6}01100001111100001101
A7A_{7}11000110101110110010
A8A_{8}00101001101101101101

the UCCs of relation instance r

{A1,A2,A5,A7,A8}{A1,A2,A3,A4,A7,A8}{A2,A3,A4,A5,A6,A7,A8}\{A_1, A_2, A_5, A_7, A_8\} \{A_1, A_2, A_3, A_4, A_7, A_8\} \{A_2, A_3, A_4, A_5, A_6, A_7, A_8\}

Fig. 1. The illustration of relation instance in the running example.

References (29)