Goal
Install and configure PawSQL for DataGrip to review SQL before execution and optimize the selected SQL.Prerequisites
- A compatible DataGrip installation.
- Access to the JetBrains Marketplace, or an offline package supplied by PawSQL or an approved internal repository.
- Network access to PawSQL Cloud or PawSQL Server.
- Permission to use the intended project, workspace, and review policy.
Install the extension
Install PawSQL for DataGrip from the JetBrains Marketplace; see Install IDE Extensions for steps. Restart DataGrip afterwards and confirm the extension is enabled. If your network cannot reach Marketplace, use only an offline package supplied by PawSQL or an approved internal repository. Verify compatibility across the DataGrip, extension, and PawSQL Server versions.Connect to PawSQL
In the extension settings, configure the endpoint and authentication required by your deployment, then select or verify the project, workspace, and review policy used for analysis. Test the connection with a read-only statement first.Configure optimization options
In the extension settings, adjust optimization options to match your engineering policy:
Deduplication avoids candidates that repeat existing indexes. Validation results depend on the engine capability and data characteristics of the validation environment, so they do not transfer to a different application environment without re-validation.
Review and optimize SQL
Pre-execution review
Before the database console runs a statement, the extension requests a static PawSQL review and uses the configured mode and severity threshold to decide whether to proceed, request confirmation, or stop. Pre-execution review does not run the SQL.1
Run the statement
Use the normal execution action in the DataGrip database console.
2
Wait for static review
The extension sends the SQL and required context. This check does not execute the statement or create a candidate index.
3
Inspect the findings
Review the highest severity, triggered rules, and affected fragments.
4
Make an execution decision
Revise and review the SQL again, cancel the operation, or proceed after confirming the residual risk is acceptable.
Optimize SQL
Select a complete SQL statement and run the optimization command provided by the extension. PawSQL returns review findings, query rewrites, index recommendations, and performance validation.1
Select a complete statement
Select one complete SQL statement without adjacent statements, logs, or Markdown fences.
2
Start optimization
Run the optimization command provided by the extension.
3
Adjust this run if needed
Change rewrite or validation options before submission when required.
4
Open the result
Review findings, rewrite candidates, index recommendations, and performance evidence when processing completes.
Expected Result
The extension returns review findings with severity, along with optional query rewrites, index recommendations, and performance evidence. With pre-execution review enabled, SQL that reaches the risk threshold requires confirmation before it runs.Verification
Verify connectivity and results with a read-only statement. In a non-production environment, confirm that pre-execution review intercepts risky SQL at the configured threshold and that the optimization command returns review, rewrite, index, and validation results.Before applying a recommendation
- Verify result, parameter, and transaction semantics.
- Enable index deduplication to reduce candidates that repeat existing indexes, and recheck recommended indexes for overlap or conflict with existing indexes where needed.
- Account for write, storage, and maintenance costs.
- Retrieve execution plans during validation and confirm them with representative data and parameter values; when the validation environment differs from the target application environment, validate again in the target environment.
- Use code review, testing, and database change control for deployment.