Privacy and preparation
Unnecessary dataset field review: eight checks after the cut
By SourceX Editorial · Reviewed by Noah Loul ·
10 sections
Short answer
Unnecessary dataset field review means removing out-of-scope content and then retesting everything that depended on it. On the public Sakila sample database, an illustrative rental-forecasting request needed 28 of 89 declared columns. Pruning the rest left 32,093 rental and payment rows pointing at a dropped customer table, found every customer's name spelled out in the email column, and left 4 of the 5 views the schema creates reading dropped tables.
Redaction
Unnecessary dataset field
Key takeaways
- Treat an unrequested field as a scope exception, not a cleanup task: it was never approved for licensing, so the supplier should reissue and the buyer should record anything it deleted.
- SQLite dropped Sakila's eight unrequested tables without a word, refused five column drops that touched foreign keys, and its foreign key check then listed 32,093 rental and payment rows pointing at the missing customer table.
- All 599 customer email addresses spell out the customer's name, so deleting the name columns alone would have removed no names.
- The 2005 row rule removed 182 of the 183 rentals that were never returned, so the kept data shows almost no open rentals.
- Every one of the eight requested tables changed, six only because columns were dropped, so row counts, hashes and the manifest must be reissued as a new version.
What should a buyer do with a field nobody asked for?
Quarantine the delivery, have the supplier reissue it without the field, and then retest everything that depended on what was removed. An unrequested field is a scope exception: it sits outside what the supplier approved for licensing, and it may be data the buyer has no right, or no wish, to hold.
Privacy rules point the same way when the field holds personal data. The UK Information Commissioner's Office explains the UK GDPR's data minimisation principle as data that is adequate, relevant and limited to what is necessary for the stated purpose, and says organizations must not collect personal data on the off-chance that it might be useful in the future. That is general information about one jurisdiction, not legal advice; counsel decides how it applies to a particular delivery.
The hard part is the retest. Unnecessary dataset field review is often treated as deleting columns, but a column has dependents: references that point into it, copies of its content inside other fields, views and other objects built on it, links that carry a row rule from one table to the next, and the manifest that describes it. This page tests each kind on a public database and turns the results into a checklist.
It is the mirror image of the live page on change requests, where a buyer asks for one more field and scope review reopens, and it starts where the data minimization field-spec guide stops: the specification was written, and the delivery still arrived with more.
Why removing one column is never a one-column change
Every unrequested field can have five kinds of dependents, and each needs its own test after the cut:
At a glance
Why removing one column is never a one-column change
- Pointers into it: foreign keys in kept tables that reference a dropped table or column. Test that no kept reference resolves to nothing.
- Copies of it: the same content stored inside another field, such as a name spelled out in an email address. Search kept and removed fields for the removed values, not just for similar column names.
- Objects built on it: views, summary tables and derived values that read the removed table or column. List every one and rebuild or drop it.
- Rows linked to it: when a row rule removes records from one table, linked records in other tables must follow, and the remaining data can change character. Count what left and what it changed.
- Descriptions of it: the manifest, data dictionary, row counts and hashes. Every touched file needs a new version, new counts and new hashes.
The test bed: an illustrative request against the Sakila database
Sakila is a widely used sample database of a DVD rental store. The header of the data file used here says it is a port of the Sakila example database available for MySQL, originally developed by the MySQL AB documentation team, and jOOQ's repository on GitHub, which keeps ports for several database engines, describes it as a nicely normalised database with a generated data set. That makes it safe to test and clear about what the counts mean: they show how each check behaves, not how often real deliveries fail.
The request is written for this article and is illustrative: rental demand by film and store for calendar year 2005, with rentals, payments, inventory, films, categories and languages, store keys and a customer key. That covers 28 of the 89 columns the schema declares. The other 61 are unrequested: eight whole tables (actor, film_actor, film_text, customer, staff, address, city and country, 45 columns, with film_text declared but empty), and 16 columns inside requested tables. Those 16 include the staff links on rentals and payments, film descriptions and replacement costs, the store's manager and address links, and a last_update audit column in all eight requested tables, which holds a single value in six of them. The row rule removes the 182 rentals from February 2006.
A script parsed the SQLite schema and data files from commit e089a5b as text, loaded the values into its own in-memory SQLite tables, and ran every check without executing any statement from the repository.
Eight checks after the cut, with Sakila results
The matrix is the asset. Run every row after pruning, in this order, and keep the delivery out of training storage until each row passes or carries a written exception. Results come from the illustrative request on the Sakila port at commit e089a5b.
| Check | Rule as run | Sakila result | Decision it forces |
|---|---|---|---|
| 1. Scope diff | Declared columns minus requested columns, table by table | 61 of 89 columns unrequested, including 8 whole tables | Supplier reissues; buyer logs what it received |
| 2. Dangling pointers | Kept foreign keys whose parent was dropped, then SQLite's foreign_key_check | 32,093 rental and payment rows, holding 599 customer keys, point at a dropped table | Ship a key-only parent table or drop the constraint |
| 3. Copies in other fields | Removed values searched for inside other fields, exact match | Customer names inside all 599 email addresses; staff names in 2 of 2 emails and usernames | Remove or approve each copy explicitly |
| 4. Sensitive leftovers | Credential and contact fields among the unrequested columns; email and phone patterns in kept text | 2 of 2 staff rows carry 40-character password hashes; 0 pattern hits in kept text | Quarantine and report; credentials never stay |
| 5. Derived objects | Views whose text names a dropped table | 4 of the 5 views the schema creates read a dropped table | Drop or rebuild each view, and record which |
| 6. Row rule along links | Rentals outside 2005 removed; payments follow their rental | 182 rentals and 182 payments removed; 182 of 183 open rentals leave with them | Document the rule and the shift it causes |
| 7. Keys after pruning | Rows identical on kept columns once the surrogate key is ignored | 4,581 inventory copies collapse to 1,521 film and store pairs; other tables 0 | Keep inventory_id: only it tells copies apart |
| 8. Manifest version | Requested tables whose columns or rows changed | 8 of 8 requested tables changed, 6 by columns alone | New version, counts and hashes for every file |
The database will not stop you: dropped tables and silent references
A database is a weak guard for this step, because its defaults let the damage through. On a new connection, SQLite reported foreign key enforcement off, and dropping all eight unrequested tables, including customer, which every rental and payment references, raised no error. SQLite's documentation says foreign key enforcement is turned off by default for backward compatibility and has to be enabled for each connection.
The same engine refused smaller cuts. Five of the 16 unrequested columns, the staff links on rentals and payments, the film's original-language link and the store's manager and address links, could not be dropped because each appears in a foreign key definition, one of the cases SQLite's ALTER TABLE documentation lists among the reasons DROP COLUMN fails. Those four tables had to be rebuilt: a new table with the kept columns and the foreign keys that still apply, the rows copied across, the old table dropped and the new one renamed. A rebuild that leaves out the surviving foreign keys leaves the next check nothing to test.
Asking afterwards finds the damage. SQLite's foreign_key_check pragma, which its documentation says returns one row for each foreign key violation, listed 32,093 rows: 16,044 rentals and 16,049 payments pointing at a customer table that no longer exists. With enforcement switched on, dropping the customer table failed with "FOREIGN KEY constraint failed". For the requested customer key there are two clean outcomes: ship a key-only customer table holding the 599 identifiers and nothing else, or remove the constraint from the delivered schema and document the column as an opaque grouping key. Either way, ask whether the supplier's internal customer number should leave its systems at all, or be replaced by a key minted for this delivery.
Copies and credentials hiding in other fields
Deleting the name columns would have removed no names. In all 599 customer rows, the part of the email address before the @ is the customer's first and last name joined by a dot, and in both staff rows the email does the same while the username equals the first name. A supplier that removed the name columns named in a ticket and kept email would have delivered every name anyway. The test is a value search, not a name search: for each removed column, look for its values inside every other field.
Copies can also sit in plain sight. Every payment with a rental carries the same customer key as that rental, 16,044 of 16,044, so a key removed from one table survives in the other unless both are cut. Views are copies of another kind: the customer and staff list views join names to street addresses, postal codes and phone numbers, and 4 of the 5 views the schema creates read a dropped table (a sixth, actor_info, is commented out in the port's schema file). Each one must be dropped or rebuilt, and the manifest should say which; only the view that totals sales by film category reads requested tables alone.
Then look for what should never ship. The unrequested staff table holds a 40-character password hash in both of its rows, which is a credential problem before it is a scope problem: quarantine the delivery and report it rather than deleting quietly. A pattern scan of kept text, all 1,000 film titles, 16 category names and 6 language names, found no email or phone patterns. Keep the patterns in the review log, because a zero means something only when the reader can see what was searched for.
A row rule changes more than the row count
Removing out-of-scope rows has to follow the links between tables, and it can change what the remaining data says. The 2005 rule removes 182 rentals; their 182 payments must go too, while the 5 payments that have no rental stay because their payment dates fall in 2005. Every payment falls in the same year as its rental here, so a rule written on payment dates alone happens to give the same result, but only checking the link shows that.
The bigger effect is on meaning. The rentals removed are almost exactly the open ones: 182 of the 183 rentals with no return date are from February 2006. Before the cut, about 1.1% of rentals are open; after it, one rental of 15,862 is. A model of return behavior trained on the 2005 cut would see almost no unreturned rentals, which is a property of the cut, not of the business. Record that shift in the data dictionary next to the rule.
Measure the baseline before blaming the cut. The delivery already carried 42 films with no inventory and 5 languages with no film; the 2005 rule added no new empty parents, because every film in inventory and all but one inventory copy have a rental in 2005. And the surrogate keys that look removable are not always: ignore inventory_id and the 4,581 inventory copies collapse into 1,521 film and store pairs, so that key has to stay.
Reissue or edit locally: who removes the field
Prefer a reissue by the supplier to a local edit by the buyer. A reissue makes the version of record match the approved scope and arrive with its own manifest and hashes, so the buyer never builds on a copy it edited itself. A local edit is faster, but the buyer then holds a version no one else can reproduce. Either way, the original delivery still has to be removed from the landing zone, backups and logs, with a record of what was deleted, where and when.
At a glance
Reissue or edit locally: who removes the field
The new version needs a manifest a third party can check. The checklist is the versioned manifest and reproducibility record for that version; it assumes the eight checks have run.
- Version: a new delivery version ID, the version it replaces and the reason, such as unrequested fields removed.
- Scope record: the requested columns and row rules as approved, and the scope diff that found the extra fields.
- Removal log: each removed table, column and row rule, with the number of values removed and every place a copy was found.
- Integrity results: foreign key check output after removal, showing zero violations or each documented exception, and every table rebuilt to drop a column.
- Derived objects: every view, summary or computed field that read removed content, and whether it was dropped, rebuilt or recomputed.
- Row-rule effects: counts removed per table, linked records that followed, and any shift in the kept data, such as the share of open rentals.
- Per-file entries: row count, column list and SHA-256 for every file in the new version, including files whose only change is a dropped audit column.
- Reproduction: the script and its hash or commit, the database engine and version, and the settings it ran with, such as foreign key enforcement.
- Deletion record: what was deleted from which locations, including any credentials received, and who confirmed it.
Writing field scope into a data request
Most of this work disappears when the request names its columns and row rules exactly, says what to do with copies, views and audit columns, and asks for the scope diff and foreign key check with every delivery. Use the data minimization guide to choose the columns, and route any later additions through a change request instead of a quiet extra column.
SourceX sources datasets on request from the businesses that hold the records, not from stock, and its request form takes the scope, format and licensing details where a column list and these checks belong. On the supplier side, SourceX's how-it-works page says each deal's Dataset Deal Confirmation fixes the exact dataset and that a material change later needs a signed amendment, so a field outside that dataset is a scope question for both parties, not a cleanup task.
Methods note: data, request and counting rules
Data: jOOQ's Sakila repository on GitHub at commit e089a5b1ec9af0df7a9c6a5d47d49fa1736a4e84 (2026-04-20), files sqlite-sakila-db/sqlite-sakila-schema.sql (SHA-256 b1db76b3...) and sqlite-sakila-db/sqlite-sakila-insert-data.sql (SHA-256 4d69a56a...), read on 2026-10-28. This is a third-party port: its data file says it ports the Sakila example database available for MySQL. MySQL's own download was not reachable from this environment, so a rerun on it is a release check. The writer's own parser read 46,273 insert statements, equal to the number of insert statements in the file; the script created its own tables from the parsed column lists, primary keys and foreign keys (no column types, triggers or views), inserted the values as text, and executed nothing from either file. Python's sqlite3 module with SQLite 3.45.1. Scripts: bin/sakila_parse.py and bin/xs0943_sakila_scope_v2.py (a rerun of bin/xs0943_sakila_scope.py that skips commented-out views), output bin/xs0943_sakila_scope_v2_out.txt, in the writer's W10-main-029 scratch folder; no data snapshot is kept.
Illustrative request: rental (rental_id, rental_date, inventory_id, customer_id, return_date); payment (payment_id, rental_id, customer_id, amount, payment_date); inventory (inventory_id, film_id, store_id); film (film_id, title, release_year, language_id, rental_duration, rental_rate, length, rating); film_category (film_id, category_id); category and language (ID and name); store (store_id). Row rule: keep a rental whose rental_date text starts with 2005; keep a payment whose rental is kept, or, when it has no rental, whose payment_date starts with 2005. Dates are compared as stored text, with no time zone.
Rules as applied: tables were dropped in the order film_actor, actor, film_text, customer, staff, address, city, country on a default connection; each unrequested column in a requested table was then dropped with ALTER TABLE, and the four tables that refused were rebuilt with their kept columns, primary key and the foreign keys whose columns were all kept. A fresh copy with foreign_keys switched on dropped film_actor, actor and film_text and then failed on customer. Name copies: the email's local part equals first_name, a dot and last_name, compared exactly and case-sensitively; username equals first_name exactly. Views: a dropped table counts as read when its name appears as a whole word in the view text; views inside /* */ comments, which the schema never creates, are skipped. Patterns: email [A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,} and phone \+?\d[\d ()-]{7,}\d, applied to film.title, category.name and language.name. Money in integer cents: the rule removes 514.18 in payments. Empty parents: a language is unused when no film carries its language_id; a film has no inventory when its film_id appears in no inventory row; an inventory copy is unrented when its inventory_id appears in no rental, counted over all rentals and again over kept rentals. Check 7 groups rows on all requested columns except the surrogate key. Check 8 counts a requested table as changed when its column count or row count differs.
Not measured: real deliveries, MySQL's original Sakila files, free text other than the columns listed, re-identification risk from combinations of kept fields, and database engines other than SQLite 3.45.1. An earlier run of the same checks on another sample database was discarded when a sibling article began analyzing that repository; no figure here comes from it.
Frequently asked questions
Can a buyer simply delete a column it did not request?
It can, but deletion is the first step, not the last. Copies of the same values can sit inside other fields, kept foreign keys can point at what was dropped, views can break, and some databases refuse to drop a column without rebuilding its table. Run the dependency checks, record the deletion, and prefer a reissued delivery from the supplier.
Why run a foreign key check after removing a table?
Because many databases will not stop the removal. In SQLite, foreign key enforcement is off by default, so dropping Sakila's customer table raised no error, and only the foreign_key_check pragma revealed 32,093 rental and payment rows pointing at a table that no longer exists.
What if the unrequested field holds personal data or credentials?
Quarantine the delivery, limit who can see it, ask the supplier to reissue it, and keep a record of any deletion; credentials such as password hashes should also be reported to the supplier. Under the UK GDPR, the ICO describes data minimisation as holding only data that is adequate, relevant and limited to the stated purpose. Counsel should review the specific case.
Does a row rule need to follow links between tables?
Yes. Removing out-of-scope rentals means removing their payments too, and the cut can change what the kept data says: in Sakila, the 2005 rule removed 182 of the 183 rentals that were never returned, leaving almost no open rentals in the kept data.
Who should remove an out-of-scope field, the supplier or the buyer?
The supplier, by reissuing the delivery, so the version of record matches the approved scope and comes with its own manifest and hashes. The buyer still deletes the original from its storage, backups and logs and records what was removed, where and when.
Sources
- jOOQ's port of the Sakila sample database at commit e089a5b: README, BSD license, SQLite schema and data files; source of every count in the eight-check matrix. Source
- SQLite turns foreign key enforcement off by default for backward compatibility; it must be enabled for each connection. Source
- SQLite's foreign_key_check pragma returns one row for each foreign key violation. Source
- SQLite's DROP COLUMN fails when the column is used in a foreign key constraint, among other cases. Source
- The ICO explains UK GDPR data minimisation as adequate, relevant and limited to what is necessary, and warns against collecting personal data on the off-chance it might be useful. Source
- SourceX sources datasets on request rather than from stock; buyers describe scope, format and licensing needs. Source
- Each deal's Dataset Deal Confirmation fixes the exact dataset, and a material change later needs a signed amendment. Source
Tell us what data you need
Share scope, volume, format, timing and licensing needs. Datasets are sourced on request.