Schema Analysis

Analyze field paths, types, frequency, and data quality across your collections.

Overview

Schema Analysis scans your data to discover its actual structure and identify inconsistencies that could cause bugs. This is especially valuable for schema-less databases like Firestore and DynamoDB, where records in the same collection can have different fields and types. For PostgreSQL (Supabase), Schema Analysis shows introspected table schemas with column types and constraints.

Running an Analysis

Switch to Schema View in the data table toolbar, then choose how to analyze:

Analyze Loaded Documents

Click Analyze Loaded to instantly analyze the documents currently loaded in the table. This requires no additional API calls and provides immediate results based on the current page of data. Best for a quick look at your data structure.

Scan Entire Collection

Click Scan All to paginate through every document in the collection for a complete analysis. Stackpane fetches documents in batches and updates the analysis results as new batches arrive. This may take time for large collections but gives you the full picture.

Schema Table

The analysis results display in a sortable table with the following columns:

  • Field Path — the full path to each field, including nested paths (e.g., address.city, tags[0])
  • Type — color-coded badges showing the data type (string, number, boolean, map, array, timestamp, geopoint, reference, null)
  • Frequency — the percentage of documents that contain this field
  • Document Count — the absolute number of documents with this field
  • Sample Values — example values from the scanned documents

Mixed Type Detection

When a field has different types across documents (e.g., some documents have age as a number while others have it as a string), Stackpane flags it with a warning icon. Mixed types are a common source of bugs and query failures in Firestore.

Type Distribution Chart

Below the schema table, a chart visualizes the distribution of data types across all fields. This gives you a high-level view of your data composition.

Field Usage Statistics

The field usage statistics table provides per-field quality metrics:

  • Presence Rate — what percentage of documents contain this field (sorted highest first)
  • Dominant Type — the most common type for this field
  • Null Percentage — how often the field value is null
  • Type Consistency — percentage of non-null values that match the dominant type

Fields with low type consistency or high null percentages may be candidates for data cleanup or migration.

Use Cases

  • Pre-migration audit — verify all documents have the expected fields before running a migration script
  • Data quality check — identify fields with mixed types, high null rates, or inconsistent presence
  • Documentation — understand and document the actual schema of a collection for team reference
  • Debugging — find documents with unexpected field types that may cause client-side errors