Oracle introspection levels
Oracle users might experience a long introspection time if there are lots of objects (tables, schemas, databases, and so on). Introspection is the process of getting the metadata of the database, such as object names, types of columns, and source code. DataGrip uses this information to provide coding assistance, navigation, and search.
Oracle system catalogs are relatively slow, and the introspection is even slower if a user has no permissions for accessing fast catalogs.
Usually, for daily work and coding assistance, there is no need to load sources of all the objects. In many cases, just having database names will be sufficient for proper code completion and navigation. DataGrip has the following introspection levels:
Level | Level set manually | Level inherited | Description |
---|---|---|---|
Level 1 | Names of all supported objects and their signatures, except for names of index columns and names of private package variables. | ||
Level 2 | Everything except source code. For example, on this level, if you open a routine, you will see its declaration but not its body. | ||
Level 3 | Everything. |
Icons represent the introspection level: the more the pill is filled, the higher the level. Also, color matters: a blue icon means that the introspection level is set directly, grey means that it is inherited.
For the Oracle databases, a fragmental introspection is also implemented. It is the ability to retrieve metadata for one single object. This helps in situations where the metadata (usually, the source code) is explicitly requested. For example, if you double-click a view, but the introspection level is low, DataGrip requests the source code at the same moment.
Refresh source code of a single object
Right-click an object and select Refresh.
Introspection level defaults
By default, DataGrip automatically sets the default introspection level for each schema based on the schema type and number of objects. For each schema the introspector counts objects and selects the introspection level using the following thresholds, where N is the number of objects:
Schema | Level 3 | Level 2 | Level 1 |
---|---|---|---|
Current | N <= 1000 | N <= 3000 | Otherwise |
Non-current | Never | N <= 3000 | Otherwise |
System | Never | N <= 100 | Otherwise |
The current schema is the one the Oracle session is connected to.
To change the defaults, open the Data Sources and Drivers dialog (Control+Alt+Shift+S), navigate to , and select the default introspection level for your data source.
Changing introspection levels
You can set the introspection level either for the whole database or for a particular schema. Schemas inherit their introspection level from the database, but you can set the level independently for each schema.
For the other database objects, the Introspection Level context submenu displays the current introspection level of the object.
By default, introspection level icons are disabled. You can enable them separately: for schemas and their children (tables, views, routines, and so on).
Enable introspection level icons
In the Database Explorer ( ), click the Show Options Menu icon () and select Introspection Level Icons (Oracle only).
Change the introspection level
Right-click an object in the Database Explorer ( ) and select the Introspection Level menu.
In the Introspection Level menu, select a level you want to apply.
Children inherit a level that is set for a parent.
Note that if you have the Auto sync option enabled in data source settings, the introspection will run as soon as you change the introspection level. For more information about Auto sync, refer to Auto sync in the Data sources and drivers dialog.