# Metadata and introspection

Metadata contains the information about the database objects, structure, database object source code, and so on. IntelliJ IDEA uses this information to show the objects in   Database   tool window , display their DDL, suggest them during completion, and for other coding assistance, navigation, and search features.

In IntelliJ IDEA, there are two ways of obtaining metadata of your database: minicatalogs and [introspection](#introspection).

Minicatalogs
: With the minicatalogs for system schemas, metadata of system schemas is pre-introspected and provided with the IDE itself. They allow writing scripts that use system metadata prior to introspecting system schemas and with no connection to the database.

## Introspection

Introspection is a process of loading metadata of a database. When you perform introspection, structural information in the data source is inspected to detect tables, columns, routines, and other database objects with their attributes.

Introspection is only supported for the databases that have data structure and catalogs.

By default, only the schemas and databases selected to be shown in the   Database   tool window  are introspected.

You can select which schemas and databases will be introspected and shown by either selecting them in the    Database   tool window    , or editing the data source properties in   Data Sources and Drivers  dialog (  `Shift+Enter` (Windows), `⌘ I` (macOS), `⇧ ⏎` (IntelliJ IDEA Classic (macOS)), `⌘ I` (macOS System Shortcuts), `Shift+Enter` (XWin), `Shift+Enter` (GNOME), `Shift+Enter` (KDE), `Shift+Enter` (Emacs), `Shift+Enter` (Sublime Text), `⌘ I` (Sublime Text (macOS)), `Shift+Enter` (NetBeans), `Shift+Enter` (Visual Studio), `⌘ I` (Visual Studio (macOS)), `Shift+Enter` (Eclipse), `⌘ I` (Eclipse (macOS)) )   dialog.

Procedure: Select schemas and databases for introspection

> **Note:**
> Depending on the database size, introspection and loaded metadata can take a significant amount of time and disk space.

* In   Database   tool window :

1.

To open   Database   tool window , select  `View  | Tool Windows |  Database`  from the main menu. Alternatively, press `⌘ 1` (Windows), `⌘ 1` (macOS), `⌘ 1` (IntelliJ IDEA Classic (macOS)), `⌘ 1` (macOS System Shortcuts), `⌘ 1` (XWin), `⌘ 1` (GNOME), `⌘ 1` (KDE), `⌘ 1` (Emacs), `⌘ 1` (Sublime Text), `⌘ 1` (Sublime Text (macOS)), `⌘ 1` (NetBeans), `Ctrl+Alt+3` (Visual Studio), `⌘ ⌃ 3` (Visual Studio (macOS)), `⌘ 1` (Eclipse), `⌘ 1` (Eclipse (macOS)).

2.

In   Database   tool window , click the N of M button next to the data source, database, or schema name.

![Select schemas or databases in Database tool window](https://resources.jetbrains.com.cn/help/img/idea/2026.2/select_schemas_or_databases_to_show.png)

3.

In the schema selection popup window, select the databases or schemas and press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (NetBeans), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (Eclipse), `⏎` (Eclipse (macOS)).

* In Data Sources and Drivers dialog:

1.

To open the dialog, right-click the data source in   Database   tool window  and select ![the Properties icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/database-plugin.icons.expui.manageDataSources.svg) Properties. Alternatively, click the ![the Settings button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/database-plugin.icons.expui.manageDataSources_dark.svg) Data Source Properties icon on toolbar.

2.

In the Schemas tab of Data Sources and Drivers dialog, select the databases or schemas.

![Select schemas or databases in data source properties](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_schemas_or_databases_to_show_in_properties.png)

Note that the Object filter  field only defines which objects are visible in   Database   tool window  and does not affect the introspection scope.

3.

Apply your changes and close the dialog.

Once the necessary databases and schemas are introspected, IDE can resolve the database objects in your scripts to the correct context. The example below demonstrates database object resolve for introspected and not introspected schemas.

![Database objects resolve for the introspected and not introspected schemas](https://resources.jetbrains.com.cn/help/img/idea/2026.2/introspection_objects_resolve.png)

1. `MySQL` data source that has not been introspected.

2.  The only introspected `guest` database of the `PostgreSQL` data source. The database includes four schemas and only the `public` one has been introspected.

3.  Database object resolve in a query console: successful for the introspected `guest` schema and unsuccessful for the `tests` schema that has not been introspected.

> **Tip:**
> For query consoles, database object resolve also depends on the selected resolve mode.  For more information about query console resolve modes, refer to  the [Run queries](run-a-query.html#resolve_modes) topic.

For every data source, you can also select the category of schemas that source code of database objects is loaded for.

Procedure: Load sources of database objects for different schemas

1. To select schemas for which sources of database objects are loaded, open the   Data Sources and Drivers  dialog (  `Shift+Enter` (Windows), `⌘ I` (macOS), `⇧ ⏎` (IntelliJ IDEA Classic (macOS)), `⌘ I` (macOS System Shortcuts), `Shift+Enter` (XWin), `Shift+Enter` (GNOME), `Shift+Enter` (KDE), `Shift+Enter` (Emacs), `Shift+Enter` (Sublime Text), `⌘ I` (Sublime Text (macOS)), `Shift+Enter` (NetBeans), `Shift+Enter` (Visual Studio), `⌘ I` (Visual Studio (macOS)), `Shift+Enter` (Eclipse), `⌘ I` (Eclipse (macOS)) )  and select a data source.

2. In the Options tab, navigate to the Load sources for setting and select the category of schemas.

3. Apply the changes and close the dialog.

![Select the category of schemas that database object sources are loaded for](https://resources.jetbrains.com.cn/help/img/idea/2026.2/db_introspection_settings_load_sources_for.png)

Database users might experience a long introspection time if all the objects are being processed, whereas it is usually not required for daily work and coding assistance. To reduce the number of introspected objects, IntelliJ IDEA has additional [introspection types](#introspection_types) and also three [introspection levels](introspection-levels.html) implemented for some of the supported databases.

## Introspection types

The introspection type defines which database objects are refreshed during introspection. Some databases allow narrowing this introspection scope down to specific objects. In IntelliJ IDEA, depending on your database, the following introspection types are available: full introspection, fragment introspection, and incremental introspection.

Full introspection
: The schemas and databases selected for introspection in   Database   tool window  ([schema selector](database-tool-window.html#show_more_schemas)) or in the  Data Sources and Drivers  dialog (the Schemas [tab](data-sources-and-drivers-dialog.html#schemasAndTablesTab)) are refreshed.

Incremental introspection
: Only the database objects changed in the database after a previous introspection run are refreshed.

Fragment introspection
: * Only the database objects selected in Database tool window are refreshed when you invoke the Refresh action. ![The database objects selected in Database tool window are refreshed when you invoke the Refresh action](https://resources.jetbrains.com.cn/help/img/idea/2026.2/introspection_fragment_introspection.png)
:
: * When you run a statement in a query console, a smart refresh mechanism is applied. IntelliJ IDEA analyzes which objects could be potentially modified by this statement, and only that specific set of objects is refreshed. [Video](https://resources.jetbrains.com.cn/help/img/idea/2026.2/introspection_smart_refresh.mp4)

For some of the supported databases, introspection can be performed by introspection levels.

Introspection by levels
: Introspection levels define the amount of detail retrieved for database objects:
:
:
:
: * Level 1: Only database object names are loaded.
:
: * Level 2: Everything is loaded except the source code of database objects.
:
: * Level 3: Everything is loaded.
:
:
:
: For more information about introspection levels, refer to  the [Introspection levels](introspection-levels.html) topic.
:
:
:
: ![Introspection levels in Database tool window](https://resources.jetbrains.com.cn/help/img/idea/2026.2/introspection_levels.png)

If no specific introspection type is supported for a database, IntelliJ IDEA performs full introspection. Specific types of introspection and introspection levels are supported for the following databases:

| Database | Incremental introspection | Fragment introspection | Introspection levels |
| --- | --- | --- | --- |
| [Amazon Redshift](amazon-redshift.html) | Yes | Yes | Yes |
| [Azure SQL Database](azure-sql-database.html) | Yes | Yes | - |
| [Greenplum](greenplum.html) | Yes | - | - |
| [MariaDB](mariadb.html) | Yes | Yes | Yes |
| [Microsoft SQL Server](microsoft-sql-server.html) | Yes | Yes | Yes |
| [MySQL](mysql.html) | Yes | Yes | Yes |
| [Oracle](oracle.html) | Yes | Yes | Yes |
| [PostgreSQL](postgresql.html) | Yes | Yes | Yes |

