Postgres (Stable)

Coming soon

Postgre Profiling

PostgreSQL Profiling is a feature that gathers detailed statistics at both the table and column levels within a PostgreSQL database. It is designed to provide insights into the performance and characteristics of the data stored in the database.

1. Table and Column Level Statistics: PostgreSQL Profiling collects statistics not only on tables but also on individual columns within those tables. This granularity allows you to analyze the data in a more detailed manner.

2. SQL-Based Profiler: The profiling mechanism in PostgreSQL is SQL-based, meaning it relies on SQL queries to gather statistics. It doesn't operate in isolation but can be enabled for specific SQL-based data sources within your PostgreSQL environment.

3. Impact on Ingestion Runs: Enabling profiling comes with a trade-off. While it provides valuable insights, it can slow down the process of ingesting data into the database. This slowdown occurs because the profiling process adds an additional workload to the database, which can affect the overall performance of ingestion jobs.

Caution: It's important to exercise caution when utilizing profiling across a large number of tables or extensive datasets, as this can result in substantial expenses. While we have taken steps to optimize the resource usage of the profiler's queries, it is essential for you to carefully consider the specific tables on which profiling is activated and the frequency of profiling runs.

Capabilities Explained:

  1. Row and Column Counts:

    • Row Counts: The profiling tool can extract the total number of rows in each table, providing an overview of the data volume.

    • Column Counts: It also captures the count of columns within each table, helping you understand the data structure.

  2. Column-Level Information:

    • Null Counts and Proportions: For each column, the tool identifies how many values are null (missing) and calculates the proportion of null values, which is crucial for data quality assessment.

    • Distinct Counts and Proportions: It determines the number of unique values in each column and calculates the proportion of distinct values, offering insights into data cardinality.

    • Statistical Measures: The tool computes various statistical measures for applicable columns, including the minimum, maximum, mean, median, standard deviation, and select quantile values. These statistics reveal the central tendency and variability of the data.

    • Histograms or Frequencies: It can generate histograms or frequency distributions of unique values within columns. These visual representations provide a clearer understanding of data distribution, aiding in data profiling and analysis.

These capabilities enable data professional and compliance team and to comprehensively analyze and profile their data, uncovering valuable insights such as data completeness, data quality, and the distribution of values. This information is essential for tasks like data cleansing, data modeling, and data exploration, ensuring that data-driven decisions are based on a solid understanding of the underlying data.

Supported Sources​arrow-up-right

SQL profiling is supported for all SQL sources. Check the individual source page to verify if it supports profiling.

Field
Description

host_port

host URL

databasestring

database (catalog). If set to Null, all databases will be considered for ingestion.

database_aliasstring

[Deprecated] Alias to apply to database when ingesting.

include_table_location_lineageboolean

If the source supports it, include table lineage to the underlying storage location.Default: True

include_tablesboolean

Whether tables should be ingested.Default: True

include_view_lineageboolean

Include table lineage for viewsDefault: False

include_viewsboolean

Whether views should be ingested.Default: True

initial_databasestring

Initial database used to query for the list of databases, when ingesting multiple databases. Note: this is not used if database or sqlalchemy_uri are provided.Default: postgres

optionsobject

Any options specified here will be passed to SQLAlchemy.create_enginearrow-up-right as kwargs.

passwordstring(password)

password

platform_instancestring

The instance of the platform that all assets produced by this recipe belong to

schemestring

database schemeDefault: postgresql+psycopg2

sqlalchemy_uristring

URI of database to connect to. See https://docs.sqlalchemy.org/en/14/core/engines.html#database-urlsarrow-up-right. Takes precedence over other connection parameters.

usernamestring

username

envstring

The environment that all assets produced by this connector belong toDefault: PROD

database_patternAllowDenyPattern

Regex patterns for databases to filter in ingestion. Note: this is not used if database or sqlalchemy_uri are provided.Default: {'allow': ['.*'], 'deny': [], 'ignoreCase': True}

database_pattern.allowarray(string)

database_pattern.denyarray(string)

database_pattern.ignoreCaseboolean

Whether to ignore case sensitivity during pattern matching.Default: True

domainmap(str,AllowDenyPattern)

A class to store allow deny regexes

domain.key.allowarray(string)

domain.key.denyarray(string)

domain.key.ignoreCaseboolean

Whether to ignore case sensitivity during pattern matching.Default: True

profile_patternAllowDenyPattern

Regex patterns to filter tables (or specific columns) for profiling during ingestion. Note that only tables allowed by the table_pattern will be considered.Default: {'allow': ['.*'], 'deny': [], 'ignoreCase': True}

profile_pattern.allowarray(string)

profile_pattern.denyarray(string)

profile_pattern.ignoreCaseboolean

Whether to ignore case sensitivity during pattern matching.Default: True

schema_patternAllowDenyPattern

Default: {'allow': ['.*'], 'deny': ['information_schema'], ...

schema_pattern.allowarray(string)

schema_pattern.denyarray(string)

schema_pattern.ignoreCaseboolean

Whether to ignore case sensitivity during pattern matching.Default: True

table_patternAllowDenyPattern

Regex patterns for tables to filter in ingestion. Specify regex to match the entire table name in database.schema.table format. e.g. to match all tables starting with customer in Customer database and public schema, use the regex 'Customer.public.customer.*'Default: {'allow': ['.*'], 'deny': [], 'ignoreCase': True}

table_pattern.allowarray(string)

table_pattern.denyarray(string)

table_pattern.ignoreCaseboolean

Whether to ignore case sensitivity during pattern matching.Default: True

view_patternAllowDenyPattern

Regex patterns for views to filter in ingestion. Note: Defaults to table_pattern if not specified. Specify regex to match the entire view name in database.schema.view format. e.g. to match all views starting with customer in Customer database and public schema, use the regex 'Customer.public.customer.*'Default: {'allow': ['.*'], 'deny': [], 'ignoreCase': True}

view_pattern.allowarray(string)

view_pattern.denyarray(string)

view_pattern.ignoreCaseboolean

Whether to ignore case sensitivity during pattern matching.Default: True

profilingGEProfilingConfig

Default: {'enabled': False, 'operation_config': {'lower_fre...

profiling.catch_exceptionsboolean

Default: True

profiling.enabledboolean

Whether profiling should be done.Default: False

profiling.field_sample_values_limitinteger

Upper limit for number of sample values to collect for all columns.Default: 20

profiling.include_field_distinct_countboolean

Whether to profile for the number of distinct values for each column.Default: True

profiling.include_field_distinct_value_frequenciesboolean

Whether to profile for distinct value frequencies.Default: False

profiling.include_field_histogramboolean

Whether to profile for the histogram for numeric fields.Default: False

profiling.include_field_max_valueboolean

Whether to profile for the max value of numeric columns.Default: True

profiling.include_field_mean_valueboolean

Whether to profile for the mean value of numeric columns.Default: True

profiling.include_field_median_valueboolean

Whether to profile for the median value of numeric columns.Default: True

profiling.include_field_min_valueboolean

Whether to profile for the min value of numeric columns.Default: True

profiling.include_field_null_countboolean

Whether to profile for the number of nulls for each column.Default: True

profiling.include_field_quantilesboolean

Whether to profile for the quantiles of numeric columns.Default: False

profiling.include_field_sample_valuesboolean

Whether to profile for the sample values for all columns.Default: True

profiling.include_field_stddev_valueboolean

Whether to profile for the standard deviation of numeric columns.Default: True

profiling.limitinteger

Max number of documents to profile. By default, profiles all documents.

profiling.max_number_of_fields_to_profileinteger

A positive integer that specifies the maximum number of columns to profile for any table. None implies all columns. The cost of profiling goes up significantly as the number of columns to profile goes up.

profiling.max_workersinteger

Number of worker threads to use for profiling. Set to 1 to disable.Default: 60

profiling.offsetinteger

Offset in documents to profile. By default, uses no offset.

profiling.partition_datetimestring(date-time)

For partitioned datasets profile only the partition which matches the datetime or profile the latest one if not set. Only Bigquery supports this.

profiling.partition_profiling_enabledboolean

Default: True

profiling.profile_if_updated_since_daysnumber

Profile table only if it has been updated since these many number of days. If set to null, no constraint of last modified time for tables to profile. Supported only in snowflake and BigQuery.

profiling.profile_table_level_onlyboolean

Whether to perform profiling at table-level only, or include column-level profiling as well.Default: False

profiling.profile_table_row_count_estimate_onlyboolean

Use an approximate query for row count. This will be much faster but slightly less accurate. Only supported for Postgres and MySQL.Default: False

profiling.profile_table_row_limitinteger

Profile tables only if their row count is less then specified count. If set to null, no limit on the row count of tables to profile. Supported only in snowflake and BigQueryDefault: 5000000

profiling.profile_table_size_limitinteger

Profile tables only if their size is less then specified GBs. If set to null, no limit on the size of tables to profile. Supported only in snowflake and BigQueryDefault: 5

profiling.query_combiner_enabledboolean

This feature is still experimental and can be disabled if it causes issues. Reduces the total number of queries issued and speeds up profiling by dynamically combining SQL queries where possible.Default: True

profiling.report_dropped_profilesboolean

Whether to report datasets or dataset columns which were not profiled. Set to True for debugging purposes.Default: False

profiling.turn_off_expensive_profiling_metricsboolean

Whether to turn off expensive profiling or not. This turns off profiling for quantiles, distinct_value_frequencies, histogram & sample_values. This also limits maximum number of fields being profiled to 10.Default: False

profiling.operation_configOperationConfig

Experimental feature. To specify operation configs.

profiling.operation_config.lower_freq_profile_enabledboolean

Whether to do profiling at lower freq or not. This does not do any scheduling just adds additional checks to when not to run profiling.Default: False

profiling.operation_config.profile_date_of_monthinteger

Number between 1 to 31 for date of month (both inclusive). If not specified, defaults to Nothing and this field does not take affect.

profiling.operation_config.profile_day_of_weekinteger

Number between 0 to 6 for day of week (both inclusive). 0 is Monday and 6 is Sunday. If not specified, defaults to Nothing and this field does not take affect.

stateful_ingestionStatefulStaleMetadataRemovalConfig

Base specialized config for Stateful Ingestion with stale metadata removal capability.

stateful_ingestion.enabledboolean

The type of the ingestion state provider registered with datahub.Default: False

stateful_ingestion.remove_stale_metadataboolean

Soft-deletes the entities present in the last successful run but missing in the current run with stateful_ingestion enabled.Default: True

Code Coordinates for self ingestion

Questions

If you've got any questions on configuring ingestion for Postgres for data mapping, feel free to ping us on our Slack.

Last updated