Use DataGrip query consoles, history, quick docs, inspections, and editor tools to run SQL faster while making fewer destructive mistakes.
Key takeaways
The patterns worth keeping
Skim this block if you want the condensed version before reading the full walkthrough below.
Point 01
Treat each query console as a workspace, because new consoles create new connection sessions by default.
Point 02
Switch to single session mode only when you need temporary tables or session state to survive across consoles.
Point 03
Use Query History and Local History before rewriting SQL you already ran or accidentally deleted.
Point 04
Preview table DDL, parameter behavior, and syntax fixes in the editor before executing a statement.
Point 05
Let inspections and the Productivity Guide show where your SQL habits can be cleaned up or accelerated.
Section 01
Treat query consoles as separate workspaces
DataGrip query consoles work like disposable SQL workbenches. Because they are already attached to a data source, they let you start typing immediately without the setup friction that often turns small database checks into a context switch.
The main habit to build is separation. A console for ad hoc reads, another for a risky migration draft, and a third for performance checks is easier to reason about than one giant tab full of half-finished statements.
- Remember that DataGrip creates a default query console for each data source automatically.
- Open extra consoles for separate investigations, migrations, or scratch work instead of cramming everything into one tab.
- Rename consoles when a tab becomes tied to one ticket, incident, or dataset.
- Use F4 to jump into the default console quickly when you only need to inspect or test one statement.
Section 02
Choose session behavior deliberately
A lot of confusing SQL behavior in IDEs is actually session behavior. DataGrip is explicit here: consoles are separate unless you choose otherwise, so temp objects and connection state do not magically follow you from one tab to another.
Once you understand that rule, the tool becomes easier to trust. Use isolation for safety, and only collapse into one session when you really need continuity across several console tabs.
- By default, a new query console means a new connection session.
- Use separate sessions when you want isolation between experiments or long-running work.
- Enable single session mode when your workflow depends on shared temporary tables or session variables.
- Set the current schema or database intentionally so object resolution and completion stay relevant.
Section 03
Recover queries instead of retyping them
Query History and Local History solve two different failures. Query History brings back statements that actually ran, while Local History helps when you lost editor work before execution, such as an unfinished join rewrite or a deleted WHERE clause you still need to inspect.
Once these two tools become habit, recovery gets much faster and safer. You stop rebuilding fragile SQL from memory and start working from the exact statement or fragment you had before the mistake.
- Open Query History with Ctrl+Alt+E when you need a statement you already executed.
- Filter the Query History dialog by text instead of hunting manually through old tabs.
- Double-click a history entry to paste it back into the editor quickly.
- Use Local History when the code never ran but you still need to recover deleted or reformatted SQL.
Section 04
Ask the editor for context before execution
Running fewer blind queries is one of the easiest ways to improve speed and safety at the same time. If you can inspect the object definition, confirm a parameter pattern, or let the editor repair the structure before execution, you remove guesswork from the loop.
This matters most in shared databases, where a bad assumption costs more than a few seconds. DataGrip keeps enough reference information in the editor that you can often verify what you need without leaving the query tab.
- Use Quick Documentation with Ctrl+Q on a table name to inspect its CREATE DDL and related details.
- Check Parameter Info when you are unsure how a function or call signature fits together.
- Let Ctrl+Shift+Enter complete the current construct when a statement is syntactically incomplete.
- Use completion instead of memory for object names, especially when switching schemas or vendors.
Section 05
Let analysis and editing tools clean up your SQL
DataGrip is strongest when you treat it as an active editor instead of a passive SQL notepad. Inspections, quick fixes, and structured editing catch many issues before they become bad runs, especially in long statements where missing aliases or mismatched syntax are easy to miss.
Formatting and multi-cursor editing are small habits, but they compound. Cleaner scripts are easier to debug, easier to diff, and easier to trust when you return to them a day later.
- Pay attention to inspections because DataGrip highlights problematic code as you type.
- Use Alt+Enter on warnings and errors to see quick fixes or relevant actions.
- Use multiple cursors for repetitive column edits instead of manual line-by-line changes.
- Reformat code regularly so large scripts stay readable before review or handoff.
Section 06
Review what you actually use with the Productivity Guide
The Productivity Guide is useful because it is about your behavior, not generic advice. It shows which tools you rely on, which ones you never touch, and where a small change in habit could remove repeated friction from your SQL work.
A good routine is to check it after a week or two of real database work. Pick one underused feature that obviously fits your day-to-day tasks, adopt it deliberately, and let the next improvement build on that.
- Open Help | My Productivity to see which DataGrip features you use most and least.
- Sort by group to find adjacent features you have ignored even though they fit your workflow.
- Use the tip panel in the guide to learn one missed feature at a time.
- Review the guide periodically so your habits improve instead of freezing at the beginner stage.