<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Seqora Guide</title>
  <subtitle>How to read what Seqora shows you: query plans, object pages, a schema you did not write. Then how to do the everyday work, and what every panel is for.</subtitle>
  <id>https://seqora.dev/guide/</id>
  <link href="https://seqora.dev/guide/" />
  <link rel="self" type="application/atom+xml" href="https://seqora.dev/guide/feed.xml" />
  <updated>2026-12-03T00:00:00Z</updated>
  <author><name>Ayushman</name></author>
  <entry>
    <title>A database client for Mac</title>
    <link href="https://seqora.dev/guide/database-client-for-mac/" />
    <id>https://seqora.dev/guide/database-client-for-mac/</id>
    <published>2026-12-03T00:00:00Z</published>
    <updated>2026-12-03T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Install Seqora on macOS 12 or later from a .dmg or Homebrew, on Apple Silicon or Intel, and know where your connections and passwords live.</summary>
    <content type="html">&lt;p&gt;Seqora is a desktop client for PostgreSQL, MySQL, MariaDB, SQLite and SQL Server. On a Mac it is one universal app for Apple Silicon and Intel, on macOS 12 Monterey or later, signed and notarized by Apple. Install it from the .dmg or with Homebrew. The Free plan needs no account.&lt;/p&gt;
&lt;h2 id=&quot;install-the-dmg&quot;&gt;Install the .dmg&lt;a class=&quot;guide-anchor&quot; href=&quot;#install-the-dmg&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Download &lt;a href=&quot;https://releases.seqora.dev/latest/macos/dmg&quot; rel=&quot;noopener&quot;&gt;Seqora for macOS&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. The link always leads to the newest release&amp;#39;s .dmg. Open it and drag Seqora to &lt;code&gt;Applications&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Seqora is signed with an Apple Developer ID and notarized, so Gatekeeper opens it. The first time, macOS still asks whether to open an app downloaded from the internet, as it does for every app from outside the App Store, by Apple&amp;#39;s &lt;a href=&quot;https://support.apple.com/en-us/102445&quot; rel=&quot;noopener&quot;&gt;Safely open apps on your Mac&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;or-use-homebrew&quot;&gt;Or use Homebrew&lt;a class=&quot;guide-anchor&quot; href=&quot;#or-use-homebrew&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#terminal-window&quot; /&gt;&lt;/svg&gt;Shell&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sh&quot;&gt;&lt;code&gt;brew install ayushman-git/seqora/seqora&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The cask lives in Seqora&amp;#39;s own tap, so Homebrew adds the tap and installs the app in one step. It installs the same .dmg&amp;#39;s app into &lt;code&gt;Applications&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Seqora updates itself, and the cask says so, so &lt;code&gt;brew upgrade&lt;/code&gt; leaves it alone. &lt;code&gt;brew upgrade --greedy&lt;/code&gt; includes it, by Homebrew&amp;#39;s &lt;a href=&quot;https://docs.brew.sh/Manpage&quot; rel=&quot;noopener&quot;&gt;upgrade docs&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;, if you would rather Homebrew did the updating.&lt;/p&gt;
&lt;h2 id=&quot;apple-silicon-and-intel&quot;&gt;Apple Silicon and Intel&lt;a class=&quot;guide-anchor&quot; href=&quot;#apple-silicon-and-intel&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;There is one download. A universal app carries code for both kinds of Mac and runs natively on each, by Apple&amp;#39;s &lt;a href=&quot;https://developer.apple.com/documentation/apple-silicon/building-a-universal-macos-binary&quot; rel=&quot;noopener&quot;&gt;universal binary page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. Nothing runs under Rosetta. Apple keeps Rosetta as a general tool only through macOS 27, by its &lt;a href=&quot;https://developer.apple.com/documentation/apple-silicon/about-the-rosetta-translation-environment&quot; rel=&quot;noopener&quot;&gt;Rosetta page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;, so an Intel-only app has an end date that a universal one doesn&amp;#39;t.&lt;/p&gt;
&lt;p&gt;The oldest macOS Seqora opens on is 12 Monterey.&lt;/p&gt;
&lt;h2 id=&quot;how-updates-work&quot;&gt;How updates work&lt;a class=&quot;guide-anchor&quot; href=&quot;#how-updates-work&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Seqora looks for new releases on its own. The choice is in Settings › General › &lt;code&gt;Updates&lt;/code&gt;, under &lt;code&gt;Automatic updates&lt;/code&gt;: &lt;code&gt;Download and install automatically&lt;/code&gt;, &lt;code&gt;Notify me only&lt;/code&gt; or &lt;code&gt;Off&lt;/code&gt;. About has &lt;code&gt;Check for updates&lt;/code&gt; whichever you pick.&lt;/p&gt;
&lt;p&gt;On a Mac an update replaces the app in place. The window you have open keeps the old version until Seqora starts again, and an update that is waiting installs when you quit.&lt;/p&gt;
&lt;h2 id=&quot;where-your-data-lives&quot;&gt;Where your data lives&lt;a class=&quot;guide-anchor&quot; href=&quot;#where-your-data-lives&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Your connections, query history, SQL files and schema designs are kept in &lt;code&gt;~/Library/Application Support/com.seqora.app&lt;/code&gt;, in a SQLite database encrypted with SQLCipher. The key to it is in your login keychain. No password goes into a config file.&lt;/p&gt;
&lt;p&gt;An update, a new .dmg dragged over the old app, and &lt;code&gt;brew upgrade&lt;/code&gt; all leave that folder alone. Moving Seqora to the Trash does too, so a reinstall finds your connections where they were. &lt;code&gt;brew uninstall --zap seqora&lt;/code&gt; deletes the folder and Seqora&amp;#39;s caches. Short of deleting the folder yourself, that is the one way to remove your connections.&lt;/p&gt;
&lt;h2 id=&quot;databases-on-a-mac&quot;&gt;Databases on a Mac&lt;a class=&quot;guide-anchor&quot; href=&quot;#databases-on-a-mac&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A few things about running and reaching databases from macOS are worth knowing before you pick any client.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;PostgreSQL.&lt;/strong&gt; &lt;code&gt;psql&lt;/code&gt; with no host connects through a Unix socket in &lt;code&gt;/tmp&lt;/code&gt;, and a socket connection may sign in a different way from TCP. Seqora connects over TCP only, so a local server is &lt;code&gt;localhost:5432&lt;/code&gt; with a password. Seqora&amp;#39;s importer reads Homebrew&amp;#39;s &lt;code&gt;/opt/homebrew/etc/pg_service.conf&lt;/code&gt; beside &lt;code&gt;~/.pg_service.conf&lt;/code&gt;. See &lt;a href=&quot;/guide/postgresql-gui-client/&quot;&gt;A PostgreSQL GUI client&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;MySQL and MariaDB.&lt;/strong&gt; The &lt;code&gt;mysql&lt;/code&gt; client treats &lt;code&gt;localhost&lt;/code&gt; as a socket too, and accounts match on host, so test a GUI&amp;#39;s login with &lt;code&gt;mysql -h 127.0.0.1&lt;/code&gt;. See &lt;a href=&quot;/guide/mysql-gui-client/&quot;&gt;A MySQL GUI client&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SQL Server.&lt;/strong&gt; There is no SQL Server for macOS, and Microsoft doesn&amp;#39;t support its container image under Rosetta on Apple Silicon. SSMS is Windows only, and Azure Data Studio is retired. Connect to a server elsewhere with a SQL login or an Entra token. &lt;code&gt;Windows&lt;/code&gt; sign-in is greyed out on a Mac. See &lt;a href=&quot;/guide/sql-server-client/&quot;&gt;A SQL Server client for Mac, Windows and Linux&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SQLite.&lt;/strong&gt; Seqora registers itself for &lt;code&gt;.sqlite&lt;/code&gt; and &lt;code&gt;.sql&lt;/code&gt; files, so Finder&amp;#39;s &lt;code&gt;Open With&lt;/code&gt; lists it, and a &lt;code&gt;.sqlite&lt;/code&gt; file dropped on the window opens. See &lt;a href=&quot;/guide/sqlite-browser/&quot;&gt;A SQLite browser&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;the-first-connection&quot;&gt;The first connection&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-first-connection&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Press &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;N&lt;/kbd&gt;&lt;/kbd&gt;. &lt;code&gt;Connect a database&lt;/code&gt; opens. Paste a connection URL or fill in the host, port, user and password, or click &lt;code&gt;Explore the sample&lt;/code&gt; on the first screen for a bundled database that needs no server. &lt;code&gt;Import connections…&lt;/code&gt; reads &lt;code&gt;.pgpass&lt;/code&gt;, &lt;code&gt;pg_service.conf&lt;/code&gt;, &lt;code&gt;~/.my.cnf&lt;/code&gt;, &lt;code&gt;.env&lt;/code&gt; files, and the saved connections of DBeaver, DataGrip, TablePlus and Azure Data Studio. An SSH tunnel can use a host from &lt;code&gt;~/.ssh/config&lt;/code&gt; and the keys in your SSH agent, 1Password&amp;#39;s included. &lt;a href=&quot;/guide/connect/&quot;&gt;Connect&lt;/a&gt; has every option.&lt;/p&gt;
&lt;h2 id=&quot;what-it-costs&quot;&gt;What it costs&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-it-costs&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Free has no tab or window caps, no account and no time limit, and it is fine for paid work. Pro is $99 a year or $9.99 a month, and one key covers up to three of your own computers. The 14-day Pro trial starts inside the app with no card and no email. The &lt;a href=&quot;/pricing/&quot;&gt;pricing page&lt;/a&gt; has the full list.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;macOS 12 or later. A Mac on macOS 11 or older can&amp;#39;t open it.&lt;/li&gt;
&lt;li&gt;Seqora isn&amp;#39;t in the Mac App Store.&lt;/li&gt;
&lt;li&gt;SQL Server &lt;code&gt;Windows&lt;/code&gt; sign-in is available only in Seqora on Windows.&lt;/li&gt;
&lt;li&gt;Seqora reaches local servers over TCP, never a Unix socket.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry>
    <title>A database client for Windows</title>
    <link href="https://seqora.dev/guide/database-client-for-windows/" />
    <id>https://seqora.dev/guide/database-client-for-windows/</id>
    <published>2026-12-03T00:00:00Z</published>
    <updated>2026-12-03T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Install Seqora on Windows with one PowerShell line or the installer, know where your data and passwords live, and sign in to SQL Server as yourself.</summary>
    <content type="html">&lt;p&gt;Seqora is a desktop client for PostgreSQL, MySQL, MariaDB, SQLite and SQL Server. On Windows it runs on 64-bit Windows 10 and 11, installs for your user without administrator rights, and signs in to SQL Server with your Windows account. Install it with one PowerShell line or with the installer. The Free plan needs no account.&lt;/p&gt;
&lt;h2 id=&quot;install-with-powershell&quot;&gt;Install with PowerShell&lt;a class=&quot;guide-anchor&quot; href=&quot;#install-with-powershell&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Paste this into PowerShell, Windows PowerShell 5.1 or PowerShell 7.&lt;/p&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#terminal-window&quot; /&gt;&lt;/svg&gt;PowerShell&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;powershell&quot;&gt;&lt;code&gt;irm https://seqora.dev/install.ps1 | iex&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The &lt;a href=&quot;https://seqora.dev/install.ps1&quot;&gt;script&lt;/a&gt; reads Seqora&amp;#39;s release catalog, downloads the newest installer, checks it against the SHA-256 the catalog publishes, installs it, and opens Seqora. It installs for your user only, so it needs no administrator rights and no wizard. If Seqora is already open, it asks you to quit first rather than close it under you. Run it again later and it updates Seqora, or says you&amp;#39;re up to date.&lt;/p&gt;
&lt;h2 id=&quot;or-run-the-installer&quot;&gt;Or run the installer&lt;a class=&quot;guide-anchor&quot; href=&quot;#or-run-the-installer&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Download &lt;a href=&quot;https://releases.seqora.dev/latest/windows/exe&quot; rel=&quot;noopener&quot;&gt;the installer&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. The link always leads to the newest release.&lt;/p&gt;
&lt;p&gt;The installer isn&amp;#39;t code-signed yet, so Windows warns before it runs: &lt;code&gt;Windows protected your PC&lt;/code&gt;. Click &lt;code&gt;More info&lt;/code&gt;, then &lt;code&gt;Run anyway&lt;/code&gt;. Microsoft&amp;#39;s &lt;a href=&quot;https://learn.microsoft.com/en-us/windows/apps/package-and-deploy/smartscreen-reputation&quot; rel=&quot;noopener&quot;&gt;SmartScreen page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; describes the warning. A file the PowerShell line downloads doesn&amp;#39;t carry the mark a browser puts on downloads, which is why the script gets no warning.&lt;/p&gt;
&lt;p&gt;Where Smart App Control is on, Windows blocks unsigned apps however they arrived, by Microsoft&amp;#39;s &lt;a href=&quot;https://support.microsoft.com/en-us/topic/what-is-smart-app-control-285ea03d-fa88-4d56-882e-6698afdb7003&quot; rel=&quot;noopener&quot;&gt;Smart App Control page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;, and neither route installs Seqora.&lt;/p&gt;
&lt;p&gt;Seqora installs into &lt;code&gt;%LOCALAPPDATA%\Seqora&lt;/code&gt; and adds itself to the Start menu.&lt;/p&gt;
&lt;h2 id=&quot;what-it-needs&quot;&gt;What it needs&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-it-needs&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;64-bit Windows 10 or 11. The build is x64.&lt;/li&gt;
&lt;li&gt;On an Arm PC, Windows 11. It runs x64 apps through emulation, and Windows 10 on Arm doesn&amp;#39;t, by Microsoft&amp;#39;s &lt;a href=&quot;https://learn.microsoft.com/en-us/windows/arm/apps-on-arm-x86-emulation&quot; rel=&quot;noopener&quot;&gt;Arm emulation page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;WebView2, which draws Seqora&amp;#39;s window. It is part of Windows 11, and most Windows 10 PCs already have it, by Microsoft&amp;#39;s &lt;a href=&quot;https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution&quot; rel=&quot;noopener&quot;&gt;WebView2 distribution page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;how-updates-work&quot;&gt;How updates work&lt;a class=&quot;guide-anchor&quot; href=&quot;#how-updates-work&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Seqora looks for new releases on its own. The choice is in Settings › General › &lt;code&gt;Updates&lt;/code&gt;, under &lt;code&gt;Automatic updates&lt;/code&gt;: &lt;code&gt;Download and install automatically&lt;/code&gt;, &lt;code&gt;Notify me only&lt;/code&gt; or &lt;code&gt;Off&lt;/code&gt;. About has &lt;code&gt;Check for updates&lt;/code&gt; whichever you pick.&lt;/p&gt;
&lt;p&gt;On Windows an update runs the new installer, which closes Seqora and starts it again on the new version.&lt;/p&gt;
&lt;h2 id=&quot;where-your-data-lives&quot;&gt;Where your data lives&lt;a class=&quot;guide-anchor&quot; href=&quot;#where-your-data-lives&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Your connections, query history, SQL files and schema designs are kept in &lt;code&gt;%APPDATA%\com.seqora.app&lt;/code&gt;, in a SQLite database encrypted with SQLCipher. The key to it is in Windows Credential Manager, under your Windows account. No password goes into a config file.&lt;/p&gt;
&lt;p&gt;Updates, the PowerShell line and the installer all leave that folder alone. Uninstalling from Settings › Apps leaves it too, unless you tick &lt;code&gt;Delete the application data&lt;/code&gt; in the uninstaller, which starts unticked.&lt;/p&gt;
&lt;h2 id=&quot;databases-on-windows&quot;&gt;Databases on Windows&lt;a class=&quot;guide-anchor&quot; href=&quot;#databases-on-windows&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A few things are true of databases on Windows whichever client you use.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;SQL Server and your Windows account.&lt;/strong&gt; Windows sign-in tries Kerberos first and falls back to NTLM, by Microsoft&amp;#39;s &lt;a href=&quot;https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/register-a-service-principal-name-for-kerberos-connections&quot; rel=&quot;noopener&quot;&gt;SPN page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. In Seqora, &lt;code&gt;Windows&lt;/code&gt; signs in as the account you&amp;#39;re logged in with and saves no password. It goes through NTLM, so a server that allows only Kerberos refuses it, and Azure SQL doesn&amp;#39;t accept it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SQL Server Express.&lt;/strong&gt; A new Express or Developer install has TCP/IP off. Turn it on in SQL Server Configuration Manager and restart the service before any client reaches it on port 1433. &lt;a href=&quot;/guide/sql-server-client/&quot;&gt;A SQL Server client for Mac, Windows and Linux&lt;/a&gt; has the rest.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SSMS.&lt;/strong&gt; Seqora&amp;#39;s &lt;code&gt;Import connections…&lt;/code&gt; reads SQL Server Management Studio&amp;#39;s registered servers, and Azure Data Studio&amp;#39;s saved connections. Their passwords are encrypted for those tools, so each connection asks for its password once.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;PostgreSQL.&lt;/strong&gt; The password file is &lt;code&gt;%APPDATA%\postgresql\pgpass.conf&lt;/code&gt;, not &lt;code&gt;~/.pgpass&lt;/code&gt;, by the &lt;a href=&quot;https://www.postgresql.org/docs/current/libpq-pgpass.html&quot; rel=&quot;noopener&quot;&gt;libpq docs&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;, and Windows doesn&amp;#39;t check its permissions. Seqora&amp;#39;s importer reads that file, and the &lt;code&gt;pg_service.conf&lt;/code&gt; in each PostgreSQL installer&amp;#39;s &lt;code&gt;etc&lt;/code&gt; folder under &lt;code&gt;Program Files&lt;/code&gt;. See &lt;a href=&quot;/guide/postgresql-gui-client/&quot;&gt;A PostgreSQL GUI client&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SQLite.&lt;/strong&gt; Seqora registers itself for &lt;code&gt;.sqlite&lt;/code&gt; and &lt;code&gt;.sql&lt;/code&gt; files, so &lt;code&gt;Open with&lt;/code&gt; lists it. See &lt;a href=&quot;/guide/sqlite-browser/&quot;&gt;A SQLite browser&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;the-first-connection&quot;&gt;The first connection&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-first-connection&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Press &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;N&lt;/kbd&gt;&lt;/kbd&gt;. &lt;code&gt;Connect a database&lt;/code&gt; opens. Paste a connection URL or an ADO.NET connection string, or fill in the host, port, user and password, or click &lt;code&gt;Explore the sample&lt;/code&gt; on the first screen for a bundled database that needs no server. An SSH tunnel can use a host from your SSH config and the keys in ssh-agent, Pageant or 1Password. &lt;a href=&quot;/guide/connect/&quot;&gt;Connect&lt;/a&gt; has every option.&lt;/p&gt;
&lt;h2 id=&quot;what-it-costs&quot;&gt;What it costs&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-it-costs&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Free has no tab or window caps, no account and no time limit, and it is fine for paid work. Pro is $99 a year or $9.99 a month, and one key covers up to three of your own computers. The 14-day Pro trial starts inside the app with no card and no email. The &lt;a href=&quot;/pricing/&quot;&gt;pricing page&lt;/a&gt; has the full list.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The installer isn&amp;#39;t code-signed, so SmartScreen warns on a browser download, and Smart App Control blocks it.&lt;/li&gt;
&lt;li&gt;x64 only. Windows 10 on Arm can&amp;#39;t run it.&lt;/li&gt;
&lt;li&gt;Seqora isn&amp;#39;t in winget yet.&lt;/li&gt;
&lt;li&gt;SQL Server &lt;code&gt;Windows&lt;/code&gt; sign-in uses NTLM. Kerberos-only servers refuse it.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry>
    <title>A PostgreSQL GUI client</title>
    <link href="https://seqora.dev/guide/postgresql-gui-client/" />
    <id>https://seqora.dev/guide/postgresql-gui-client/</id>
    <published>2026-12-03T00:00:00Z</published>
    <updated>2026-12-03T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Reach a PostgreSQL server from a desktop client, pick the TLS mode that checks the certificate, and know what PostgreSQL makes hard.</summary>
    <content type="html">&lt;p&gt;Read this when you are choosing a desktop client for PostgreSQL, or when the one you have can&amp;#39;t reach the server. The first half is PostgreSQL itself: what stands between a client and a server, and what the engine makes hard once you are in. The second half is what Seqora does with each of those, and what it doesn&amp;#39;t.&lt;/p&gt;
&lt;h2 id=&quot;reach-the-server&quot;&gt;Reach the server&lt;a class=&quot;guide-anchor&quot; href=&quot;#reach-the-server&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A PostgreSQL server listens on port 5432. Out of the box, &lt;code&gt;listen_addresses&lt;/code&gt; is &lt;code&gt;localhost&lt;/code&gt;, so a fresh server takes only loopback and Unix-socket connections, by the &lt;a href=&quot;https://www.postgresql.org/docs/current/runtime-config-connection.html#GUC-LISTEN-ADDRESSES&quot; rel=&quot;noopener&quot;&gt;connection settings&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. A client on another machine needs that changed and the server restarted.&lt;/p&gt;
&lt;p&gt;Getting past the port, the server reads &lt;code&gt;pg_hba.conf&lt;/code&gt; from the top. The first line that matches the connection type, database, user and address decides the sign-in method. If no line matches, the server refuses with &lt;code&gt;no pg_hba.conf entry for host&lt;/code&gt;, as the &lt;a href=&quot;https://www.postgresql.org/docs/current/client-authentication-problems.html&quot; rel=&quot;noopener&quot;&gt;client authentication docs&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; show. That error is about the server&amp;#39;s rules, not your password.&lt;/p&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What you see&lt;/th&gt;
&lt;th&gt;What it usually means&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;Connection refused, or a timeout&lt;/td&gt;
&lt;td&gt;Nothing listens on that address and port, or a firewall drops it.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;no pg_hba.conf entry for host&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The server answered, and no &lt;code&gt;pg_hba.conf&lt;/code&gt; line allows this user from here.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;password authentication failed for user&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A line matched, and the password or the user name is wrong.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A TLS or certificate error&lt;/td&gt;
&lt;td&gt;The client asked for a check the server&amp;#39;s certificate doesn&amp;#39;t pass. See TLS.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;A &lt;code&gt;hostssl&lt;/code&gt; line in &lt;code&gt;pg_hba.conf&lt;/code&gt; matches only connections that use TLS, so a server can refuse a plaintext client that a &lt;code&gt;host&lt;/code&gt; line would have let in. New passwords are stored as &lt;code&gt;scram-sha-256&lt;/code&gt;, the default for &lt;a href=&quot;https://www.postgresql.org/docs/current/runtime-config-connection.html#GUC-PASSWORD-ENCRYPTION&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;password_encryption&lt;/code&gt;&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; since PostgreSQL 14.&lt;/p&gt;
&lt;h2 id=&quot;pick-the-tls-mode-that-checks&quot;&gt;Pick the TLS mode that checks&lt;a class=&quot;guide-anchor&quot; href=&quot;#pick-the-tls-mode-that-checks&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;libpq, PostgreSQL&amp;#39;s own client library, has six &lt;code&gt;sslmode&lt;/code&gt; values. The &lt;a href=&quot;https://www.postgresql.org/docs/current/libpq-ssl.html#LIBPQ-SSL-SSLMODE-STATEMENTS&quot; rel=&quot;noopener&quot;&gt;SSL support page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; lists what each one protects against.&lt;/p&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;code&gt;sslmode&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;Encrypts&lt;/th&gt;
&lt;th&gt;Checks the certificate&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;code&gt;disable&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;allow&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;If the server wants&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;prefer&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;If the server offers&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;require&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;verify-ca&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Signed by a trusted CA&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;verify-full&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Signed by a trusted CA, and the host name&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;The default is &lt;code&gt;prefer&lt;/code&gt;, and the docs call it insecure: it encrypts when it can and never checks who answered. &lt;code&gt;require&lt;/code&gt; stops a passive listener and nothing else. For a server across the internet, use &lt;code&gt;verify-full&lt;/code&gt;. A managed database from a cloud provider has a certificate a client can check, so there is no reason to settle for less.&lt;/p&gt;
&lt;h2 id=&quot;sockets-and-ssh&quot;&gt;Sockets and SSH&lt;a class=&quot;guide-anchor&quot; href=&quot;#sockets-and-ssh&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;On the server&amp;#39;s own machine, &lt;code&gt;psql&lt;/code&gt; with no host connects through a Unix-domain socket, a file named &lt;code&gt;.s.PGSQL.5432&lt;/code&gt; in &lt;code&gt;/tmp&lt;/code&gt; by default. A host that starts with &lt;code&gt;/&lt;/code&gt; is a socket directory, by the &lt;a href=&quot;https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-HOST&quot; rel=&quot;noopener&quot;&gt;libpq connection docs&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. Socket connections often sign in with &lt;code&gt;peer&lt;/code&gt;, which trusts the operating system&amp;#39;s user name, so &lt;code&gt;sudo -u postgres psql&lt;/code&gt; works where a GUI with a password doesn&amp;#39;t. A GUI that only speaks TCP needs a &lt;code&gt;pg_hba.conf&lt;/code&gt; line for &lt;code&gt;host&lt;/code&gt; on &lt;code&gt;127.0.0.1&lt;/code&gt; with a password method.&lt;/p&gt;
&lt;p&gt;A server inside a private network is usually reached through a bastion. An SSH tunnel carries the connection to the bastion and on to port 5432 from there. The database still sees a TCP connection, from the bastion&amp;#39;s address, so &lt;code&gt;pg_hba.conf&lt;/code&gt; has to allow that address.&lt;/p&gt;
&lt;h2 id=&quot;passwords-you-already-have&quot;&gt;Passwords you already have&lt;a class=&quot;guide-anchor&quot; href=&quot;#passwords-you-already-have&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;libpq reads two files a GUI can reuse.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;a href=&quot;https://www.postgresql.org/docs/current/libpq-pgpass.html&quot; rel=&quot;noopener&quot;&gt;password file&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;: &lt;code&gt;~/.pgpass&lt;/code&gt;, or &lt;code&gt;%APPDATA%\postgresql\pgpass.conf&lt;/code&gt; on Windows, one &lt;code&gt;hostname:port:database:username:password&lt;/code&gt; per line. On Linux and macOS libpq ignores it unless only you can read it (&lt;code&gt;chmod 600&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;The &lt;a href=&quot;https://www.postgresql.org/docs/current/libpq-pgservice.html&quot; rel=&quot;noopener&quot;&gt;connection service file&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;: &lt;code&gt;~/.pg_service.conf&lt;/code&gt;, with named sections such as &lt;code&gt;[commerce-primary]&lt;/code&gt; holding a host, port, database and user.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;what-postgresql-makes-hard&quot;&gt;What PostgreSQL makes hard&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-postgresql-makes-hard&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Schema changes take strong locks.&lt;/strong&gt; &lt;code&gt;ALTER TABLE&lt;/code&gt; takes an &lt;code&gt;ACCESS EXCLUSIVE&lt;/code&gt; lock unless the &lt;a href=&quot;https://www.postgresql.org/docs/current/sql-altertable.html&quot; rel=&quot;noopener&quot;&gt;docs&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; name a weaker one for that form, and that lock blocks even a plain &lt;code&gt;SELECT&lt;/code&gt;. A waiting lock also blocks the requests that queue behind it: an &lt;code&gt;ALTER TABLE orders&lt;/code&gt; waiting for a long report holds up every new read of &lt;code&gt;orders&lt;/code&gt; until the report ends. Setting &lt;a href=&quot;https://www.postgresql.org/docs/current/runtime-config-client.html#GUC-LOCK-TIMEOUT&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;lock_timeout&lt;/code&gt;&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; before the change makes it give up instead. &lt;a href=&quot;/blog/alter-table-locks/&quot;&gt;Which ALTER TABLE locks the table&lt;/a&gt; goes through the common forms.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Some changes rewrite the table.&lt;/strong&gt; Adding a column with a constant default is a catalog change. Adding one with a volatile default such as &lt;code&gt;clock_timestamp()&lt;/code&gt;, or changing a column&amp;#39;s type, normally rewrites every row while holding that lock.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;DDL is transactional, with exceptions.&lt;/strong&gt; Most schema changes can run inside &lt;code&gt;BEGIN&lt;/code&gt; and roll back, which makes a dry run possible. &lt;code&gt;CREATE DATABASE&lt;/code&gt;, &lt;code&gt;VACUUM&lt;/code&gt;, &lt;code&gt;ALTER SYSTEM&lt;/code&gt; and &lt;code&gt;CREATE INDEX CONCURRENTLY&lt;/code&gt; refuse to run in a transaction block. A failed &lt;code&gt;CREATE INDEX CONCURRENTLY&lt;/code&gt; leaves an &lt;code&gt;INVALID&lt;/code&gt; index behind that queries ignore and writes still maintain.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;An open transaction holds on.&lt;/strong&gt; A client left in a transaction keeps its locks and stops vacuum from cleaning up behind it. &lt;a href=&quot;https://www.postgresql.org/docs/current/runtime-config-client.html#GUC-IDLE-IN-TRANSACTION-SESSION-TIMEOUT&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;idle_in_transaction_session_timeout&lt;/code&gt;&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; ends such sessions, and it is off by default.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt; runs the statement.&lt;/strong&gt; On an &lt;code&gt;UPDATE&lt;/code&gt; or &lt;code&gt;DELETE&lt;/code&gt; the rows change, so the &lt;a href=&quot;https://www.postgresql.org/docs/current/sql-explain.html&quot; rel=&quot;noopener&quot;&gt;docs&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; suggest &lt;code&gt;BEGIN&lt;/code&gt;, &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt;, then &lt;code&gt;ROLLBACK&lt;/code&gt;. Since PostgreSQL 18 it reports buffers without being asked.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Query statistics need setup.&lt;/strong&gt; &lt;code&gt;pg_stat_statements&lt;/code&gt; has to be in &lt;code&gt;shared_preload_libraries&lt;/code&gt;, which needs a restart, and then &lt;code&gt;CREATE EXTENSION&lt;/code&gt; in each database that should have the view, by its &lt;a href=&quot;https://www.postgresql.org/docs/current/pgstatstatements.html&quot; rel=&quot;noopener&quot;&gt;docs&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;what-to-look-for-in-a-client&quot;&gt;What to look for in a client&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-look-for-in-a-client&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;It offers &lt;code&gt;verify-full&lt;/code&gt;, or its own name for it, and says plainly when a connection is not checked.&lt;/li&gt;
&lt;li&gt;It reads &lt;code&gt;.pgpass&lt;/code&gt; and &lt;code&gt;pg_service.conf&lt;/code&gt;, so your connections don&amp;#39;t have to be typed twice.&lt;/li&gt;
&lt;li&gt;It shows whether you are in a transaction, and doesn&amp;#39;t leave one open behind a closed tab.&lt;/li&gt;
&lt;li&gt;It runs &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt; on a write only inside a transaction it rolls back.&lt;/li&gt;
&lt;li&gt;It tells you which lock a schema change takes before you run it on a busy table.&lt;/li&gt;
&lt;li&gt;It makes the production connection look different from the local one.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;seqora-on-postgresql&quot;&gt;Seqora on PostgreSQL&lt;a class=&quot;guide-anchor&quot; href=&quot;#seqora-on-postgresql&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;PostgreSQL is the engine Seqora was built on first, and every feature it has works here. &lt;a href=&quot;/guide/connect/&quot;&gt;Connect&lt;/a&gt; walks the dialog. These are the parts that answer the sections above.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;TLS.&lt;/strong&gt; Four modes: &lt;code&gt;Off&lt;/code&gt;, &lt;code&gt;Prefer&lt;/code&gt;, &lt;code&gt;Require&lt;/code&gt; and &lt;code&gt;Verify&lt;/code&gt;. &lt;code&gt;Verify&lt;/code&gt; checks the certificate and the host name, like &lt;code&gt;verify-full&lt;/code&gt;, against the certificates your operating system trusts. A host that isn&amp;#39;t on your computer starts at &lt;code&gt;Require&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No sockets.&lt;/strong&gt; Seqora connects over TCP only. A server on your own machine is &lt;code&gt;localhost:5432&lt;/code&gt;, and the first screen lists one it finds there as &lt;code&gt;PostgreSQL on localhost:5432&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SSH.&lt;/strong&gt; A tunnel takes a key file, a password or your SSH agent, and reads hosts from &lt;code&gt;~/.ssh/config&lt;/code&gt;. Seqora checks the host key the first time and refuses a key that changed.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Import.&lt;/strong&gt; &lt;code&gt;Import connections…&lt;/code&gt; reads &lt;code&gt;.pgpass&lt;/code&gt; and &lt;code&gt;pg_service.conf&lt;/code&gt;, the system-wide service files too, and the saved connections of DBeaver, DataGrip and TablePlus.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Writes.&lt;/strong&gt; Every connection opens locked. Unlocked, grid edits wait in &lt;code&gt;Pending changes&lt;/code&gt; for a review and apply in one transaction. The SQL editor stops a &lt;code&gt;DELETE&lt;/code&gt; or &lt;code&gt;UPDATE&lt;/code&gt; without a &lt;code&gt;WHERE&lt;/code&gt;, a &lt;code&gt;DROP&lt;/code&gt; or a &lt;code&gt;TRUNCATE&lt;/code&gt; for a review. &lt;code&gt;Revert&lt;/code&gt; takes a write back after checking the rows haven&amp;#39;t changed since, from the grid or from the SQL editor. See &lt;a href=&quot;/guide/edit-data/&quot;&gt;Edit data&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Locks.&lt;/strong&gt; Before DDL runs, the lock forecast shows the lock each statement takes, whether it rewrites the table, the sessions it would wait behind, and a safer form where there is one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Plans (Pro).&lt;/strong&gt; The Plan tab draws the plan as row flow and says where the time went. It measures a read on its own, and a write only through &lt;code&gt;Analyze in rollback&lt;/code&gt;. &lt;code&gt;Test index&lt;/code&gt; plans the query again with a hypothetical index through &lt;code&gt;hypopg&lt;/code&gt;. See &lt;a href=&quot;/guide/why-is-this-query-slow/&quot;&gt;Why is this query slow?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Workload.&lt;/strong&gt; The session recorder reads &lt;code&gt;pg_stat_statements&lt;/code&gt; and lists every query pattern your app sends, with exact counts. Without the extension it gives you the statements that set it up.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;PostgreSQL is also the only engine with the lock forecast, undo from the SQL editor, &lt;code&gt;View as role&lt;/code&gt; (Pro), extension pages, row-level security on the &lt;code&gt;Access&lt;/code&gt; page, and the index advisor&amp;#39;s tested adds (Pro). &lt;a href=&quot;/guide/other-engines/&quot;&gt;MySQL, MariaDB, SQLite and SQL Server&lt;/a&gt; has the full table.&lt;/p&gt;
&lt;p&gt;To read one plan without installing anything, paste it into the &lt;a href=&quot;/explain/&quot;&gt;EXPLAIN visualizer&lt;/a&gt;. The plan never leaves your browser.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Seqora doesn&amp;#39;t sign in with a client certificate, and it doesn&amp;#39;t take a CA file of its own. A server whose certificate comes from a private CA passes &lt;code&gt;Verify&lt;/code&gt; only once that CA is trusted by your operating system. An imported connection that used either says so on its row.&lt;/li&gt;
&lt;li&gt;An imported connection that used a Unix socket is changed to &lt;code&gt;localhost&lt;/code&gt; over TCP, and the row says so.&lt;/li&gt;
&lt;li&gt;The lock is Seqora&amp;#39;s, not the server&amp;#39;s. For a guarantee, connect as a user that only has &lt;code&gt;SELECT&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Test index&lt;/code&gt; needs the &lt;code&gt;hypopg&lt;/code&gt; extension on the server. Without it the Plan tab still reads the plan.&lt;/li&gt;
&lt;li&gt;No PostgreSQL version is certified yet. The target is PostgreSQL 16.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry>
    <title>A MySQL GUI client</title>
    <link href="https://seqora.dev/guide/mysql-gui-client/" />
    <id>https://seqora.dev/guide/mysql-gui-client/</id>
    <published>2026-12-03T00:00:00Z</published>
    <updated>2026-12-03T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Connect a desktop client to MySQL past caching_sha2_password and TLS, and know what DDL, metadata locks and sql_mode do to your changes.</summary>
    <content type="html">&lt;p&gt;Read this when you are picking a desktop client for MySQL, or when one refuses to sign in that the &lt;code&gt;mysql&lt;/code&gt; command line accepts. The first half is MySQL: accounts, the default sign-in plugin, TLS, and what a schema change does to a busy table. The second half is what Seqora does on MySQL and what it leaves out. MariaDB started as a fork of MySQL and has drifted since. It has &lt;a href=&quot;/guide/mariadb-gui-client/&quot;&gt;its own page&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;accounts-are-a-user-and-a-host&quot;&gt;Accounts are a user and a host&lt;a class=&quot;guide-anchor&quot; href=&quot;#accounts-are-a-user-and-a-host&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;MySQL matches an account on the user name and the host it connects from, by the &lt;a href=&quot;https://dev.mysql.com/doc/refman/8.4/en/connection-access.html&quot; rel=&quot;noopener&quot;&gt;access control docs&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. &lt;code&gt;&amp;#39;app&amp;#39;@&amp;#39;localhost&amp;#39;&lt;/code&gt; and &lt;code&gt;&amp;#39;app&amp;#39;@&amp;#39;%&amp;#39;&lt;/code&gt; are two accounts, with their own passwords and privileges. A login that works on the server can fail from your laptop because the laptop matches the other one.&lt;/p&gt;
&lt;p&gt;On Linux and macOS the &lt;code&gt;mysql&lt;/code&gt; client also treats the host &lt;code&gt;localhost&lt;/code&gt; as a Unix socket, not TCP, by the &lt;a href=&quot;https://dev.mysql.com/doc/refman/8.4/en/connecting.html&quot; rel=&quot;noopener&quot;&gt;connecting docs&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. &lt;code&gt;127.0.0.1&lt;/code&gt; forces TCP. A desktop client that connects over TCP is not doing what &lt;code&gt;mysql -h localhost&lt;/code&gt; did, so test with &lt;code&gt;mysql -h 127.0.0.1 --protocol=TCP&lt;/code&gt; when the two disagree.&lt;/p&gt;
&lt;h2 id=&quot;the-first-sign-in-needs-tls&quot;&gt;The first sign-in needs TLS&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-first-sign-in-needs-tls&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;caching_sha2_password&lt;/code&gt; is the default sign-in plugin. The server keeps a cache of accounts that have signed in. A sign-in that misses it, the first after a new account, a password change or a restart, has to travel over TLS or a socket, or exchange an RSA key. Otherwise the client gets error 2061, &lt;code&gt;Authentication requires secure connection&lt;/code&gt;. The &lt;a href=&quot;https://dev.mysql.com/doc/refman/8.4/en/caching-sha2-pluggable-authentication.html#caching-sha2-pluggable-authentication-cache-operation&quot; rel=&quot;noopener&quot;&gt;plugin page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; has the details.&lt;/p&gt;
&lt;p&gt;The older &lt;code&gt;mysql_native_password&lt;/code&gt; is off by default in MySQL 8.4 and was removed in 9.0, by its &lt;a href=&quot;https://dev.mysql.com/doc/refman/8.4/en/native-pluggable-authentication.html&quot; rel=&quot;noopener&quot;&gt;own page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. A client that only speaks that plugin can&amp;#39;t sign in to a current server with a default account.&lt;/p&gt;
&lt;h2 id=&quot;tls-that-checks&quot;&gt;TLS that checks&lt;a class=&quot;guide-anchor&quot; href=&quot;#tls-that-checks&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;mysql&lt;/code&gt; client&amp;#39;s &lt;code&gt;--ssl-mode&lt;/code&gt; has five values, from the &lt;a href=&quot;https://dev.mysql.com/doc/refman/8.4/en/connection-options.html#option_general_ssl-mode&quot; rel=&quot;noopener&quot;&gt;connection options&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;code&gt;--ssl-mode&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;Encrypts&lt;/th&gt;
&lt;th&gt;Checks the certificate&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DISABLED&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;PREFERRED&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;If it can&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;REQUIRED&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;VERIFY_CA&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Signed by the CA you give it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;VERIFY_IDENTITY&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Signed by that CA, and the host name&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;A server with no certificate configured makes its own at startup, a self-signed CA and certificate in the data directory, by the &lt;a href=&quot;https://dev.mysql.com/doc/refman/8.4/en/creating-ssl-rsa-files-using-mysql.html#creating-ssl-rsa-files-using-mysql-automatic&quot; rel=&quot;noopener&quot;&gt;SSL file docs&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. So TLS is on from install, and &lt;code&gt;REQUIRED&lt;/code&gt; works. A host-name check fails against those generated files, because they don&amp;#39;t name your host. For a server across the internet, install a certificate that names it and use &lt;code&gt;VERIFY_IDENTITY&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;a-schema-change-commits-on-its-own&quot;&gt;A schema change commits on its own&lt;a class=&quot;guide-anchor&quot; href=&quot;#a-schema-change-commits-on-its-own&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;DDL in MySQL causes an &lt;a href=&quot;https://dev.mysql.com/doc/refman/8.4/en/implicit-commit.html&quot; rel=&quot;noopener&quot;&gt;implicit commit&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. &lt;code&gt;BEGIN&lt;/code&gt;, an &lt;code&gt;ALTER TABLE&lt;/code&gt;, then &lt;code&gt;ROLLBACK&lt;/code&gt; does not roll the &lt;code&gt;ALTER&lt;/code&gt; back. Since 8.0 each DDL statement is &lt;a href=&quot;https://dev.mysql.com/doc/refman/8.4/en/atomic-ddl.html&quot; rel=&quot;noopener&quot;&gt;atomic&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; on InnoDB, so it applies whole or not at all, but a migration of five statements that fails at the third leaves two applied.&lt;/p&gt;
&lt;p&gt;An &lt;code&gt;ALTER TABLE&lt;/code&gt; also needs the table&amp;#39;s metadata lock, which an open transaction that touched the table holds until it ends, by the &lt;a href=&quot;https://dev.mysql.com/doc/refman/8.4/en/metadata-locking.html&quot; rel=&quot;noopener&quot;&gt;metadata locking docs&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. While the &lt;code&gt;ALTER&lt;/code&gt; waits, the statements behind it wait too, and the process list shows them in &lt;code&gt;Waiting for table metadata lock&lt;/code&gt;. One forgotten transaction in a client can stall every query on &lt;code&gt;orders&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://dev.mysql.com/doc/refman/8.4/en/innodb-online-ddl-operations.html&quot; rel=&quot;noopener&quot;&gt;Online DDL&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; decides how much the change blocks. &lt;code&gt;ALGORITHM=INSTANT&lt;/code&gt; changes only metadata. &lt;code&gt;INPLACE&lt;/code&gt; and &lt;code&gt;COPY&lt;/code&gt; rebuild, with &lt;code&gt;LOCK=NONE&lt;/code&gt;, &lt;code&gt;SHARED&lt;/code&gt; or &lt;code&gt;EXCLUSIVE&lt;/code&gt;. Naming the algorithm you expect makes MySQL refuse the change instead of quietly taking a slower path.&lt;/p&gt;
&lt;h2 id=&quot;sqlmode-decides-what-bad-data-does&quot;&gt;sql_mode decides what bad data does&lt;a class=&quot;guide-anchor&quot; href=&quot;#sqlmode-decides-what-bad-data-does&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;MySQL 8.4&amp;#39;s default &lt;code&gt;sql_mode&lt;/code&gt; includes &lt;code&gt;STRICT_TRANS_TABLES&lt;/code&gt;, &lt;code&gt;ONLY_FULL_GROUP_BY&lt;/code&gt;, &lt;code&gt;NO_ZERO_DATE&lt;/code&gt; and &lt;code&gt;ERROR_FOR_DIVISION_BY_ZERO&lt;/code&gt;, among others. Under strict mode an &lt;code&gt;INSERT&lt;/code&gt; with a value too long for its column fails. Without it, MySQL cuts the value and warns, by the &lt;a href=&quot;https://dev.mysql.com/doc/refman/8.4/en/sql-mode.html#sql-mode-strict&quot; rel=&quot;noopener&quot;&gt;sql_mode docs&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. A server set up years ago may still run without strict mode, so check &lt;code&gt;SELECT @@sql_mode&lt;/code&gt; before trusting a load.&lt;/p&gt;
&lt;h2 id=&quot;plans&quot;&gt;Plans&lt;a class=&quot;guide-anchor&quot; href=&quot;#plans&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;EXPLAIN FORMAT=TREE&lt;/code&gt; arrived in 8.0.16 and &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt; in 8.0.18. &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt; runs the statement and prints real row counts and timings, by the &lt;a href=&quot;https://dev.mysql.com/doc/refman/8.4/en/explain.html#explain-analyze&quot; rel=&quot;noopener&quot;&gt;EXPLAIN docs&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. Column histograms, built with &lt;code&gt;ANALYZE TABLE … UPDATE HISTOGRAM ON …&lt;/code&gt;, tell the optimizer how the values in a column are spread, which it uses to estimate rows.&lt;/p&gt;
&lt;h2 id=&quot;what-to-look-for-in-a-client&quot;&gt;What to look for in a client&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-look-for-in-a-client&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;It speaks &lt;code&gt;caching_sha2_password&lt;/code&gt;, and uses TLS for the first sign-in without being told.&lt;/li&gt;
&lt;li&gt;It verifies the host name when you ask, and says when a connection is encrypted but not checked.&lt;/li&gt;
&lt;li&gt;It tells you a schema change commits as it goes, before you apply five of them.&lt;/li&gt;
&lt;li&gt;It doesn&amp;#39;t leave a transaction open behind a closed tab, holding a metadata lock.&lt;/li&gt;
&lt;li&gt;It reads the plan of a query with &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt;, and never runs a write to get one.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;seqora-on-mysql&quot;&gt;Seqora on MySQL&lt;a class=&quot;guide-anchor&quot; href=&quot;#seqora-on-mysql&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;/guide/connect/&quot;&gt;Connect&lt;/a&gt; walks the dialog. These are the parts that answer the sections above.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;TCP only.&lt;/strong&gt; Seqora connects over TCP, never a socket, so the account it uses is the one that matches your address. The first screen lists a server on your computer as &lt;code&gt;MySQL on localhost:3306&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;TLS.&lt;/strong&gt; &lt;code&gt;Prefer&lt;/code&gt; tries TLS first and falls back to plaintext only when TLS fails. &lt;code&gt;Require&lt;/code&gt; encrypts without checking, like &lt;code&gt;REQUIRED&lt;/code&gt;. &lt;code&gt;Verify&lt;/code&gt; checks the certificate and the host name, like &lt;code&gt;VERIFY_IDENTITY&lt;/code&gt;, against the certificates your operating system trusts. There is no mode that checks the CA without the host name, and no CA file of its own. Through an SSH tunnel, &lt;code&gt;Verify&lt;/code&gt; checks the server&amp;#39;s own host name, not the tunnel&amp;#39;s.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Import.&lt;/strong&gt; &lt;code&gt;Import connections…&lt;/code&gt; reads the client groups of &lt;code&gt;~/.my.cnf&lt;/code&gt;, and DBeaver, DataGrip, TablePlus and &lt;code&gt;.env&lt;/code&gt; files. &lt;code&gt;mysql_config_editor&lt;/code&gt;&amp;#39;s &lt;code&gt;.mylogin.cnf&lt;/code&gt; is obfuscated on purpose, so Seqora reports that it found one and reads nothing from it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DDL.&lt;/strong&gt; Design mode (Pro) works on MySQL, and the review says before you apply: &amp;quot;MySQL commits each schema statement on its own. If one fails while applying, the statements before it stay applied.&amp;quot; The dry run replays the statements on empty copies of the tables in a scratch database, then drops it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Transactions.&lt;/strong&gt; After an error inside a transaction the badge reads &lt;code&gt;State unknown&lt;/code&gt; until &lt;code&gt;Rollback&lt;/code&gt; or &lt;code&gt;Refresh transaction&lt;/code&gt; settles it, because MySQL&amp;#39;s errors don&amp;#39;t report the transaction&amp;#39;s state.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Editor.&lt;/strong&gt; &lt;code&gt;SET NAMES&lt;/code&gt;, other character set changes, &lt;code&gt;RESET&lt;/code&gt;, executable comments (&lt;code&gt;/*! … */&lt;/code&gt;) and a bare &lt;code&gt;DELIMITER&lt;/code&gt; are refused. A stored program&amp;#39;s &lt;code&gt;BEGIN … END&lt;/code&gt; body runs when it is wrapped in &lt;code&gt;DELIMITER $$ … $$&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Plans (Pro).&lt;/strong&gt; The Plan tab needs MySQL 8.0.18 or later, and analyzes reads only. Writes are never analyzed on MySQL.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Column facts.&lt;/strong&gt; The inspector shows a column&amp;#39;s histogram, and a column without one offers the &lt;code&gt;ANALYZE TABLE … UPDATE HISTOGRAM&lt;/code&gt; that builds it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Workload.&lt;/strong&gt; The session recorder reads &lt;code&gt;performance_schema&lt;/code&gt; statement digests, with exact counts per query pattern.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Grid edits, the review, &lt;code&gt;Revert&lt;/code&gt; from the grid, the ER diagram, the database brief and watching a table work as they do on PostgreSQL. The index advisor (Pro) ranks indexes to drop, and suggests no adds, because MySQL has no hypothetical indexes to test them with.&lt;/p&gt;
&lt;p&gt;Not on MySQL: the lock forecast, undo from the SQL editor, &lt;code&gt;View as role&lt;/code&gt;, &lt;code&gt;Test index&lt;/code&gt;, and extension pages. &lt;a href=&quot;/guide/other-engines/&quot;&gt;MySQL, MariaDB, SQLite and SQL Server&lt;/a&gt; has the full table.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Revert&lt;/code&gt; on MySQL covers grid edits. A write from the SQL editor can&amp;#39;t be taken back in Seqora.&lt;/li&gt;
&lt;li&gt;Seqora doesn&amp;#39;t sign in with a client certificate. A server whose certificate comes from a private CA passes &lt;code&gt;Verify&lt;/code&gt; only once that CA is trusted by your operating system.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Statement timeout&lt;/code&gt;, in Settings, stops a statement with &lt;code&gt;KILL QUERY&lt;/code&gt;, the way &lt;code&gt;Cancel run&lt;/code&gt; does, rather than through a session variable.&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;SET sql_mode&lt;/code&gt; has to be the last statement of its script, because the statements after it would be read with the new mode.&lt;/li&gt;
&lt;li&gt;No MySQL version is certified yet. The target is MySQL 8.4.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry>
    <title>A MariaDB GUI client</title>
    <link href="https://seqora.dev/guide/mariadb-gui-client/" />
    <id>https://seqora.dev/guide/mariadb-gui-client/</id>
    <published>2026-12-03T00:00:00Z</published>
    <updated>2026-12-03T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Connect a desktop client to MariaDB 11.4 and later, past its default TLS and socket-only root, and know where it differs from MySQL.</summary>
    <content type="html">&lt;p&gt;Read this when you are picking a desktop client for MariaDB, or when one that works with MySQL won&amp;#39;t reach your MariaDB server. MariaDB began as a fork of MySQL, and a lot still carries over: the &lt;a href=&quot;/guide/mysql-gui-client/&quot;&gt;MySQL page&lt;/a&gt; covers accounts as a user and a host, DDL that commits on its own, and metadata locks, and all of that holds here. This page is what MariaDB does differently, and what Seqora does on it.&lt;/p&gt;
&lt;h2 id=&quot;which-mariadb&quot;&gt;Which MariaDB&lt;a class=&quot;guide-anchor&quot; href=&quot;#which-mariadb&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;MariaDB&amp;#39;s long-term releases today are 10.11, 11.4, 11.8 and 12.3, by its &lt;a href=&quot;https://mariadb.org/about/#maintenance-policy&quot; rel=&quot;noopener&quot;&gt;maintenance policy&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. Between them come short-lived rolling releases. Two changes in that range decide whether a client connects at all: TLS on by default from 11.4, and the &lt;code&gt;root&lt;/code&gt; account that signs in through a socket from 10.4.&lt;/p&gt;
&lt;h2 id=&quot;root-signs-in-through-the-socket&quot;&gt;root signs in through the socket&lt;a class=&quot;guide-anchor&quot; href=&quot;#root-signs-in-through-the-socket&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Since 10.4, &lt;code&gt;root@localhost&lt;/code&gt; on Linux signs in with the &lt;code&gt;unix_socket&lt;/code&gt; plugin: the operating system&amp;#39;s &lt;code&gt;root&lt;/code&gt; user gets in without a password, and nobody gets in with one. The &lt;a href=&quot;https://mariadb.com/docs/server/security/user-account-management/authentication-from-mariadb-10-4&quot; rel=&quot;noopener&quot;&gt;authentication docs&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; describe it. &lt;code&gt;sudo mariadb&lt;/code&gt; works, and a GUI that connects over TCP as &lt;code&gt;root&lt;/code&gt; with a password fails.&lt;/p&gt;
&lt;p&gt;Create an account for the client instead, and give it what it needs.&lt;/p&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-key&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;USER&lt;/span&gt; &lt;span class=&quot;tok-string&quot;&gt;&amp;#39;app&amp;#39;&lt;/span&gt;@&lt;span class=&quot;tok-string&quot;&gt;&amp;#39;%&amp;#39;&lt;/span&gt; IDENTIFIED &lt;span class=&quot;tok-key&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;tok-string&quot;&gt;&amp;#39;…&amp;#39;&lt;/span&gt;;
&lt;span class=&quot;tok-key&quot;&gt;GRANT&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;SELECT&lt;/span&gt;, &lt;span class=&quot;tok-key&quot;&gt;INSERT&lt;/span&gt;, &lt;span class=&quot;tok-key&quot;&gt;UPDATE&lt;/span&gt;, &lt;span class=&quot;tok-key&quot;&gt;DELETE&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;ON&lt;/span&gt; commerce.* &lt;span class=&quot;tok-key&quot;&gt;TO&lt;/span&gt; &lt;span class=&quot;tok-string&quot;&gt;&amp;#39;app&amp;#39;&lt;/span&gt;@&lt;span class=&quot;tok-string&quot;&gt;&amp;#39;%&amp;#39;&lt;/span&gt;;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;h2 id=&quot;tls-is-on-from-114&quot;&gt;TLS is on from 11.4&lt;a class=&quot;guide-anchor&quot; href=&quot;#tls-is-on-from-114&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;From 11.4, a server with no certificate configured makes a self-signed one, and the &lt;code&gt;mariadb&lt;/code&gt; command-line client verifies the server by default. It can do that without a CA: it checks the certificate&amp;#39;s fingerprint against a signature derived from your password, which works with the &lt;code&gt;mysql_native_password&lt;/code&gt;, &lt;code&gt;ed25519&lt;/code&gt; and &lt;code&gt;parsec&lt;/code&gt; plugins. The &lt;a href=&quot;https://mariadb.com/docs/server/security/encryption/data-in-transit-encryption/zero-configuration-ssl&quot; rel=&quot;noopener&quot;&gt;zero-configuration SSL page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; explains how.&lt;/p&gt;
&lt;p&gt;That trick belongs to MariaDB&amp;#39;s own clients. A client built on another TLS library sees a self-signed certificate and nothing more, so a mode that checks the certificate fails, and a mode that only encrypts works. For a server across the internet, install a certificate that names the host and check it.&lt;/p&gt;
&lt;h2 id=&quot;sign-in-plugins&quot;&gt;Sign-in plugins&lt;a class=&quot;guide-anchor&quot; href=&quot;#sign-in-plugins&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;MariaDB has sign-in plugins MySQL doesn&amp;#39;t, &lt;code&gt;ed25519&lt;/code&gt; and, from 11.6, &lt;code&gt;parsec&lt;/code&gt;. It didn&amp;#39;t have MySQL&amp;#39;s default, &lt;code&gt;caching_sha2_password&lt;/code&gt;, until a server plugin for it arrived in 11.4.9, 11.8.4 and 12.1, and that plugin isn&amp;#39;t loaded unless you load it, by its &lt;a href=&quot;https://mariadb.com/docs/server/reference/plugins/authentication-plugins/authentication-plugin-caching_sha2_password&quot; rel=&quot;noopener&quot;&gt;plugin page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. Before you pick a client, check which plugin your accounts use: &lt;code&gt;SELECT user, host, plugin FROM mysql.user&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;where-it-differs-from-mysql&quot;&gt;Where it differs from MySQL&lt;a class=&quot;guide-anchor&quot; href=&quot;#where-it-differs-from-mysql&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Plans.&lt;/strong&gt; MariaDB measures a statement with &lt;code&gt;ANALYZE FORMAT=JSON&lt;/code&gt;, which runs it and adds real row counts (&lt;code&gt;r_rows&lt;/code&gt;) and times to each step, by the &lt;a href=&quot;https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/analyze-and-explain-statements/analyze-format-json&quot; rel=&quot;noopener&quot;&gt;ANALYZE FORMAT=JSON page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. There is no tree format, and &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt; is an old spelling of &lt;code&gt;ANALYZE&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Statistics.&lt;/strong&gt; Column statistics are engine-independent, collected with &lt;code&gt;ANALYZE TABLE orders PERSISTENT FOR ALL&lt;/code&gt; and kept in &lt;code&gt;mysql.column_stats&lt;/code&gt;, by the &lt;a href=&quot;https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/query-optimizations/statistics-for-optimizing-queries/engine-independent-table-statistics&quot; rel=&quot;noopener&quot;&gt;statistics page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. MySQL&amp;#39;s &lt;code&gt;UPDATE HISTOGRAM&lt;/code&gt; syntax is not how MariaDB does it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Sequences.&lt;/strong&gt; &lt;code&gt;CREATE SEQUENCE&lt;/code&gt; exists since 10.3, beside &lt;code&gt;AUTO_INCREMENT&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;JSON.&lt;/strong&gt; &lt;code&gt;JSON&lt;/code&gt; is an alias for &lt;code&gt;LONGTEXT&lt;/code&gt; with a &lt;code&gt;JSON_VALID&lt;/code&gt; check, by the &lt;a href=&quot;https://mariadb.com/docs/server/reference/data-types/string-data-types/json&quot; rel=&quot;noopener&quot;&gt;JSON type page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. It is stored as text, where MySQL stores a binary format.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;History.&lt;/strong&gt; Tables declared &lt;code&gt;WITH SYSTEM VERSIONING&lt;/code&gt; keep every old row, and &lt;code&gt;FOR SYSTEM_TIME&lt;/code&gt; reads them, by the &lt;a href=&quot;https://mariadb.com/docs/server/reference/sql-structure/temporal-tables/system-versioned-tables&quot; rel=&quot;noopener&quot;&gt;system-versioned tables page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DDL.&lt;/strong&gt; DDL commits on its own, as in MySQL, and has been atomic per statement since 10.6.1, by the &lt;a href=&quot;https://mariadb.com/docs/server/reference/sql-statements/data-definition/atomic-ddl&quot; rel=&quot;noopener&quot;&gt;atomic DDL page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;what-to-look-for-in-a-client&quot;&gt;What to look for in a client&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-look-for-in-a-client&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;It treats MariaDB as its own engine, with its plan format and its statistics, rather than as MySQL with a different logo.&lt;/li&gt;
&lt;li&gt;It connects to an 11.4 server with TLS on, and says plainly when the certificate wasn&amp;#39;t checked.&lt;/li&gt;
&lt;li&gt;It speaks &lt;code&gt;mysql_native_password&lt;/code&gt;, and &lt;code&gt;caching_sha2_password&lt;/code&gt; for an account moved over from MySQL.&lt;/li&gt;
&lt;li&gt;It tells you a schema change commits as it goes.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;seqora-on-mariadb&quot;&gt;Seqora on MariaDB&lt;a class=&quot;guide-anchor&quot; href=&quot;#seqora-on-mariadb&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;MariaDB is its own choice in the connection dialog, beside MySQL. &lt;a href=&quot;/guide/connect/&quot;&gt;Connect&lt;/a&gt; walks the dialog. These are the parts that answer the sections above.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;TCP and TLS.&lt;/strong&gt; Seqora connects over TCP only, so give it an account with a password, not the socket &lt;code&gt;root&lt;/code&gt;. &lt;code&gt;Prefer&lt;/code&gt; tries TLS first. &lt;code&gt;Require&lt;/code&gt; encrypts without checking, which is what works against 11.4&amp;#39;s self-signed certificate. &lt;code&gt;Verify&lt;/code&gt; checks the certificate and the host name against the certificates your operating system trusts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Import.&lt;/strong&gt; &lt;code&gt;Import connections…&lt;/code&gt; reads &lt;code&gt;~/.my.cnf&lt;/code&gt;, including the &lt;code&gt;[client-mariadb]&lt;/code&gt; and &lt;code&gt;[mariadb-client]&lt;/code&gt; groups, and marks the connection MariaDB when one of those is there. It also reads DBeaver, DataGrip, TablePlus and &lt;code&gt;.env&lt;/code&gt; files.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Plans (Pro).&lt;/strong&gt; The Plan tab reads &lt;code&gt;ANALYZE FORMAT=JSON&lt;/code&gt; for a measured run, and &lt;code&gt;Raw plan JSON&lt;/code&gt; keeps it as MariaDB printed it. Writes are never analyzed.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Sequences.&lt;/strong&gt; MariaDB&amp;#39;s sequences have their own &lt;code&gt;Sequences&lt;/code&gt; folder in the explorer, apart from the &lt;code&gt;AUTO_INCREMENT&lt;/code&gt; counters, and their own pages (Pro).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Statistics.&lt;/strong&gt; The inspector shows no column statistics on MariaDB. &lt;code&gt;Run exact&lt;/code&gt; counts the column instead.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DDL.&lt;/strong&gt; Design mode (Pro) warns that each schema statement commits on its own, and its dry run replays the change on empty copies of the tables in a scratch database.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Workload.&lt;/strong&gt; The session recorder reads &lt;code&gt;performance_schema&lt;/code&gt; statement digests. It needs &lt;code&gt;performance_schema&lt;/code&gt; on, and says so when it is off.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Grid edits, the review, &lt;code&gt;Revert&lt;/code&gt; from the grid, the ER diagram, the database brief and watching a table work as they do on PostgreSQL. The editor refuses the same statements as on MySQL: &lt;code&gt;SET NAMES&lt;/code&gt;, executable comments and a bare &lt;code&gt;DELIMITER&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Not on MariaDB: the lock forecast, undo from the SQL editor, &lt;code&gt;View as role&lt;/code&gt;, &lt;code&gt;Test index&lt;/code&gt;, column statistics and extension pages. The index advisor (Pro) ranks drops and suggests no adds. &lt;a href=&quot;/guide/other-engines/&quot;&gt;MySQL, MariaDB, SQLite and SQL Server&lt;/a&gt; has the full table.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Revert&lt;/code&gt; on MariaDB covers grid edits. A write from the SQL editor can&amp;#39;t be taken back in Seqora.&lt;/li&gt;
&lt;li&gt;Seqora doesn&amp;#39;t sign in with a client certificate. A server whose certificate comes from a private CA passes &lt;code&gt;Verify&lt;/code&gt; only once that CA is trusted by your operating system.&lt;/li&gt;
&lt;li&gt;After an error inside a transaction, the badge reads &lt;code&gt;State unknown&lt;/code&gt; until &lt;code&gt;Rollback&lt;/code&gt; or &lt;code&gt;Refresh transaction&lt;/code&gt; settles it.&lt;/li&gt;
&lt;li&gt;No MariaDB version is certified yet. The target is MariaDB 11.4.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry>
    <title>A SQLite browser</title>
    <link href="https://seqora.dev/guide/sqlite-browser/" />
    <id>https://seqora.dev/guide/sqlite-browser/</id>
    <published>2026-12-03T00:00:00Z</published>
    <updated>2026-12-03T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Open a SQLite file in a desktop client without corrupting it or locking out your app, and know what ALTER TABLE, types and foreign keys do.</summary>
    <content type="html">&lt;p&gt;Read this when you have a &lt;code&gt;.db&lt;/code&gt; or &lt;code&gt;.sqlite&lt;/code&gt; file to look inside, from an app, a phone backup or a test suite, and want a desktop client for it. SQLite has no server to reach, so the hard parts are elsewhere: the file and the files beside it, locks shared with the app that owns it, and a schema that changes in fewer ways than you expect. The first half is SQLite. The second half is what Seqora does with a SQLite file and what it doesn&amp;#39;t.&lt;/p&gt;
&lt;h2 id=&quot;a-database-is-a-file-and-sometimes-three&quot;&gt;A database is a file, and sometimes three&lt;a class=&quot;guide-anchor&quot; href=&quot;#a-database-is-a-file-and-sometimes-three&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A SQLite database is one file that starts with the 16 bytes &lt;code&gt;SQLite format 3&lt;/code&gt;, by the &lt;a href=&quot;https://www.sqlite.org/fileformat.html#magic_header_string&quot; rel=&quot;noopener&quot;&gt;file format page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. The extension means nothing to SQLite. &lt;code&gt;.db&lt;/code&gt;, &lt;code&gt;.sqlite&lt;/code&gt; and &lt;code&gt;.sqlite3&lt;/code&gt; are conventions.&lt;/p&gt;
&lt;p&gt;A database in WAL mode has two more files beside it, &lt;code&gt;-wal&lt;/code&gt; and &lt;code&gt;-shm&lt;/code&gt;. Recent commits can live in the &lt;code&gt;-wal&lt;/code&gt; file until a checkpoint moves them into the main file, so the &lt;a href=&quot;https://www.sqlite.org/wal.html#the_wal_file&quot; rel=&quot;noopener&quot;&gt;WAL page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; says the &lt;code&gt;-wal&lt;/code&gt; file has to travel with the database. Copying only &lt;code&gt;app.db&lt;/code&gt; out of a running app can lose the last writes.&lt;/p&gt;
&lt;p&gt;To copy a database that is in use, use &lt;code&gt;VACUUM INTO &amp;#39;copy.db&amp;#39;&lt;/code&gt; (SQLite 3.27.0 and later), the backup API, or &lt;code&gt;.backup&lt;/code&gt; in the &lt;code&gt;sqlite3&lt;/code&gt; shell. Copying the file during a write can produce a corrupt copy, by &lt;a href=&quot;https://www.sqlite.org/howtocorrupt.html#_backup_or_restore_while_a_transaction_is_active&quot; rel=&quot;noopener&quot;&gt;How to corrupt a database&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Don&amp;#39;t open a database over a network share while something else writes to it. File locking on network filesystems is known to fail, and the &lt;a href=&quot;https://www.sqlite.org/useovernet.html&quot; rel=&quot;noopener&quot;&gt;SQLite team&amp;#39;s page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; recommends a client/server engine for that, or keeping all access on the machine that holds the file. WAL needs shared memory, so it doesn&amp;#39;t work across machines at all.&lt;/p&gt;
&lt;h2 id=&quot;one-writer-at-a-time&quot;&gt;One writer at a time&lt;a class=&quot;guide-anchor&quot; href=&quot;#one-writer-at-a-time&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;SQLite lets many readers in and one writer. A second writer gets &lt;code&gt;SQLITE_BUSY&lt;/code&gt;, which SQLite&amp;#39;s message calls &lt;code&gt;database is locked&lt;/code&gt;, by the &lt;a href=&quot;https://www.sqlite.org/rescode.html#busy&quot; rel=&quot;noopener&quot;&gt;result codes&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. A busy timeout makes a connection wait that many milliseconds for the lock before it gives up. In WAL mode readers and the writer don&amp;#39;t block each other, but there is still only one writer.&lt;/p&gt;
&lt;p&gt;That matters for a GUI. A client that holds a write transaction open on your app&amp;#39;s database locks the app out of writing until the client commits or closes.&lt;/p&gt;
&lt;h2 id=&quot;foreign-keys-are-off-by-default&quot;&gt;Foreign keys are off by default&lt;a class=&quot;guide-anchor&quot; href=&quot;#foreign-keys-are-off-by-default&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;SQLite parses &lt;code&gt;REFERENCES&lt;/code&gt; and doesn&amp;#39;t enforce it until a connection runs &lt;code&gt;PRAGMA foreign_keys = ON&lt;/code&gt;, and the setting lasts only for that connection, by the &lt;a href=&quot;https://www.sqlite.org/foreignkeys.html#fk_enable&quot; rel=&quot;noopener&quot;&gt;foreign key page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. An app that forgot it may have written orphan rows for years. &lt;code&gt;PRAGMA foreign_key_check&lt;/code&gt; lists them, one row per violation.&lt;/p&gt;
&lt;h2 id=&quot;alter-table-does-four-things&quot;&gt;ALTER TABLE does four things&lt;a class=&quot;guide-anchor&quot; href=&quot;#alter-table-does-four-things&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://www.sqlite.org/lang_altertable.html&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;ALTER TABLE&lt;/code&gt;&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; can rename a table, rename a column (3.25.0), add a column and drop a column (3.35.0). An added column can&amp;#39;t be a &lt;code&gt;PRIMARY KEY&lt;/code&gt; or &lt;code&gt;UNIQUE&lt;/code&gt;, and can&amp;#39;t be &lt;code&gt;NOT NULL&lt;/code&gt; without a default.&lt;/p&gt;
&lt;p&gt;Anything else, such as changing a column&amp;#39;s type or adding a constraint, means building a new table. The docs give &lt;a href=&quot;https://www.sqlite.org/lang_altertable.html#otheralter&quot; rel=&quot;noopener&quot;&gt;twelve steps&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;: turn foreign keys off, begin, create the new table, copy the rows, drop the old one, rename the new one, recreate the indexes, triggers and views, run &lt;code&gt;PRAGMA foreign_key_check&lt;/code&gt;, commit, and turn foreign keys back on. The order matters. Renaming the old table first breaks the references to it.&lt;/p&gt;
&lt;h2 id=&quot;types-are-suggestions&quot;&gt;Types are suggestions&lt;a class=&quot;guide-anchor&quot; href=&quot;#types-are-suggestions&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A column&amp;#39;s declared type is a preference. Any column except an &lt;code&gt;INTEGER PRIMARY KEY&lt;/code&gt; can hold a value of any type, by the &lt;a href=&quot;https://www.sqlite.org/datatype3.html#type_affinity&quot; rel=&quot;noopener&quot;&gt;datatypes page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;, so an &lt;code&gt;INTEGER&lt;/code&gt; column can hold &lt;code&gt;&amp;#39;n/a&amp;#39;&lt;/code&gt;. A &lt;code&gt;STRICT&lt;/code&gt; table, from SQLite 3.37.0, refuses a value that doesn&amp;#39;t match its column, by the &lt;a href=&quot;https://www.sqlite.org/stricttables.html&quot; rel=&quot;noopener&quot;&gt;STRICT tables page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. A grid that shows every value of a column as the declared type is hiding something.&lt;/p&gt;
&lt;h2 id=&quot;no-users-no-grants&quot;&gt;No users, no grants&lt;a class=&quot;guide-anchor&quot; href=&quot;#no-users-no-grants&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;SQLite has no users, passwords or &lt;code&gt;GRANT&lt;/code&gt;. The &lt;a href=&quot;https://www.sqlite.org/omitted.html&quot; rel=&quot;noopener&quot;&gt;omitted features page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; says the file&amp;#39;s permissions are the only access control. Whoever can read the file can read every row.&lt;/p&gt;
&lt;h2 id=&quot;plans&quot;&gt;Plans&lt;a class=&quot;guide-anchor&quot; href=&quot;#plans&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;EXPLAIN QUERY PLAN&lt;/code&gt; describes the strategy, which index each step uses and which table it scans, and its output format can change between releases, by the &lt;a href=&quot;https://www.sqlite.org/eqp.html&quot; rel=&quot;noopener&quot;&gt;query plan page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. &lt;code&gt;ANALYZE&lt;/code&gt; stores statistics in &lt;code&gt;sqlite_stat1&lt;/code&gt; for the planner, and the &lt;a href=&quot;https://www.sqlite.org/lang_analyze.html#periodically_run_pragma_optimize_&quot; rel=&quot;noopener&quot;&gt;ANALYZE page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; recommends running &lt;code&gt;PRAGMA optimize&lt;/code&gt; from time to time.&lt;/p&gt;
&lt;h2 id=&quot;what-to-look-for-in-a-client&quot;&gt;What to look for in a client&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-look-for-in-a-client&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;It can open a file read-only, so looking never takes a write lock.&lt;/li&gt;
&lt;li&gt;It turns foreign keys on for its own writes.&lt;/li&gt;
&lt;li&gt;It does the twelve steps for a change &lt;code&gt;ALTER TABLE&lt;/code&gt; can&amp;#39;t make, and keeps the triggers, indexes and &lt;code&gt;CHECK&lt;/code&gt; constraints it rebuilds.&lt;/li&gt;
&lt;li&gt;It shows a value as stored, not as the declared type says it should be.&lt;/li&gt;
&lt;li&gt;It doesn&amp;#39;t create an empty database when you mistype a path.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;seqora-on-sqlite&quot;&gt;Seqora on SQLite&lt;a class=&quot;guide-anchor&quot; href=&quot;#seqora-on-sqlite&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A SQLite connection in Seqora is a &lt;code&gt;Database file&lt;/code&gt;, not a host, and Seqora stores only its path. There is no TLS and no SSH, because there is no server.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Opening.&lt;/strong&gt; Pick the file with &lt;code&gt;Browse…&lt;/code&gt;, double-click a &lt;code&gt;.sqlite&lt;/code&gt; file, drop one on the window, or press &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;O&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;O&lt;/kbd&gt;&lt;/kbd&gt;. A &lt;code&gt;sqlite:&lt;/code&gt; URL, or Prisma&amp;#39;s &lt;code&gt;file:./dev.db&lt;/code&gt;, switches the dialog to SQLite with that file. Seqora opens a file that exists and never creates one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Locked means read-only.&lt;/strong&gt; A locked connection opens the file read-only, with &lt;code&gt;query_only&lt;/code&gt; on. The SQL editor turns &lt;code&gt;foreign_keys&lt;/code&gt; on, and waits up to 250 ms for another writer&amp;#39;s lock.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One file per connection.&lt;/strong&gt; The editor runs against the file&amp;#39;s &lt;code&gt;main&lt;/code&gt; schema. &lt;code&gt;ATTACH&lt;/code&gt; and &lt;code&gt;DETACH&lt;/code&gt; are refused. &lt;code&gt;PRAGMA&lt;/code&gt; runs from an allow-list: the schema-reading ones, such as &lt;code&gt;table_info&lt;/code&gt;, &lt;code&gt;index_list&lt;/code&gt; and &lt;code&gt;foreign_key_check&lt;/code&gt;, are allowed, settings that change the file are not, and &lt;code&gt;foreign_keys&lt;/code&gt; can be set only while the connection is unlocked.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Edits.&lt;/strong&gt; Grid edits wait in &lt;code&gt;Pending changes&lt;/code&gt; for a review and apply in one transaction. A table needs a primary key or a unique index to be edited. &lt;code&gt;Revert&lt;/code&gt; takes a grid write back. See &lt;a href=&quot;/guide/edit-data/&quot;&gt;Edit data&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Schema changes (Pro).&lt;/strong&gt; Design mode on SQLite is the twelve-step rebuild, in one transaction, with foreign key enforcement off during the copy and checked before the commit. The new table is written from the old one&amp;#39;s &lt;code&gt;CREATE&lt;/code&gt; text, so &lt;code&gt;CHECK&lt;/code&gt; constraints, collations, &lt;code&gt;AUTOINCREMENT&lt;/code&gt; and its counter, generated columns, triggers, and partial or expression indexes come across. The dry run runs the same transaction and rolls it back.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Plans (Pro).&lt;/strong&gt; The Plan tab shows &lt;code&gt;EXPLAIN QUERY PLAN&lt;/code&gt;, which has estimates and no timings. On an index&amp;#39;s page, &lt;code&gt;With and without this index&lt;/code&gt; plans the query on an in-memory copy of the schema and statistics, and counts rows visited from &lt;code&gt;sqlite_stat1&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The ER diagram, the database brief and watching a table work as on every engine. &lt;code&gt;Sample coffee shop&lt;/code&gt;, which every install includes, is a SQLite database.&lt;/p&gt;
&lt;p&gt;Not on SQLite, with the reason:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The index advisor. SQLite counts no index usage.&lt;/li&gt;
&lt;li&gt;The session recorder. SQLite keeps no statement statistics.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Access&lt;/code&gt;, routine and partition pages. SQLite has no users, routines or partitions.&lt;/li&gt;
&lt;li&gt;The lock forecast, undo from the SQL editor and &lt;code&gt;View as role&lt;/code&gt;, which are PostgreSQL only.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;/guide/other-engines/&quot;&gt;MySQL, MariaDB, SQLite and SQL Server&lt;/a&gt; has the full table.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Parameters must be bound. A statement with a placeholder in it gets &lt;code&gt;Unbound SQL parameters are not supported. Supply explicit values.&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Revert&lt;/code&gt; on SQLite covers grid edits. A write from the SQL editor can&amp;#39;t be taken back in Seqora.&lt;/li&gt;
&lt;li&gt;No SQLite version is certified yet. Seqora carries its own SQLite library, and the target is 3.51.3.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry>
    <title>A SQL Server client for Mac, Windows and Linux</title>
    <link href="https://seqora.dev/guide/sql-server-client/" />
    <id>https://seqora.dev/guide/sql-server-client/</id>
    <published>2026-12-03T00:00:00Z</published>
    <updated>2026-12-03T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Reach SQL Server from a desktop client on any system: TCP and named instances, SQL logins, encryption that checks, and Windows sign-in.</summary>
    <content type="html">&lt;p&gt;Read this when you need a SQL Server client on a Mac or on Linux, or a lighter one on Windows. SQL Server Management Studio runs only on Windows, by its &lt;a href=&quot;https://learn.microsoft.com/en-us/ssms/system-requirements&quot; rel=&quot;noopener&quot;&gt;system requirements&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;, and Microsoft retired Azure Data Studio, its cross-platform client, on 28 February 2026. The first half of this page is what stands between any client and a SQL Server. The second half is what Seqora does on SQL Server and what it doesn&amp;#39;t. If you are moving off Azure Data Studio, &lt;a href=&quot;/guide/coming-from-azure-data-studio/&quot;&gt;Coming from Azure Data Studio&lt;/a&gt; brings your connections across.&lt;/p&gt;
&lt;h2 id=&quot;reach-the-server&quot;&gt;Reach the server&lt;a class=&quot;guide-anchor&quot; href=&quot;#reach-the-server&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A default instance listens on TCP port 1433. A named instance, such as &lt;code&gt;SQLEXPRESS&lt;/code&gt;, takes a dynamic port, and the SQL Server Browser service answers on UDP port 1434 with the port a client should use, by Microsoft&amp;#39;s &lt;a href=&quot;https://learn.microsoft.com/en-us/sql/sql-server/install/configure-the-windows-firewall-to-allow-sql-server-access&quot; rel=&quot;noopener&quot;&gt;firewall page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. A firewall that lets 1433 through and blocks 1434 breaks &lt;code&gt;host\SQLEXPRESS&lt;/code&gt;. Give the instance&amp;#39;s TCP port instead and the Browser isn&amp;#39;t needed.&lt;/p&gt;
&lt;p&gt;TCP/IP is off on a new Express or Developer install, by the &lt;a href=&quot;https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/default-sql-server-network-protocol-configuration&quot; rel=&quot;noopener&quot;&gt;default protocol table&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. Turn it on in SQL Server Configuration Manager and restart the Database Engine, and the Browser too for a named instance. Until then no client on another machine reaches it over TCP.&lt;/p&gt;
&lt;h2 id=&quot;sql-logins-need-mixed-mode&quot;&gt;SQL logins need mixed mode&lt;a class=&quot;guide-anchor&quot; href=&quot;#sql-logins-need-mixed-mode&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A server set to Windows Authentication mode refuses every SQL login, whatever its password. SQL logins work only in &amp;quot;SQL Server and Windows Authentication mode&amp;quot;, by &lt;a href=&quot;https://learn.microsoft.com/en-us/sql/relational-databases/security/choose-an-authentication-mode&quot; rel=&quot;noopener&quot;&gt;Choose an authentication mode&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. Changing the mode needs a restart. Under Windows mode setup creates &lt;code&gt;sa&lt;/code&gt; disabled, and it stays disabled after a switch to mixed mode until &lt;code&gt;ALTER LOGIN sa ENABLE&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;From a Mac or Linux there is no Windows account to sign in with, so a server in Windows mode is out of reach unless it accepts SQL logins or Microsoft Entra.&lt;/p&gt;
&lt;h2 id=&quot;encryption-is-on-by-default-now&quot;&gt;Encryption is on by default now&lt;a class=&quot;guide-anchor&quot; href=&quot;#encryption-is-on-by-default-now&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Microsoft&amp;#39;s own drivers changed their default: &lt;code&gt;Encrypt&lt;/code&gt; is &lt;code&gt;true&lt;/code&gt; from Microsoft.Data.SqlClient 4.0 and mandatory from ODBC Driver 18, by the &lt;a href=&quot;https://learn.microsoft.com/en-us/sql/connect/odbc/windows/release-notes-odbc-sql-server-windows&quot; rel=&quot;noopener&quot;&gt;ODBC release notes&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. A server that still has the self-signed certificate it made for itself then fails with &amp;quot;The certificate chain was issued by an authority that is not trusted&amp;quot;. The &lt;a href=&quot;https://learn.microsoft.com/en-us/sql/connect/ado-net/sqlclient-troubleshooting-guide&quot; rel=&quot;noopener&quot;&gt;troubleshooting guide&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; gives two ways out: trust the server&amp;#39;s certificate on the client, or set &lt;code&gt;TrustServerCertificate=true&lt;/code&gt;, which encrypts and checks nothing.&lt;/p&gt;
&lt;p&gt;SQL Server 2022 and Azure SQL add TDS 8.0 and &lt;code&gt;Encrypt=Strict&lt;/code&gt;. The TLS handshake comes before any SQL Server traffic, and the certificate has to pass, because &lt;code&gt;TrustServerCertificate&lt;/code&gt; can&amp;#39;t be combined with it, by the &lt;a href=&quot;https://learn.microsoft.com/en-us/sql/relational-databases/security/networking/tds-8&quot; rel=&quot;noopener&quot;&gt;TDS 8.0 page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;windows-and-entra-sign-in&quot;&gt;Windows and Entra sign-in&lt;a class=&quot;guide-anchor&quot; href=&quot;#windows-and-entra-sign-in&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Windows authentication tries Kerberos first and falls back to NTLM, and Kerberos needs a service principal name registered for the instance, by &lt;a href=&quot;https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/register-a-service-principal-name-for-kerberos-connections&quot; rel=&quot;noopener&quot;&gt;Register an SPN&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. A domain that has turned NTLM off accepts only clients that get a Kerberos ticket.&lt;/p&gt;
&lt;p&gt;Azure SQL takes Microsoft Entra ID. A client that signs in with a pasted access token has about an hour: Entra issues access tokens for 60 to 90 minutes by default, by &lt;a href=&quot;https://learn.microsoft.com/en-us/entra/identity-platform/configurable-token-lifetimes&quot; rel=&quot;noopener&quot;&gt;configurable token lifetimes&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;sql-server-on-a-mac&quot;&gt;SQL Server on a Mac&lt;a class=&quot;guide-anchor&quot; href=&quot;#sql-server-on-a-mac&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;There is no SQL Server for macOS. Microsoft&amp;#39;s container image, &lt;code&gt;mcr.microsoft.com/mssql/server&lt;/code&gt;, is supported only on x86-64 Linux hosts, and the &lt;a href=&quot;https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker&quot; rel=&quot;noopener&quot;&gt;Docker quickstart&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; says running it under emulation such as Rosetta 2 is not tested or supported. On an Apple Silicon Mac, the dependable choices are a server on another machine, a Linux x86-64 VM in the cloud, or Azure SQL, with the client on the Mac.&lt;/p&gt;
&lt;h2 id=&quot;scripts-and-go&quot;&gt;Scripts and GO&lt;a class=&quot;guide-anchor&quot; href=&quot;#scripts-and-go&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;GO&lt;/code&gt; is not T-SQL. It is a batch separator that &lt;code&gt;sqlcmd&lt;/code&gt; and SSMS read, and &lt;code&gt;GO 5&lt;/code&gt; runs the batch before it five times, by the &lt;a href=&quot;https://learn.microsoft.com/en-us/sql/t-sql/language-elements/sql-server-utilities-statements-go&quot; rel=&quot;noopener&quot;&gt;GO page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. A client that sends a script with &lt;code&gt;GO&lt;/code&gt; in it to the server unsplit gets a syntax error. Variables last only as long as their batch, so a &lt;code&gt;DECLARE&lt;/code&gt; above a &lt;code&gt;GO&lt;/code&gt; is gone below it.&lt;/p&gt;
&lt;p&gt;On Azure SQL Database each connection is to one database, and &lt;code&gt;USE&lt;/code&gt; can&amp;#39;t switch to another, by the &lt;a href=&quot;https://learn.microsoft.com/en-us/sql/t-sql/language-elements/use-transact-sql&quot; rel=&quot;noopener&quot;&gt;USE page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. Connect to the database you want.&lt;/p&gt;
&lt;h2 id=&quot;which-versions-are-supported&quot;&gt;Which versions are supported&lt;a class=&quot;guide-anchor&quot; href=&quot;#which-versions-are-supported&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;SQL Server 2025 became generally available on 18 November 2025. SQL Server 2016&amp;#39;s extended support ended on 14 July 2026, so the oldest release still getting fixes without a paid extension is SQL Server 2017, until 12 October 2027, by Microsoft&amp;#39;s &lt;a href=&quot;https://learn.microsoft.com/en-us/lifecycle/products/sql-server-2017&quot; rel=&quot;noopener&quot;&gt;lifecycle pages&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;what-to-look-for-in-a-client&quot;&gt;What to look for in a client&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-look-for-in-a-client&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;It runs on your system, and signs in the ways your server allows: a SQL login, Windows, or Entra.&lt;/li&gt;
&lt;li&gt;It finds a named instance through the Browser, and takes a port when the Browser can&amp;#39;t be reached.&lt;/li&gt;
&lt;li&gt;It verifies the certificate when you ask, supports &lt;code&gt;Strict&lt;/code&gt;, and says when a connection is encrypted but not checked.&lt;/li&gt;
&lt;li&gt;It splits a script at &lt;code&gt;GO&lt;/code&gt; the way SSMS does, and shows &lt;code&gt;PRINT&lt;/code&gt; output and every result set.&lt;/li&gt;
&lt;li&gt;It reads the connections you already have, so moving clients doesn&amp;#39;t mean typing them again.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;seqora-on-sql-server&quot;&gt;Seqora on SQL Server&lt;a class=&quot;guide-anchor&quot; href=&quot;#seqora-on-sql-server&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Seqora connects to SQL Server 2016 or later and to Azure SQL Database, on Windows, macOS and Linux. &lt;a href=&quot;/guide/connect/&quot;&gt;Connect&lt;/a&gt; walks the dialog, and &lt;a href=&quot;/guide/other-engines/&quot;&gt;MySQL, MariaDB, SQLite and SQL Server&lt;/a&gt; has the details of the editor and the grid.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Sign-in.&lt;/strong&gt; &lt;code&gt;SQL login&lt;/code&gt; with a password, &lt;code&gt;Entra token&lt;/code&gt;, a Microsoft Entra access token pasted where the password goes and sent only over &lt;code&gt;Verify&lt;/code&gt; or &lt;code&gt;Strict&lt;/code&gt;, or &lt;code&gt;Windows&lt;/code&gt;. &lt;code&gt;Windows&lt;/code&gt; signs in as the account you&amp;#39;re logged in with, works only in Seqora on Windows, and goes through NTLM, so a server that allows only Kerberos refuses it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Instances.&lt;/strong&gt; Type the instance in &lt;code&gt;Instance&lt;/code&gt; or as &lt;code&gt;host\SQLEXPRESS&lt;/code&gt;, and Seqora asks the Browser on UDP 1434 for its port. Through an SSH tunnel the Browser can&amp;#39;t be reached, so give the port.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Encryption.&lt;/strong&gt; &lt;code&gt;Off&lt;/code&gt;, &lt;code&gt;Prefer&lt;/code&gt;, &lt;code&gt;Require&lt;/code&gt;, &lt;code&gt;Verify&lt;/code&gt; and &lt;code&gt;Strict&lt;/code&gt;. &lt;code&gt;Require&lt;/code&gt; is &lt;code&gt;TrustServerCertificate&lt;/code&gt;: encrypted, not checked. &lt;code&gt;Verify&lt;/code&gt; checks the certificate and the host name against the certificates your operating system trusts. &lt;code&gt;Strict&lt;/code&gt; is TDS 8.0, for SQL Server 2022 and Azure SQL.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Connection strings.&lt;/strong&gt; &lt;code&gt;Connection URL&lt;/code&gt; takes &lt;code&gt;sqlserver://&lt;/code&gt; and &lt;code&gt;mssql://&lt;/code&gt; URLs, ADO.NET connection strings and JDBC URLs, and maps &lt;code&gt;Encrypt&lt;/code&gt; and &lt;code&gt;TrustServerCertificate&lt;/code&gt; onto the modes above.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Import.&lt;/strong&gt; &lt;code&gt;Import connections…&lt;/code&gt; reads Azure Data Studio&amp;#39;s saved connections, SSMS&amp;#39;s registered servers on Windows, and DBeaver, DataGrip, TablePlus and &lt;code&gt;.env&lt;/code&gt; files. Saved passwords stay behind, so each connection asks for its password once.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Scripts.&lt;/strong&gt; The editor splits a script into batches at &lt;code&gt;GO&lt;/code&gt; and never sends &lt;code&gt;GO&lt;/code&gt; to the server. &lt;code&gt;GO 5&lt;/code&gt; is refused, because Seqora runs each batch once. A batch with a local &lt;code&gt;@variable&lt;/code&gt; runs whole. &lt;code&gt;PRINT&lt;/code&gt; output and every result set come back. Each editor tab has its own database, and a &lt;code&gt;USE&lt;/code&gt; you run moves the tab.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Locked runs.&lt;/strong&gt; A locked connection runs only what Seqora can tell is a read, inside a transaction it rolls back afterwards, because SQL Server has no read-only session setting.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Edits.&lt;/strong&gt; Grid edits are reviewed as T-SQL and applied in one transaction, which stops if a row changed since it loaded. Identity, computed, &lt;code&gt;rowversion&lt;/code&gt;, period and graph id columns are read-only. &lt;code&gt;Revert&lt;/code&gt; takes a grid write back.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Plans (Pro).&lt;/strong&gt; The Plan tab estimates with &lt;code&gt;SET SHOWPLAN_XML&lt;/code&gt; and measures reads with &lt;code&gt;SET STATISTICS XML&lt;/code&gt;, keeping SQL Server&amp;#39;s own operator names.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Indexes (Pro).&lt;/strong&gt; The index advisor reads the workload from Query Store or the plan cache, ranks indexes to drop, and lists SQL Server&amp;#39;s missing-index suggestions marked untested, because SQL Server can&amp;#39;t cost an index without building it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The value inspector draws &lt;code&gt;geometry&lt;/code&gt; and &lt;code&gt;geography&lt;/code&gt; values as shapes and copies them as WKT or GeoJSON. The ER diagram, the database brief and watching a table work as on every engine.&lt;/p&gt;
&lt;p&gt;Not on SQL Server: the session recorder, because the plan cache evicts statements, the lock forecast, undo from the SQL editor, and &lt;code&gt;View as role&lt;/code&gt;.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Microsoft Entra sign-in works only with a pasted access token. Seqora doesn&amp;#39;t run the interactive or MFA sign-in, and a token expires after about an hour.&lt;/li&gt;
&lt;li&gt;A script stops at its first error, even where SQL Server would carry on with the rest of the batch.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Revert&lt;/code&gt; on SQL Server covers grid edits. A write from the SQL editor can&amp;#39;t be taken back in Seqora.&lt;/li&gt;
&lt;li&gt;Seqora reads and changes data and schemas. Agent jobs, backups, Profiler and database projects stay with SSMS or Visual Studio Code&amp;#39;s MSSQL extension.&lt;/li&gt;
&lt;li&gt;No SQL Server version is certified yet. The target is SQL Server 2022.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry>
    <title>Coming from Azure Data Studio</title>
    <link href="https://seqora.dev/guide/coming-from-azure-data-studio/" />
    <id>https://seqora.dev/guide/coming-from-azure-data-studio/</id>
    <published>2026-12-03T00:00:00Z</published>
    <updated>2026-12-03T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Azure Data Studio is retired. Bring its SQL Server connections into Seqora, find each of its workflows there, and know what to keep SSMS for.</summary>
    <content type="html">&lt;p&gt;Microsoft retired Azure Data Studio on 28 February 2026, and it no longer gets updates or security fixes, by &lt;a href=&quot;https://learn.microsoft.com/en-us/sql/tools/whats-happening-azure-data-studio&quot; rel=&quot;noopener&quot;&gt;Microsoft&amp;#39;s retirement page&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. The &lt;a href=&quot;https://devblogs.microsoft.com/azure-sql/azure-data-studio-retirement/&quot; rel=&quot;noopener&quot;&gt;announcement&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; came a year earlier, on 6 February 2025, and the last release was 1.52, on 18 June 2025. Seqora is a desktop client for SQL Server and Azure SQL Database, and it reads the connections Azure Data Studio saved. This page is the move: the import, where each workflow lives now, and what Seqora leaves to SSMS.&lt;/p&gt;
&lt;h2 id=&quot;bring-your-connections&quot;&gt;Bring your connections&lt;a class=&quot;guide-anchor&quot; href=&quot;#bring-your-connections&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;/#join&quot;&gt;Download Seqora&lt;/a&gt; and start it. Free needs no account.&lt;/li&gt;
&lt;li&gt;Press &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;N&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;N&lt;/kbd&gt;&lt;/kbd&gt;. &lt;code&gt;Connect a database&lt;/code&gt; opens.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Import connections…&lt;/code&gt; at the bottom of the dialog. It is in the command palette too.&lt;/li&gt;
&lt;li&gt;Seqora reads Azure Data Studio&amp;#39;s settings file where Azure Data Studio keeps it, for the stable and the Insiders build, and lists every SQL Server connection it found under &lt;code&gt;Azure Data Studio&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Pick a &lt;code&gt;Save to&lt;/code&gt; workspace and environment, tick the connections, and click &lt;code&gt;Import N connections&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The imported connections start offline and locked. Nothing is uploaded: Seqora reads a file on your computer and writes to its own encrypted store.&lt;/p&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;System&lt;/th&gt;
&lt;th&gt;The file Seqora reads&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;Windows&lt;/td&gt;
&lt;td&gt;&lt;code&gt;%APPDATA%\azuredatastudio\User\settings.json&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;macOS&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/Library/Application Support/azuredatastudio/User/settings.json&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Linux&lt;/td&gt;
&lt;td&gt;&lt;code&gt;~/.config/azuredatastudio/User/settings.json&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;The Insiders build&amp;#39;s folder is &lt;code&gt;azuredatastudio-insiders&lt;/code&gt;. Comments and trailing commas in the file are fine. A connection that is already in Seqora, with the same host, port, database and user, is listed as &lt;code&gt;Already in Seqora as “…”&lt;/code&gt; and left alone.&lt;/p&gt;
&lt;h2 id=&quot;what-comes-across&quot;&gt;What comes across&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-comes-across&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Azure Data Studio saves each connection under &lt;code&gt;datasource.connections&lt;/code&gt; in that file. Seqora reads these keys from it.&lt;/p&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Azure Data Studio&lt;/th&gt;
&lt;th&gt;In Seqora&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;code&gt;connectionName&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The connection&amp;#39;s name. Without one, the name reads like &lt;code&gt;orders on sql-prod.example.com&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;server&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Host&lt;/code&gt;. A &lt;code&gt;tcp:&lt;/code&gt; prefix is dropped, &lt;code&gt;,1444&lt;/code&gt; becomes &lt;code&gt;Port&lt;/code&gt;, and &lt;code&gt;.&lt;/code&gt; or &lt;code&gt;(local)&lt;/code&gt; becomes &lt;code&gt;localhost&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;server&lt;/code&gt; with &lt;code&gt;\SQLEXPRESS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Instance&lt;/code&gt;. Seqora asks the SQL Server Browser for its port.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;database&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Database&lt;/code&gt;, or &lt;code&gt;master&lt;/code&gt; when it was left at the default.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;user&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Username&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;encrypt&lt;/code&gt;, &lt;code&gt;trustServerCertificate&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The TLS mode. &lt;code&gt;Mandatory&lt;/code&gt; or &lt;code&gt;true&lt;/code&gt; is &lt;code&gt;Verify&lt;/code&gt;, or &lt;code&gt;Require&lt;/code&gt; when the certificate is trusted. &lt;code&gt;Strict&lt;/code&gt; stays &lt;code&gt;Strict&lt;/code&gt;, and &lt;code&gt;false&lt;/code&gt; or &lt;code&gt;Optional&lt;/code&gt; is &lt;code&gt;Off&lt;/code&gt;. Without &lt;code&gt;encrypt&lt;/code&gt;, a remote server gets &lt;code&gt;Require&lt;/code&gt; and &lt;code&gt;localhost&lt;/code&gt; gets &lt;code&gt;Prefer&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The server group&lt;/td&gt;
&lt;td&gt;Shown on the row as &lt;code&gt;From Team / Production&lt;/code&gt;. A group with &lt;code&gt;prod&lt;/code&gt; or &lt;code&gt;production&lt;/code&gt; in its name keeps the connection locked.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;Sign-in comes across by type:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;SQL Login.&lt;/strong&gt; Imported as a &lt;code&gt;SQL login&lt;/code&gt; with its user name. Seqora doesn&amp;#39;t read passwords saved in Azure Data Studio, so the row says &lt;code&gt;Enter the password when you first connect&lt;/code&gt;, and Seqora asks once.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Windows Authentication.&lt;/strong&gt; Imported as &lt;code&gt;Windows&lt;/code&gt;, which signs in as the Windows account you&amp;#39;re logged in with and saves no password. It works only in Seqora on Windows, and goes through NTLM, so a server that allows only Kerberos refuses it. Azure SQL doesn&amp;#39;t accept it, so an Azure SQL entry with Windows sign-in isn&amp;#39;t imported.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Microsoft Entra ID&lt;/strong&gt;, with MFA, a password or integrated sign-in. Not imported. The row says &lt;code&gt;Microsoft Entra sign-in can’t be imported.&lt;/code&gt; Add the connection by hand with &lt;code&gt;Entra token&lt;/code&gt;, a Microsoft Entra access token you paste where the password goes, or with a SQL login.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Only SQL Server entries come across. Connections that Azure Data Studio&amp;#39;s PostgreSQL extension saved in the same file are left out. Add those with a &lt;code&gt;postgresql://&lt;/code&gt; URL in the connection dialog. On Windows, &lt;code&gt;Import connections…&lt;/code&gt; also reads SQL Server Management Studio&amp;#39;s registered servers.&lt;/p&gt;
&lt;h2 id=&quot;where-each-workflow-is-now&quot;&gt;Where each workflow is now&lt;a class=&quot;guide-anchor&quot; href=&quot;#where-each-workflow-is-now&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Microsoft&amp;#39;s &lt;a href=&quot;https://learn.microsoft.com/en-us/previous-versions/azure-data-studio/what-is-azure-data-studio&quot; rel=&quot;noopener&quot;&gt;feature list for Azure Data Studio&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; names what it did. This is where each of those lives in Seqora on SQL Server.&lt;/p&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;In Azure Data Studio&lt;/th&gt;
&lt;th&gt;In Seqora&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;Server groups&lt;/td&gt;
&lt;td&gt;Workspaces and environments in the sidebar. &lt;a href=&quot;/guide/connect/&quot;&gt;Connect&lt;/a&gt; has the details.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Object Explorer&lt;/td&gt;
&lt;td&gt;The explorer lists each schema&amp;#39;s tables, views, routines, sequences, synonyms and types, and the database&amp;#39;s DDL triggers.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;New Query&lt;/td&gt;
&lt;td&gt;A SQL editor tab, with completion from the catalog, &lt;code&gt;Begin&lt;/code&gt;, &lt;code&gt;Commit&lt;/code&gt; and &lt;code&gt;Rollback&lt;/code&gt;. &lt;a href=&quot;/guide/sql-editor/&quot;&gt;The SQL editor&lt;/a&gt; walks it.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Results grid&lt;/td&gt;
&lt;td&gt;The result pane. A script returns every result set, numbered, and its &lt;code&gt;PRINT&lt;/code&gt; output.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Edit data&lt;/td&gt;
&lt;td&gt;The data grid. Edits are staged, reviewed as T-SQL and applied in one transaction. See &lt;a href=&quot;/guide/edit-data/&quot;&gt;Edit data&lt;/a&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Show plan&lt;/td&gt;
&lt;td&gt;The Plan tab (Pro), from &lt;code&gt;SET SHOWPLAN_XML&lt;/code&gt; for the estimate and &lt;code&gt;SET STATISTICS XML&lt;/code&gt; for a measured run. See &lt;a href=&quot;/guide/plan-tab/&quot;&gt;The Plan tab&lt;/a&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Chart viewer&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Chart&lt;/code&gt; in the result pane: line, area, bar, scatter, a number or a histogram. See &lt;a href=&quot;/guide/chart-a-query-result/&quot;&gt;Chart a query result&lt;/a&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Export to CSV, JSON, XLSX&lt;/td&gt;
&lt;td&gt;The Export sheet: CSV, TSV, JSON, JSONL, SQL, XLSX, Parquet and Markdown. See &lt;a href=&quot;/guide/export/&quot;&gt;Export&lt;/a&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Server and database dashboards&lt;/td&gt;
&lt;td&gt;The database brief, which opens the first time you connect. See &lt;a href=&quot;/guide/what-is-in-this-database/&quot;&gt;What is in this database?&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Table designer&lt;/td&gt;
&lt;td&gt;Design mode on the ER diagram (Pro), with a review and a dry run before it applies. See &lt;a href=&quot;/guide/design-a-schema-change/&quot;&gt;Design a schema change&lt;/a&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Schema Compare&lt;/td&gt;
&lt;td&gt;Schema compare (Pro), between two connections. See &lt;a href=&quot;/guide/compare-two-schemas/&quot;&gt;Compare two schemas&lt;/a&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Flat file import&lt;/td&gt;
&lt;td&gt;Import (Pro) of CSV, TSV and spreadsheet files into a table. See &lt;a href=&quot;/guide/import/&quot;&gt;Import&lt;/a&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Integrated terminal&lt;/td&gt;
&lt;td&gt;The terminal panel, &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;`&lt;/kbd&gt;&lt;/kbd&gt;. See &lt;a href=&quot;/guide/terminal/&quot;&gt;Terminal&lt;/a&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;Seqora also has what that feature list leaves to SSMS. The ER diagram is Free and exports as PNG, SVG or Mermaid. The value inspector draws &lt;code&gt;geometry&lt;/code&gt; and &lt;code&gt;geography&lt;/code&gt; values as shapes, and copies them as WKT or GeoJSON.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/result-sets.webp?v=0decc49715&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/result-sets-800.webp?v=295991a050&quot; srcset=&quot;/guide/shots/result-sets-800.webp?v=295991a050 800w, /guide/shots/result-sets.webp?v=0decc49715 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;388&quot; alt=&quot;A result pane for a script with three results, with the Result set group numbered 1, 2 and 3, and the first set&amp;#39;s five rows.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;A script with three &lt;code&gt;SELECT&lt;/code&gt; statements returns three result sets, and the group above the grid switches between them.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;your-scripts&quot;&gt;Your scripts&lt;a class=&quot;guide-anchor&quot; href=&quot;#your-scripts&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Open a &lt;code&gt;.sql&lt;/code&gt; file with &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;O&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;O&lt;/kbd&gt;&lt;/kbd&gt;. It saves back to the same path. &lt;a href=&quot;/guide/history-and-sql-files/&quot;&gt;History and SQL files&lt;/a&gt; has the rest.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;GO&lt;/code&gt; on a line of its own separates batches, as in SSMS and sqlcmd, and is never sent to the server. &lt;code&gt;GO 5&lt;/code&gt; is refused, because Seqora runs each batch once: repeat the batch with a &lt;code&gt;WHILE&lt;/code&gt; loop.&lt;/li&gt;
&lt;li&gt;A batch that uses a local &lt;code&gt;@variable&lt;/code&gt;, or creates a procedure, function, trigger or view, runs whole.&lt;/li&gt;
&lt;li&gt;Each editor tab has its own database. Pick it in the tab or run &lt;code&gt;USE&lt;/code&gt;, and the tab follows. Azure SQL Database keeps a connection on the database it opened, so there &lt;code&gt;USE&lt;/code&gt; can&amp;#39;t switch, and Seqora says so.&lt;/li&gt;
&lt;li&gt;A script stops at its first error.&lt;/li&gt;
&lt;li&gt;On a locked connection the editor runs only statements it can tell are reads, inside a transaction it rolls back afterwards. Unlocked, it asks before high-risk statements such as &lt;code&gt;EXEC&lt;/code&gt;, &lt;code&gt;DROP&lt;/code&gt;, &lt;code&gt;TRUNCATE&lt;/code&gt;, or a &lt;code&gt;DELETE&lt;/code&gt; or &lt;code&gt;UPDATE&lt;/code&gt; without a &lt;code&gt;WHERE&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;what-seqora-leaves-to-ssms&quot;&gt;What Seqora leaves to SSMS&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-seqora-leaves-to-ssms&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Seqora is a client for reading, querying, editing and changing a schema. It doesn&amp;#39;t administer the server. Microsoft&amp;#39;s &lt;a href=&quot;https://learn.microsoft.com/en-us/sql/tools/whats-happening-azure-data-studio&quot; rel=&quot;noopener&quot;&gt;replacement table&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; sends these Azure Data Studio extensions to SSMS or to Visual Studio Code with the MSSQL extension, and Seqora doesn&amp;#39;t replace them:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;SQL Server Agent jobs, which Microsoft keeps in SSMS.&lt;/li&gt;
&lt;li&gt;SQL Server Profiler, which becomes the Query Profiler in the MSSQL extension or the XEvent Profiler in SSMS.&lt;/li&gt;
&lt;li&gt;Backup and restore, and DACPAC and BACPAC import and export.&lt;/li&gt;
&lt;li&gt;SQL database projects.&lt;/li&gt;
&lt;li&gt;Notebooks, and Azure Data Studio&amp;#39;s other extensions.&lt;/li&gt;
&lt;/ul&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Seqora reads Azure Data Studio&amp;#39;s settings file only from the folders in the table above. A portable install, or one started with its own data folder, isn&amp;#39;t found.&lt;/li&gt;
&lt;li&gt;An imported connection keeps its user name and TLS mode. Seqora doesn&amp;#39;t read Azure Data Studio&amp;#39;s other connection options, such as the application name or the connection timeout.&lt;/li&gt;
&lt;li&gt;Undo after a write, &lt;code&gt;Revert&lt;/code&gt;, covers grid edits on SQL Server. From the SQL editor it works on PostgreSQL only. The lock forecast and &lt;code&gt;View as role&lt;/code&gt; are PostgreSQL only too, and the session recorder works on PostgreSQL, MySQL and MariaDB but not SQL Server.&lt;/li&gt;
&lt;li&gt;The index advisor on SQL Server ranks the indexes to drop, and lists SQL Server&amp;#39;s own missing-index suggestions marked untested, because SQL Server can&amp;#39;t cost an index without building it.&lt;/li&gt;
&lt;li&gt;Seqora connects to SQL Server 2016 or later and to Azure SQL Database. &lt;a href=&quot;/guide/other-engines/&quot;&gt;MySQL, MariaDB, SQLite and SQL Server&lt;/a&gt; has the rest of what differs on SQL Server.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
&lt;p&gt;&lt;a href=&quot;/blog/seqora-vs-azure-data-studio/&quot;&gt;Seqora vs Azure Data Studio&lt;/a&gt; sets the two side by side, row by row.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>A PostgreSQL GUI for Linux</title>
    <link href="https://seqora.dev/guide/postgresql-gui-for-linux/" />
    <id>https://seqora.dev/guide/postgresql-gui-for-linux/</id>
    <published>2026-12-02T00:00:00Z</published>
    <updated>2026-12-02T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Install Seqora on Ubuntu or Debian from a .deb or an AppImage, then browse, query and edit PostgreSQL with row edits reviewed before they run.</summary>
    <content type="html">&lt;p&gt;Seqora is a desktop PostgreSQL client that runs on Linux as a .deb or an AppImage for x64, on Ubuntu 22.04, Debian 12 and newer. Download one of the two files below and install it with one command. The Free plan needs no account.&lt;/p&gt;
&lt;h2 id=&quot;install-the-deb&quot;&gt;Install the .deb&lt;a class=&quot;guide-anchor&quot; href=&quot;#install-the-deb&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The .deb puts Seqora in your applications menu and in &lt;code&gt;/usr/bin/seqora&lt;/code&gt;.&lt;/p&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#terminal-window&quot; /&gt;&lt;/svg&gt;Shell&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sh&quot;&gt;&lt;code&gt;curl -L -o seqora.deb https://releases.seqora.dev/latest/linux/deb
sudo apt install ./seqora.deb&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The link always leads to the newest release. &lt;code&gt;apt&lt;/code&gt; installs what Seqora needs alongside it, WebKitGTK and GTK among them, if they are missing. Start Seqora from the menu, or type &lt;code&gt;seqora&lt;/code&gt; in a terminal.&lt;/p&gt;
&lt;h2 id=&quot;or-run-the-appimage&quot;&gt;Or run the AppImage&lt;a class=&quot;guide-anchor&quot; href=&quot;#or-run-the-appimage&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The AppImage needs no root and installs nothing outside the file.&lt;/p&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#terminal-window&quot; /&gt;&lt;/svg&gt;Shell&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sh&quot;&gt;&lt;code&gt;curl -L -o Seqora.AppImage https://releases.seqora.dev/latest/linux/appimage
chmod +x Seqora.AppImage
./Seqora.AppImage&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Keep the file in a folder you own, such as &lt;code&gt;~/Applications&lt;/code&gt;. An update replaces the file in place, and it can&amp;#39;t do that in a folder only root can write to.&lt;/p&gt;
&lt;p&gt;Both files are also on the &lt;a href=&quot;/releases/&quot;&gt;releases page&lt;/a&gt;, with the notes for each version.&lt;/p&gt;
&lt;h2 id=&quot;how-updates-work&quot;&gt;How updates work&lt;a class=&quot;guide-anchor&quot; href=&quot;#how-updates-work&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Seqora looks for new releases on its own. The choice is in Settings › General › &lt;code&gt;Updates&lt;/code&gt;, under &lt;code&gt;Automatic updates&lt;/code&gt;: &lt;code&gt;Download and install automatically&lt;/code&gt;, &lt;code&gt;Notify me only&lt;/code&gt; or &lt;code&gt;Off&lt;/code&gt;. About has &lt;code&gt;Check for updates&lt;/code&gt; whichever you pick.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;AppImage.&lt;/strong&gt; Seqora downloads the update and replaces the file. The window you have open keeps the old version until Seqora starts again.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;.deb.&lt;/strong&gt; Installing a package needs your system password, so Seqora asks before it installs, even when the setting says automatic. The password prompt is your desktop&amp;#39;s own.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;the-first-connection&quot;&gt;The first connection&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-first-connection&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The first screen offers &lt;code&gt;Explore the sample&lt;/code&gt;, a bundled database that needs no server, and &lt;code&gt;Add connection&lt;/code&gt;. Paste a &lt;code&gt;postgresql://&lt;/code&gt; URL or fill in the host, port, user and password. &lt;code&gt;Import connections…&lt;/code&gt; reads &lt;code&gt;.pgpass&lt;/code&gt; and &lt;code&gt;pg_service.conf&lt;/code&gt;, and the saved connections of DBeaver, DataGrip and TablePlus. An SSH tunnel can use a host from &lt;code&gt;~/.ssh/config&lt;/code&gt;. &lt;a href=&quot;/guide/connect/&quot;&gt;Connect&lt;/a&gt; has every option.&lt;/p&gt;
&lt;p&gt;Saved passwords are encrypted on your computer, with the key in your system keyring: GNOME Keyring or KWallet. Your connections, files and designs live in &lt;code&gt;~/.local/share/com.seqora.app&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;what-you-can-do-with-postgresql&quot;&gt;What you can do with PostgreSQL&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-you-can-do-with-postgresql&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Everything in this list is on the Free plan until the last item.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Edit rows with a review.&lt;/strong&gt; Every connection opens locked. Unlock it and grid edits wait in &lt;code&gt;Pending changes&lt;/code&gt; until you apply them, after a review with &lt;code&gt;Visual diff&lt;/code&gt; and &lt;code&gt;SQL script&lt;/code&gt;, in one transaction. The SQL editor stops a &lt;code&gt;DELETE&lt;/code&gt; or &lt;code&gt;UPDATE&lt;/code&gt; without a &lt;code&gt;WHERE&lt;/code&gt;, a &lt;code&gt;DROP&lt;/code&gt; or a &lt;code&gt;TRUNCATE&lt;/code&gt; for a review first. See &lt;a href=&quot;/guide/edit-data/&quot;&gt;Edit data&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Take a write back.&lt;/strong&gt; Every write Seqora makes keeps the rows as they were, and &lt;code&gt;Revert&lt;/code&gt; puts them back after checking nothing changed since. Free keeps 24 hours of writes, Pro keeps 30 days.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;See the lock before a migration runs.&lt;/strong&gt; Before DDL runs, the lock forecast shows the lock each statement takes, whether it rewrites the table, the sessions it would wait behind, and a safer form where there is one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Read a database you didn&amp;#39;t design.&lt;/strong&gt; The first time you connect, a database brief opens with the areas of the schema, the biggest tables, joins with no foreign key behind them, and duplicate, redundant and unused indexes. The ER diagram is read-only on Free and exports as PNG, SVG or Mermaid. Schema history records every change on every connection, the last 7 days on Free. See &lt;a href=&quot;/guide/what-is-in-this-database/&quot;&gt;What is in this database?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Watch what your app writes and sends.&lt;/strong&gt; Right-click a table and choose &lt;code&gt;Watch&lt;/code&gt;: new rows slide in and changed cells show beside their old values while the tab is open. The session recorder lists every query pattern your app sends, with exact counts and N+1 queries grouped under their parent. See &lt;a href=&quot;/guide/watch-a-table/&quot;&gt;Watch a table&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Read a slow query (Pro).&lt;/strong&gt; The Plan tab draws the plan as row flow, says where the time went and which estimate was wrong, and plans the query again with a hypothetical index through &lt;code&gt;hypopg&lt;/code&gt; before you build it. Pro also adds schema design on the diagram, schema compare and drift, object pages for indexes, sequences, functions and views, index adds and drops ranked by the time they save, and CSV and Excel import. Start at &lt;a href=&quot;/guide/why-is-this-query-slow/&quot;&gt;Why is this query slow?&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;To read one plan without installing anything, paste it into the &lt;a href=&quot;/explain/&quot;&gt;EXPLAIN visualizer&lt;/a&gt;. The plan never leaves your browser.&lt;/p&gt;
&lt;p&gt;Seqora also connects to &lt;a href=&quot;/guide/mysql-gui-client/&quot;&gt;MySQL&lt;/a&gt;, &lt;a href=&quot;/guide/mariadb-gui-client/&quot;&gt;MariaDB&lt;/a&gt;, &lt;a href=&quot;/guide/sqlite-browser/&quot;&gt;SQLite&lt;/a&gt; and &lt;a href=&quot;/guide/sql-server-client/&quot;&gt;SQL Server&lt;/a&gt;, and agents such as Claude Code and Cursor can read the connections you share through its MCP server, read-only, on Free.&lt;/p&gt;
&lt;h2 id=&quot;limits-on-linux&quot;&gt;Limits on Linux&lt;a class=&quot;guide-anchor&quot; href=&quot;#limits-on-linux&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;x64 only. There is no ARM build yet.&lt;/li&gt;
&lt;li&gt;A .deb and an AppImage only. There is no APT repository, rpm, Snap or Flatpak.&lt;/li&gt;
&lt;li&gt;Saving a password needs a running keyring, such as GNOME Keyring or KWallet. If the keyring is locked when Seqora starts, your desktop asks you to unlock it first.&lt;/li&gt;
&lt;li&gt;In 0.6.3 the desktop&amp;#39;s title bar and Seqora&amp;#39;s own bar are two rows. The next release draws one bar with its own window buttons, and a &lt;code&gt;Use system title bar&lt;/code&gt; setting brings the desktop&amp;#39;s back.&lt;/li&gt;
&lt;li&gt;SQL Server Windows authentication is not available on Linux.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;what-it-costs&quot;&gt;What it costs&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-it-costs&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Free has no tab or window caps, no account and no time limit, and it is fine for paid work. Pro is $99 a year or $9.99 a month. Subscriptions started on or before 31 December 2026 pay $49 a year or $5.99 a month for as long as they renew without a break. One key covers up to three of your own computers, Linux ones included.&lt;/p&gt;
&lt;p&gt;The 14-day Pro trial starts inside the app, from any Pro feature or from Settings, with no card and no email. Starting it needs one connection to seqora.dev, and it is one trial per computer. When Pro ends, Seqora goes back to Free and deletes nothing. The &lt;a href=&quot;/pricing/&quot;&gt;pricing page&lt;/a&gt; has the full list.&lt;/p&gt;
&lt;h2 id=&quot;questions&quot;&gt;Questions&lt;a class=&quot;guide-anchor&quot; href=&quot;#questions&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id=&quot;does-it-need-root&quot;&gt;Does it need root?&lt;/h3&gt;
&lt;p&gt;Only to install the .deb, because &lt;code&gt;apt&lt;/code&gt; installs system-wide, and later to install a .deb update. The AppImage never needs root, and Seqora itself runs as your user.&lt;/p&gt;
&lt;h3 id=&quot;wayland-or-x11&quot;&gt;Wayland or X11?&lt;/h3&gt;
&lt;p&gt;Both. Seqora is built with Tauri on GTK and WebKitGTK, and it has been run on GNOME on Wayland and through GTK&amp;#39;s X11 backend.&lt;/p&gt;
&lt;h3 id=&quot;does-it-update-itself&quot;&gt;Does it update itself?&lt;/h3&gt;
&lt;p&gt;Yes. The AppImage replaces itself. The .deb asks first, then your desktop asks for your password. Either can be set to &lt;code&gt;Notify me only&lt;/code&gt; or &lt;code&gt;Off&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&quot;is-it-open-source&quot;&gt;Is it open source?&lt;/h3&gt;
&lt;p&gt;No. Seqora is closed source. The Free plan costs nothing and needs no account.&lt;/p&gt;
&lt;h3 id=&quot;does-it-run-on-arm&quot;&gt;Does it run on ARM?&lt;/h3&gt;
&lt;p&gt;Not yet. The Linux builds are x64 only.&lt;/p&gt;
&lt;h3 id=&quot;how-does-it-compare-with-pgadmin-dbeaver-or-tableplus&quot;&gt;How does it compare with pgAdmin, DBeaver or TablePlus?&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://www.pgadmin.org/download/&quot; rel=&quot;noopener&quot;&gt;pgAdmin&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;, &lt;a href=&quot;https://dbeaver.io/download/&quot; rel=&quot;noopener&quot;&gt;DBeaver&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;, &lt;a href=&quot;https://www.jetbrains.com/datagrip/download/&quot; rel=&quot;noopener&quot;&gt;DataGrip&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;, &lt;a href=&quot;https://www.beekeeperstudio.io/get&quot; rel=&quot;noopener&quot;&gt;Beekeeper Studio&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; and &lt;a href=&quot;https://tableplus.com/download&quot; rel=&quot;noopener&quot;&gt;TablePlus&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; all have Linux downloads too. I have written up Seqora against three of them, feature by feature: &lt;a href=&quot;/blog/seqora-vs-pgadmin/&quot;&gt;Seqora vs pgAdmin&lt;/a&gt;, &lt;a href=&quot;/blog/seqora-vs-dbeaver/&quot;&gt;Seqora vs DBeaver&lt;/a&gt; and &lt;a href=&quot;/blog/seqora-vs-tableplus/&quot;&gt;Seqora vs TablePlus&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>The Plan tab, and why it looks this way</title>
    <link href="https://seqora.dev/guide/plan-tab/" />
    <id>https://seqora.dev/guide/plan-tab/</id>
    <published>2026-11-13T00:00:00Z</published>
    <updated>2026-11-13T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Every mark the Plan tab draws for EXPLAIN ANALYZE, what it is computed from, and the reason it is drawn that way and not another.</summary>
    <content type="html">&lt;div class=&quot;guide-gate&quot;&gt;
&lt;p&gt;This is the long page about the Plan tab. It goes through every mark the tab draws, the numbers behind each one, and why I drew it that way instead of the usual way. If you have a slow query right now, &lt;a href=&quot;/guide/why-is-this-query-slow/&quot;&gt;Why is this query slow?&lt;/a&gt; reads one plan from the top and is quicker. Come back here when you want to know why a band is that wide.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;what-explain-makes-you-do-by-hand&quot;&gt;What EXPLAIN makes you do by hand&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-explain-makes-you-do-by-hand&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Here are three nodes of the plan for the slow report in &lt;a href=&quot;/guide/why-is-this-query-slow/&quot;&gt;Why is this query slow?&lt;/a&gt;, as PostgreSQL prints them:&lt;/p&gt;
&lt;div class=&quot;guide-code-block guide-plan&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#tree-structure&quot; /&gt;&lt;/svg&gt;Plan&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;guide-plan-line&quot; data-node=&quot;0&quot; data-estimate=&quot;1836&quot; data-rows=&quot;620640&quot; data-loops=&quot;1&quot;&gt;Nested Loop  (cost=0.56..368293.80 rows=1836 width=14) (actual time=0.058..2905.383 rows=620640 loops=1)&lt;/span&gt;
&lt;span class=&quot;guide-plan-line&quot; data-node=&quot;1&quot; data-estimate=&quot;612&quot; data-rows=&quot;206880&quot; data-loops=&quot;1&quot; data-removed=&quot;11793120&quot;&gt;  -&amp;gt;  Seq Scan on orders  (cost=0.00..363000.00 rows=612 width=16) (actual time=0.031..1640.112 rows=206880 loops=1)&lt;/span&gt;
&lt;span class=&quot;guide-plan-line&quot; data-node=&quot;1&quot; data-estimate=&quot;612&quot; data-rows=&quot;206880&quot; data-loops=&quot;1&quot; data-removed=&quot;11793120&quot;&gt;        Filter: ((channel = &amp;#39;web&amp;#39;::text) AND (placed_at &amp;gt;= (now() - &amp;#39;30 days&amp;#39;::interval)))&lt;/span&gt;
&lt;span class=&quot;guide-plan-line&quot; data-node=&quot;1&quot; data-estimate=&quot;612&quot; data-rows=&quot;206880&quot; data-loops=&quot;1&quot; data-removed=&quot;11793120&quot;&gt;        Rows Removed by Filter: 11793120&lt;/span&gt;
&lt;span class=&quot;guide-plan-line&quot; data-node=&quot;2&quot; data-estimate=&quot;3&quot; data-rows=&quot;3&quot; data-loops=&quot;206880&quot;&gt;  -&amp;gt;  Index Scan using order_items_order_idx on order_items oi  (cost=0.56..8.62 rows=3 width=10) (actual time=0.004..0.005 rows=3 loops=206880)&lt;/span&gt;
&lt;span class=&quot;guide-plan-line&quot; data-node=&quot;2&quot; data-estimate=&quot;3&quot; data-rows=&quot;3&quot; data-loops=&quot;206880&quot;&gt;        Index Cond: (order_id = orders.id)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&quot;guide-plan-readout&quot; aria-hidden=&quot;true&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Everything you need is in there. None of it is in the form you need.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;a class=&quot;guide-term&quot; href=&quot;/guide/index-scan/&quot; data-term-icon=&quot;lightning&quot; data-term-description=&quot;How an Index Scan fetches rows, why 206,880 cheap lookups add up, and what the table&amp;#39;s physical order does to each one.&quot;&gt;Index Scan&lt;/a&gt; says &lt;code&gt;rows=3&lt;/code&gt;. It ran 206,880 times, so it returned 620,640 rows. The text prints the per-loop figure and leaves the multiplication to you.&lt;/li&gt;
&lt;li&gt;Its &lt;code&gt;actual time=0.005&lt;/code&gt; is per loop too. 0.005 ms times 206,880 is 1,034 ms, more than a fifth of the query, hidden behind the smallest number on the screen.&lt;/li&gt;
&lt;li&gt;The &lt;a class=&quot;guide-term&quot; href=&quot;/guide/nested-loop/&quot; data-term-icon=&quot;repeat&quot; data-term-description=&quot;The join that runs its inner side once per outer row, why it was right for 612 rows and wrong for 206,880, and the one fix.&quot;&gt;Nested Loop&lt;/a&gt;&amp;#39;s 2,905 ms includes its children. Its own time is 2,905 minus 1,640 minus 1,034, about 231 ms. The text never prints that number.&lt;/li&gt;
&lt;li&gt;The planner expected 612 rows from the scan and got 206,880. Those two numbers sit 40 characters apart on one line, and nothing marks that one is 338 times the other.&lt;/li&gt;
&lt;li&gt;11,793,120 rows were read and thrown away. That is a separate line, below the filter, in the same grey as everything else.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;On a real plan of thirty nodes you do this arithmetic thirty times. The Plan tab does it once and draws the answers. Every part below is one of those answers.&lt;/p&gt;
&lt;h2 id=&quot;where-the-plan-comes-from&quot;&gt;Where the plan comes from&lt;a class=&quot;guide-anchor&quot; href=&quot;#where-the-plan-comes-from&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Run a statement, then click &lt;code&gt;Plan&lt;/code&gt; in the &lt;code&gt;Result&lt;/code&gt;, &lt;code&gt;Chart&lt;/code&gt;, &lt;code&gt;Plan&lt;/code&gt; switch above the rows. The Plan tab is Pro. On Free the button carries the badge and opens the upgrade panel.&lt;/p&gt;
&lt;p&gt;Seqora does not read your run. A run returns rows, and &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt; returns a plan and throws the rows away, so short of &lt;a href=&quot;https://www.postgresql.org/docs/current/auto-explain.html&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;auto_explain&lt;/code&gt;&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; writing plans to the server log, no single statement gives you both. When you open the tab, Seqora plans the statement again, with &lt;a href=&quot;https://www.postgresql.org/docs/current/sql-explain.html&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;EXPLAIN&lt;/code&gt;&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;An estimate first: &lt;code&gt;EXPLAIN (FORMAT JSON, VERBOSE, SETTINGS)&lt;/code&gt;, plus &lt;code&gt;MEMORY&lt;/code&gt; on PostgreSQL 17. It returns in milliseconds and the tab draws the shape of the plan with the planner&amp;#39;s numbers.&lt;/li&gt;
&lt;li&gt;For a read, &lt;code&gt;EXPLAIN (ANALYZE, BUFFERS, …)&lt;/code&gt; follows, with &lt;code&gt;SERIALIZE&lt;/code&gt; on PostgreSQL 17. The bands pulse while it runs, and its numbers replace the estimate when it returns.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;A statement with &lt;code&gt;$1&lt;/code&gt; parameters is planned with &lt;code&gt;GENERIC_PLAN&lt;/code&gt; on PostgreSQL 16 and later, and stops at the estimate with &lt;code&gt;Analyze needs real values in place of parameters like $1.&lt;/code&gt; Before 16 it reads &lt;code&gt;Plans for statements with parameters like $1 need PostgreSQL 16 or later.&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Both run on the editor&amp;#39;s own connection, so the search path, your &lt;code&gt;SET&lt;/code&gt;s and your temporary tables are the ones the run saw. Both run inside &lt;code&gt;BEGIN … ROLLBACK&lt;/code&gt;, or &lt;code&gt;SAVEPOINT … ROLLBACK TO&lt;/code&gt; when the editor already has a transaction open, with &lt;code&gt;SET LOCAL statement_timeout&lt;/code&gt; of 15 seconds for the estimate and 5 minutes for the analyze. If Seqora cannot confirm the rollback, it throws the connection away rather than reuse it.&lt;/p&gt;
&lt;p&gt;This is the report, revenue by country for web orders placed in the last 30 days:&lt;/p&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-key&quot;&gt;WITH&lt;/span&gt; web_orders &lt;span class=&quot;tok-key&quot;&gt;AS&lt;/span&gt; (
  &lt;span class=&quot;tok-key&quot;&gt;SELECT&lt;/span&gt; id, customer_id &lt;span class=&quot;tok-key&quot;&gt;FROM&lt;/span&gt; commerce.orders
  &lt;span class=&quot;tok-key&quot;&gt;WHERE&lt;/span&gt;  channel = &lt;span class=&quot;tok-string&quot;&gt;&amp;#39;web&amp;#39;&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;AND&lt;/span&gt; placed_at &amp;gt;= now() - &lt;span class=&quot;tok-key&quot;&gt;interval&lt;/span&gt; &lt;span class=&quot;tok-string&quot;&gt;&amp;#39;30 days&amp;#39;&lt;/span&gt;
)
&lt;span class=&quot;tok-key&quot;&gt;SELECT&lt;/span&gt; c.country,
       count(*)           &lt;span class=&quot;tok-key&quot;&gt;AS&lt;/span&gt; items,
       sum(oi.line_total) &lt;span class=&quot;tok-key&quot;&gt;AS&lt;/span&gt; revenue,
       rank() &lt;span class=&quot;tok-key&quot;&gt;OVER&lt;/span&gt; (&lt;span class=&quot;tok-key&quot;&gt;ORDER&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;BY&lt;/span&gt; sum(oi.line_total) &lt;span class=&quot;tok-key&quot;&gt;DESC&lt;/span&gt;) &lt;span class=&quot;tok-key&quot;&gt;AS&lt;/span&gt; rank
&lt;span class=&quot;tok-key&quot;&gt;FROM&lt;/span&gt;   web_orders w
&lt;span class=&quot;tok-key&quot;&gt;JOIN&lt;/span&gt;   crm.customers c         &lt;span class=&quot;tok-key&quot;&gt;ON&lt;/span&gt; c.id = w.customer_id
&lt;span class=&quot;tok-key&quot;&gt;JOIN&lt;/span&gt;   commerce.order_items oi &lt;span class=&quot;tok-key&quot;&gt;ON&lt;/span&gt; oi.order_id = w.id
&lt;span class=&quot;tok-key&quot;&gt;GROUP&lt;/span&gt;  &lt;span class=&quot;tok-key&quot;&gt;BY&lt;/span&gt; c.country
&lt;span class=&quot;tok-key&quot;&gt;ORDER&lt;/span&gt;  &lt;span class=&quot;tok-key&quot;&gt;BY&lt;/span&gt; revenue &lt;span class=&quot;tok-key&quot;&gt;DESC&lt;/span&gt;;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;And this is the estimate the tab draws first for it:&lt;/p&gt;
&lt;figure class=&quot;guide-figure&quot;&gt;
&lt;div class=&quot;guide-figure-stage frame&quot; data-island=&quot;plan-flow-estimate&quot;&gt;
&lt;div class=&quot;app-surface&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The row flow of the report from the estimate alone, before EXPLAIN ANALYZE returns. The ≈12M into the scan is the table&amp;#39;s row count from pg_class.reltuples, a statistic rather than a count.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;figcaption&gt;
&lt;p&gt;The row flow of the report from the estimate alone, before &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt; returns. The &lt;code&gt;≈12M&lt;/code&gt; into the scan is the table&amp;#39;s row count from &lt;code&gt;pg_class.reltuples&lt;/code&gt;, a statistic rather than a count.&lt;/p&gt;
&lt;ol class=&quot;guide-legend&quot;&gt;
&lt;li&gt;&lt;code&gt;≈612&lt;/code&gt; is the planner&amp;#39;s count for what leaves the scan. The &lt;code&gt;≈&lt;/code&gt; means nobody has counted yet.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;95% cost&lt;/code&gt; is the scan&amp;#39;s share of the plan&amp;#39;s estimated cost, printed where the self time will be. Even before the run, the estimate points at the scan.&lt;/li&gt;
&lt;/ol&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Writes stop at the estimate. An &lt;code&gt;INSERT&lt;/code&gt;, &lt;code&gt;UPDATE&lt;/code&gt;, &lt;code&gt;DELETE&lt;/code&gt; or &lt;code&gt;MERGE&lt;/code&gt; shows &lt;code&gt;Analyze in rollback&lt;/code&gt;, and so does a &lt;code&gt;SELECT&lt;/code&gt; Seqora cannot prove read-only, such as &lt;code&gt;SELECT … INTO&lt;/code&gt;, one with a data-modifying CTE, or one that calls a function able to write: &lt;code&gt;nextval()&lt;/code&gt;, &lt;code&gt;setval()&lt;/code&gt; and similar built-ins, or any volatile function of your own, since PostgreSQL makes a function volatile unless told otherwise. The dialog then names the function, as in &lt;code&gt;This SELECT calls nextval(), which may change data.&lt;/code&gt; The button &amp;quot;Runs the statement inside BEGIN … ROLLBACK&amp;quot;, and asks &lt;code&gt;Run this statement to analyze it?&lt;/code&gt; first, because sequence values, trigger side effects and anything a function does outside the database are not undone, and the locks it takes are held until it finishes, for up to 5 minutes. On a production connection you type &lt;code&gt;RUN&lt;/code&gt; before &lt;code&gt;Run and roll back&lt;/code&gt;. On a locked connection the button is disabled with &lt;code&gt;The connection is locked read-only&lt;/code&gt;. An analyzed write on PostgreSQL 13 and later also asks for &lt;code&gt;WAL&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Cancel&lt;/code&gt; shows while the analyze runs. Cancelling keeps the estimate on screen, says &lt;code&gt;Analyze cancelled&lt;/code&gt;, and offers &lt;code&gt;Analyze&lt;/code&gt; to try again.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why.&lt;/strong&gt; Nothing runs until you open the tab, because &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt; runs the query again. A report that took 4.6 seconds takes 4.6 seconds again, and I did not want every run to cost two. The estimate goes first so the tab is never a spinner: you see the shape at once and the measured numbers fill in. Writes stop at the estimate because a rollback undoes rows, not everything a statement does, and I would rather you decide that than find out.&lt;/p&gt;
&lt;h2 id=&quot;where-the-time-went&quot;&gt;Where the time went&lt;a class=&quot;guide-anchor&quot; href=&quot;#where-the-time-went&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The first thing in the tab is a strip across the top that splits the run by node. Each segment is one node&amp;#39;s self time: its time minus the time of its inputs. They are ordered children before parents, so each pipeline reads left to right in the order it ran, with &lt;code&gt;Planning&lt;/code&gt; first and &lt;code&gt;JIT&lt;/code&gt;, &lt;code&gt;Triggers&lt;/code&gt; and &lt;code&gt;Serialize&lt;/code&gt; after when PostgreSQL reports them. On an estimate the total reads &lt;code&gt;est. cost&lt;/code&gt; and the segments split the planner&amp;#39;s cost instead.&lt;/p&gt;
&lt;figure class=&quot;guide-figure&quot;&gt;
&lt;div class=&quot;guide-figure-stage frame&quot; data-island=&quot;plan-time-strip&quot;&gt;
&lt;div class=&quot;app-surface&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The time strip of the report.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;figcaption&gt;
&lt;p&gt;The time strip of the report.&lt;/p&gt;
&lt;ol class=&quot;guide-legend&quot;&gt;
&lt;li&gt;&lt;code&gt;orders 36%&lt;/code&gt;: the scan&amp;#39;s 1,640 ms.&lt;/li&gt;
&lt;li&gt;The total, 4.58 s, that every segment is a share of.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Nested Loop 5%&lt;/code&gt;: the inner join&amp;#39;s own 231 ms. The other &lt;code&gt;Nested Loop&lt;/code&gt;, past &lt;code&gt;customers&lt;/code&gt;, is 263 ms more.&lt;/li&gt;
&lt;/ol&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Hover a segment for &lt;code&gt;Self time&lt;/code&gt;, &lt;code&gt;Share&lt;/code&gt;, &lt;code&gt;With inputs&lt;/code&gt;, &lt;code&gt;Rows&lt;/code&gt;, &lt;code&gt;Loops&lt;/code&gt; and &lt;code&gt;Spilled&lt;/code&gt;. On an estimate the first reads &lt;code&gt;Self cost&lt;/code&gt; and the rows &lt;a class=&quot;guide-term&quot; href=&quot;/guide/estimated-rows/&quot; data-term-icon=&quot;target&quot; data-term-description=&quot;The planner&amp;#39;s bet against the receipt, how to find the node where an estimate first goes wrong, and the three ways to correct it.&quot;&gt;&lt;code&gt;Estimated rows&lt;/code&gt;&lt;/a&gt;. Click a segment to select its node.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why.&lt;/strong&gt; Self time adds up. Across the nodes of the tree the segments sum to the root&amp;#39;s time with nothing counted twice, so the widest segment is where the seconds are. Inclusive time, the number the text prints, puts the root at 100% and every node above a slow scan near 100% too. &lt;code&gt;Planning&lt;/code&gt; and &lt;code&gt;Serialize&lt;/code&gt; happen outside the tree and get their own segments. &lt;code&gt;JIT&lt;/code&gt; and &lt;code&gt;Triggers&lt;/code&gt; are less clean: PostgreSQL compiles expressions and fires row triggers partly inside the nodes, so when either appears, the strip adds up to a little more than the run. I kept them because a trigger that takes a second is otherwise one line at the bottom of the text.&lt;/p&gt;
&lt;h2 id=&quot;rows-move-left-to-right&quot;&gt;Rows move left to right&lt;a class=&quot;guide-anchor&quot; href=&quot;#rows-move-left-to-right&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;Flow&lt;/code&gt; lens is the canvas under the strip and the default. Tables enter on the left and the result leaves on the right. Each operator is a short bar, and a band runs from each operator to the one that consumes its rows. A join&amp;#39;s inputs are stacked above each other and meet at the join, which sits halfway between them. A flow bigger than the pane is shrunk to fit, down to 80%, and past that it scrolls, with &lt;code&gt;Show earlier steps&lt;/code&gt; and &lt;code&gt;Show later steps&lt;/code&gt; arrows at the edges. &lt;code&gt;Fit&lt;/code&gt; and &lt;code&gt;100%&lt;/code&gt; in the corner switch between the two sizes.&lt;/p&gt;
&lt;figure class=&quot;guide-figure&quot;&gt;
&lt;div class=&quot;guide-figure-stage frame&quot; data-island=&quot;plan-flow&quot;&gt;
&lt;div class=&quot;app-surface&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The row flow of the analyzed report. The red 1 at the corner of the scan is the app&amp;#39;s own badge for the first finding.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;figcaption&gt;
&lt;p&gt;The row flow of the analyzed report. The red &lt;code&gt;1&lt;/code&gt; at the corner of the scan is the app&amp;#39;s own badge for the first finding.&lt;/p&gt;
&lt;ol class=&quot;guide-legend&quot;&gt;
&lt;li&gt;The band from the &lt;code&gt;orders&lt;/code&gt; wheel into &lt;code&gt;Seq Scan on orders&lt;/code&gt;: the 12,000,000 rows it read.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;207K ┅ 612&lt;/code&gt;: the rows that left the scan, then the planner&amp;#39;s estimate. The two dashed lines inside the band are the width the band would have at 612.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;−11.8M&lt;/code&gt;: the rows the filter read and threw away, draining off below the scan.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;↻ ×207K ┅ ×612&lt;/code&gt;: how many times the &lt;code&gt;order_items&lt;/code&gt; scan ran, against how many the planner budgeted.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;1.64 s&lt;/code&gt;: the scan&amp;#39;s self time, in red because it is a large share of a long run.&lt;/li&gt;
&lt;li&gt;The result end, where the 24 rows leave the plan.&lt;/li&gt;
&lt;/ol&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;Why.&lt;/strong&gt; &lt;code&gt;EXPLAIN&lt;/code&gt; prints the root first and the tables last, indented. To follow the rows you read it from the bottom, inside out. I turned it so you read in the direction the rows move, the way you read a sentence. The tables are where the rows come from, so they line up in one column on the left.&lt;/p&gt;
&lt;h2 id=&quot;a-band-is-as-wide-as-the-rows&quot;&gt;A band is as wide as the rows&lt;a class=&quot;guide-anchor&quot; href=&quot;#a-band-is-as-wide-as-the-rows&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A band&amp;#39;s width is the rows that crossed it, multiplied out over every loop. The scan of &lt;code&gt;order_items&lt;/code&gt; returns 3 rows a loop over 206,880 loops, so its band is drawn at 620,640. You never multiply by hand.&lt;/p&gt;
&lt;p&gt;The scale is the square of the logarithm: &lt;code&gt;1.2 + 0.55 × log10(rows)²&lt;/code&gt; pixels, never under 1.5 and never over 34. Twenty rows draw about 2 pixels wide. 12,000,000 rows draw about 29. The cap is reached around 52 million.&lt;/p&gt;
&lt;p&gt;That is &lt;code&gt;Fixed&lt;/code&gt;, the default for &lt;code&gt;Plan band width&lt;/code&gt; under Settings → Data grid → Query plans. &lt;code&gt;Relative&lt;/code&gt; keeps the same curve and stretches it so the biggest step in each plan is full width. Use it on plans whose biggest step is a few thousand rows, where every band is thin under &lt;code&gt;Fixed&lt;/code&gt;. The cost is that a width means a different count in each plan.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why.&lt;/strong&gt; A linear scale fails at once. 12,000,000 against 24 is half a million to one, so the result band would be invisible. A plain logarithm fails the other way. It puts 12,000,000 rows at 5.4 times the width of 20, so a table scan and a lookup look like cousins. The square of the logarithm puts them at about 14 times. A 20-row band stays visible and a 12-million-row band looks heavy.&lt;/p&gt;
&lt;h2 id=&quot;the-estimate-is-drawn-on-the-band&quot;&gt;The estimate is drawn on the band&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-estimate-is-drawn-on-the-band&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;On an analyzed plan the band is the actual count. The planner&amp;#39;s estimate is drawn on it as two dashed lines, at the width the band would have at the estimate: inside the band when the planner guessed low, outside it when the planner guessed high. The lines appear when actual and estimate differ by more than 2×, on the band where the error starts. A band that only inherited it, because a node below was off the same way and this one adds less than 2× of its own, stays solid. So does the band under a &lt;code&gt;Limit&lt;/code&gt; that stopped reading early, and the inner side of a Nested Loop whose every probe was planned right and only the loop count was wrong. From 10× the label adds the estimate after a &lt;code&gt;┅&lt;/code&gt;, so &lt;code&gt;207K ┅ 612&lt;/code&gt; is 206,880 found against 612 planned.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;↻ ×N&lt;/code&gt; under a band is how many times its node ran, shown when it ran more than once. While the estimates are shown it always adds &lt;code&gt;┅ ×N&lt;/code&gt;, the loops the planner expected. The loop label turns red when the two are 10× apart, whether or not the estimates are shown.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Estimates&lt;/code&gt; in the header turns the dashed lines and the &lt;code&gt;┅&lt;/code&gt; labels off. It is there on analyzed plans only, because on an estimate there is nothing to compare.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why.&lt;/strong&gt; The planner is wrong by 2× all the time and it rarely matters, so below 2× the tab draws nothing. 10× is my line, not PostgreSQL&amp;#39;s. The planner changes its mind wherever the costs cross, but in the plans I have read, a 10× error is where the choice of join starts to be wrong, so the label and the &lt;code&gt;Estimate off&lt;/code&gt; finding both start there. The finding starts at 5× when the planner guessed low and the guess led to a Nested Loop, because a low guess is what picks the loop, and the loop then runs once for every row it did not expect. I drew the estimate on the real band so the gap between them is the thing you see. Two numbers in a row are a comparison you have to make yourself. A wrong row count at a scan makes every node above it wrong too. When all of them were dashed, the drawing pointed at the join while the scan&amp;#39;s filter was the problem, so the dashes now go where the error starts.&lt;/p&gt;
&lt;h2 id=&quot;drains-spills-and-loops&quot;&gt;Drains, spills and loops&lt;a class=&quot;guide-anchor&quot; href=&quot;#drains-spills-and-loops&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A scan that read more than twice what it kept drains the difference off below it, as a red band labelled &lt;code&gt;−N&lt;/code&gt;. The read count is the rows kept, plus &lt;a class=&quot;guide-term&quot; href=&quot;/guide/rows-removed-by-filter/&quot; data-term-icon=&quot;funnel&quot; data-term-description=&quot;The line that counts rows read and then thrown away, what it says under a Seq Scan and an Index Scan, and how to make it zero.&quot;&gt;&lt;code&gt;Rows Removed by Filter&lt;/code&gt;&lt;/a&gt;, plus &lt;code&gt;Rows Removed by Index Recheck&lt;/code&gt;, times loops. &lt;code&gt;Rows Removed by Join Filter&lt;/code&gt; is not counted, because a join filter drops pairs, not rows of a table. On the report the drain is &lt;code&gt;−11.8M&lt;/code&gt;, almost as wide as the band into the scan.&lt;/p&gt;
&lt;p&gt;A node that wrote to disk drips a dashed red line and a small disk below its bar, labelled with the bytes, such as &lt;code&gt;12 MB disk&lt;/code&gt;. The bytes come from the sort&amp;#39;s space on disk, then the node&amp;#39;s disk usage, then temporary blocks written, then for a hash join that split into batches, its peak memory times the extra batches. Spills are only known after a run.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why.&lt;/strong&gt; Thrown-away rows are the most common reason a scan is slow, and in the text they are a separate line in the same grey. As a band they follow the same width rule as the rows that went on, so a scan that keeps 2% is mostly drain. The spill hangs below the node, outside the flow, because those bytes went to disk and not to the parent.&lt;/p&gt;
&lt;h2 id=&quot;bars-colour-and-heat&quot;&gt;Bars, colour and heat&lt;a class=&quot;guide-anchor&quot; href=&quot;#bars-colour-and-heat&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Each operator&amp;#39;s bar is 12 pixels wide and 12 pixels taller than the widest band touching it. Above it is the operator&amp;#39;s name. Below it is its self time, or its share of the cost on an estimate.&lt;/p&gt;
&lt;p&gt;The colour of a bar says what kind of work it is: blue for sequential scans, green for index and bitmap scans, teal for joins, hashes and materializes, pink for aggregates, sorts and window functions, and grey for everything else, such as &lt;code&gt;Limit&lt;/code&gt;, &lt;code&gt;Gather&lt;/code&gt; and &lt;a class=&quot;guide-term&quot; href=&quot;/guide/cte-scan/&quot; data-term-icon=&quot;brackets-round&quot; data-term-description=&quot;When a WITH query is computed once and kept, when it is folded into the main query instead, and why the sample&amp;#39;s web_orders has no node at all.&quot;&gt;&lt;code&gt;CTE Scan&lt;/code&gt;&lt;/a&gt;. A node is hot, and its time is red and bold, when it is more than 25% of the run and took at least 20 ms.&lt;/p&gt;
&lt;p&gt;Some nodes are folded into their parent. A &lt;code&gt;Hash&lt;/code&gt; is drawn as part of its &lt;a class=&quot;guide-term&quot; href=&quot;/guide/hash-join/&quot; data-term-icon=&quot;hash&quot; data-term-description=&quot;The join that reads each side once, what Batches above 1 means, and when to raise work_mem for it.&quot;&gt;&lt;code&gt;Hash Join&lt;/code&gt;&lt;/a&gt;, and a &lt;code&gt;Bitmap Index Scan&lt;/code&gt;, &lt;code&gt;BitmapAnd&lt;/code&gt; or &lt;code&gt;BitmapOr&lt;/code&gt; as part of its &lt;a class=&quot;guide-term&quot; href=&quot;/guide/bitmap-heap-scan/&quot; data-term-icon=&quot;grid-four&quot; data-term-description=&quot;The two-node scan for the middle ground, what a lossy bitmap costs, and how to read the exact and lossy page counts.&quot;&gt;&lt;code&gt;Bitmap Heap Scan&lt;/code&gt;&lt;/a&gt;. Their time, cost and index names are added to the node they belong to.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why.&lt;/strong&gt; I kept colour for the kind of work and put the heat in the time label and the strip. If colour meant heat, a plan with one slow node would be one red bar among grey ones, and you would lose the fact that the red one is a sequential scan. The 20 ms floor is there so a 3 ms query with one node at 80% does not shout. Folding is for the decisions. A &lt;code&gt;Hash&lt;/code&gt; and its &lt;code&gt;Hash Join&lt;/code&gt; are one decision, and drawing them apart doubles the nodes on a big plan for nothing.&lt;/p&gt;
&lt;h2 id=&quot;the-wheel-beside-each-scan&quot;&gt;The wheel beside each scan&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-wheel-beside-each-scan&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Every scan starts from a wheel in the left column. The wheel is the table, not the rows the query returned.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The rim is the table&amp;#39;s pages in physical order, in 40 segments from twelve o&amp;#39;clock, clockwise.&lt;/li&gt;
&lt;li&gt;The radius grows with the logarithm of the page count, from about 14 pixels for a tiny table to 40 at about 5.5 million pages. &lt;code&gt;orders&lt;/code&gt;, at 183,000 pages, is about 33.&lt;/li&gt;
&lt;li&gt;The hub is the index. Its lit arc is the rows the scan returned over the rows in the table, at least a sliver.&lt;/li&gt;
&lt;li&gt;Spokes run from the hub to the pages the index sent the scan to. A bitmap scan keeps the spokes and adds a dashed route along the rim, because it visits its pages once, in page order.&lt;/li&gt;
&lt;li&gt;An arrow sweeping the rim is a full scan: every page, start to end.&lt;/li&gt;
&lt;li&gt;Lit segments are pages that held rows the scan kept. A dashed lit segment is a lossy bitmap page, rechecked row by row.&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class=&quot;guide-figure&quot;&gt;
&lt;div class=&quot;guide-figure-stage frame&quot; data-island=&quot;plan-wheels&quot;&gt;
&lt;div class=&quot;app-surface&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The five ways a scan reaches a table, as wheels.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;figcaption&gt;
&lt;p&gt;The five ways a scan reaches a table, as wheels.&lt;/p&gt;
&lt;ol class=&quot;guide-legend&quot;&gt;
&lt;li&gt;&lt;code&gt;Seq Scan&lt;/code&gt;: the whole rim is read and the arrow sweeps it. The blue holds the rows kept.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Index Scan · in order&lt;/code&gt;: one short arc of rim, because the rows are stored in the index&amp;#39;s order.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Index Scan · scattered&lt;/code&gt;: spokes fan out across the rim. Each row costs a random read.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Index Only Scan&lt;/code&gt;: the hub answers and the rim stays dark, apart from heap fetches.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Bitmap Heap Scan&lt;/code&gt;: the pages are collected first, then read once each, in order. Two of them are dashed: lossy, rechecked row by row.&lt;/li&gt;
&lt;/ol&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The lit pages are a drawing from statistics, not a map of the pages PostgreSQL read. Where they sit comes from &lt;a href=&quot;https://www.postgresql.org/docs/current/view-pg-stats.html&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;pg_stats.correlation&lt;/code&gt;&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;, the planner&amp;#39;s own measure of how closely a column follows the physical order of the table. A sequential scan is placed by the best-ordered column it filters on. An index scan uses the index&amp;#39;s leading column. With a correlation of 0.8 or more the kept pages of a sequential scan are drawn as one stretch, and below it they are spread out.&lt;/p&gt;
&lt;p&gt;How many pages an index scan touches borrows the shape of PostgreSQL&amp;#39;s cost model: correlation squared decides where the count sits between the pages a perfectly clustered fetch would touch and the pages a fully scattered one would. PostgreSQL interpolates its I/O cost the same way. An analyzed bitmap scan needs no estimate, because PostgreSQL reports its exact and lossy pages.&lt;/p&gt;
&lt;p&gt;Hover a part and the rest of the wheel dims, with a card beside the wheel that names the part and prints its numbers. Double-click a wheel, or press &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt; on it, for the wheel guide, titled &lt;code&gt;Table wheel&lt;/code&gt;.&lt;/p&gt;
&lt;figure class=&quot;guide-figure&quot;&gt;
&lt;div class=&quot;guide-figure-stage frame&quot; data-island=&quot;plan-wheel&quot;&gt;
&lt;div class=&quot;app-surface&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The wheel guide for orders, with its own labels, top to bottom.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;figcaption&gt;
&lt;p&gt;The wheel guide for &lt;code&gt;orders&lt;/code&gt;, with its own labels, top to bottom.&lt;/p&gt;
&lt;ol class=&quot;guide-legend&quot;&gt;
&lt;li&gt;&lt;code&gt;Blue · rows kept&lt;/code&gt; is the one page of rim at twelve o&amp;#39;clock that stands for the 206,880 kept rows, &lt;code&gt;2% of rows read&lt;/code&gt;. It is one stretch because &lt;code&gt;placed_at&lt;/code&gt; follows the order rows were written.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Rim · the table&lt;/code&gt; is every page of &lt;code&gt;orders&lt;/code&gt;, &lt;code&gt;183K pages · 1.4 GB&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Arrow · full scan&lt;/code&gt; means every page was read to find that stretch.&lt;/li&gt;
&lt;/ol&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;Why.&lt;/strong&gt; The text plan never tells you how big the table is or where the rows are in it. With how many rows the query wants, those are the facts that decide whether an index will help. My first version drew each table as a vertical strip of pages with its size written next to it. It was a column of numbers again. A ring puts the index inside the table, so a lookup is a spoke from one to the other, and a scan that reads everything is an arrow all the way round. Size is the radius on a log scale, and that is a deliberately weak signal: &lt;code&gt;orders&lt;/code&gt; has 28 times the pages of &lt;code&gt;customers&lt;/code&gt; and draws a quarter wider. The radius says which tables are big. The guide says how big. The card goes beside the wheel, not on top of it, so the part it describes stays visible.&lt;/p&gt;
&lt;h2 id=&quot;the-time-map&quot;&gt;The time map&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-time-map&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;Time map&lt;/code&gt; in &lt;code&gt;Plan lens&lt;/code&gt; swaps the flow for an icicle: the root across the top at full width, its inputs in the row below, and so on down. A cell&amp;#39;s width is the node&amp;#39;s time including its inputs, or its cost on an estimate. Its colour is the node&amp;#39;s kind, stronger the more self time it has.&lt;/p&gt;
&lt;figure class=&quot;guide-figure&quot;&gt;
&lt;div class=&quot;guide-figure-stage frame&quot; data-island=&quot;plan-time-map&quot;&gt;
&lt;div class=&quot;app-surface&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The Time map of the report.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;figcaption&gt;
&lt;p&gt;The &lt;code&gt;Time map&lt;/code&gt; of the report.&lt;/p&gt;
&lt;ol class=&quot;guide-legend&quot;&gt;
&lt;li&gt;The root, across the full width: the whole 4.58 s.&lt;/li&gt;
&lt;li&gt;The outer &lt;code&gt;Nested Loop&lt;/code&gt;, nearly as wide, because almost all the time is below it.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Seq Scan · orders&lt;/code&gt;, whose time is all its own, so its colour is the strongest.&lt;/li&gt;
&lt;/ol&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;Why.&lt;/strong&gt; The strip answers &amp;quot;which node&amp;quot;. The map answers &amp;quot;which part of the query&amp;quot;. A CTE or a subquery is one block of the map, so you can see what share of the run it is before you look inside it. The lenses use the same numbers. Your choice of lens and of &lt;code&gt;Estimates&lt;/code&gt; stays with the SQL tab across runs, and resets when Seqora restarts.&lt;/p&gt;
&lt;h2 id=&quot;every-step-in-a-table&quot;&gt;Every step in a table&lt;a class=&quot;guide-anchor&quot; href=&quot;#every-step-in-a-table&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;Steps&lt;/code&gt;, the third lens, is the plan as rows: &lt;code&gt;#&lt;/code&gt;, &lt;code&gt;Step&lt;/code&gt;, &lt;code&gt;Relation&lt;/code&gt;, &lt;code&gt;Self time&lt;/code&gt;, &lt;code&gt;Share&lt;/code&gt;, &lt;code&gt;Rows planned&lt;/code&gt; and &lt;code&gt;Rows returned&lt;/code&gt;. On an estimate the time column is &lt;code&gt;Self cost&lt;/code&gt; and there is no &lt;code&gt;Rows returned&lt;/code&gt;. &lt;code&gt;Step table&lt;/code&gt; at the right end of the time strip opens the same lens, and a second click goes back to the flow. Rows start in plan order, indented like the tree. Click a heading to sort by it, biggest first for numbers. A step with a finding carries a warning mark. Selecting a row selects the node everywhere else, and the other way round.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why.&lt;/strong&gt; The strip cuts the labels of short steps, and a big flow is shrunk to fit. A table reads every step in full at the size of the text around it, and sorting by &lt;code&gt;Self time&lt;/code&gt; or &lt;code&gt;Rows returned&lt;/code&gt; is a comparison the drawing cannot make for you. The rows planned and returned are both totals across loops, the same numbers the bands are drawn at.&lt;/p&gt;
&lt;h2 id=&quot;the-inspector&quot;&gt;The inspector&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-inspector&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The inspector beside the canvas shows the selected node. When a plan arrives, the node with the most self time is selected, so it starts on the slow one. Click any node to change it. It draws the node&amp;#39;s numbers as bars and rulers.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Rows&lt;/code&gt; is read against kept for a scan that filtered, in against out for a node with inputs, and &lt;code&gt;Estimated rows&lt;/code&gt; on an estimate.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Rows per loop&lt;/code&gt; puts actual and estimated rows on one log ruler with ticks at 1, 1e3, 1e6 and 1e9. It says &lt;code&gt;on target&lt;/code&gt;, or the factor more or fewer, such as &lt;code&gt;338× more&lt;/code&gt;, once they are 10× apart. Under a &lt;code&gt;Limit&lt;/code&gt; that stopped reading once it had enough rows, fewer than planned reads &lt;code&gt;stopped early&lt;/code&gt; instead, because nobody asked for the rest.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Loops&lt;/code&gt; is a second ruler, shown only when the node ran more than once.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Pages&lt;/code&gt; is reads from cache, disk and temporary files, with &lt;code&gt;all cached&lt;/code&gt; or the share &lt;code&gt;from disk&lt;/code&gt;. It needs &lt;code&gt;BUFFERS&lt;/code&gt;, which the analyze always asks for.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Memory&lt;/code&gt; appears when the node spilled: what it used, against a mark at &lt;code&gt;work_mem&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Indexes · &amp;lt;table&amp;gt;&lt;/code&gt; lists every index on the table against the columns the node filters on.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each index carries one tag:&lt;/p&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tag&lt;/th&gt;
&lt;th&gt;When&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;code&gt;✓ used&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The plan used it.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;invalid&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The index is not valid, so the planner cannot use it.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;not chosen&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Its leading column is one the node filters on, and the planner chose something else.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;partial · not chosen&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The same, on a partial index.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;not leading&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;It contains a filtered column, but not first.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;partial&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A partial index with no filtered column.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;a dash&lt;/td&gt;
&lt;td&gt;None of the above.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;The list ends with the &lt;code&gt;suggested&lt;/code&gt; index when a &lt;a class=&quot;guide-term&quot; href=&quot;/guide/seq-scan/&quot; data-term-icon=&quot;list-dashes&quot; data-term-description=&quot;What a Seq Scan reads, the kept-to-read ratio that tells you it is the problem, and the index that replaces it.&quot;&gt;&lt;code&gt;Seq Scan&lt;/code&gt;&lt;/a&gt; finding proposes one. &lt;code&gt;Test index&lt;/code&gt; plans the statement again with a hypothetical index from &lt;a href=&quot;https://hypopg.readthedocs.io/&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;hypopg&lt;/code&gt;&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; and prints the plan&amp;#39;s cost before and after. It never builds the index. After a test, &lt;code&gt;Workload impact&lt;/code&gt; opens the index advisor to check the index against other queries, which &lt;a href=&quot;/guide/which-indexes-are-missing/&quot;&gt;Which indexes are missing?&lt;/a&gt; covers. &lt;a href=&quot;/guide/will-this-index-help/&quot;&gt;Will this index help?&lt;/a&gt; reads the answer.&lt;/p&gt;
&lt;p&gt;Under the list, &lt;code&gt;heap order&lt;/code&gt; sketches how one column sits in the table, with its correlation: the used index&amp;#39;s leading column, or else the first column the node filters on. That can be a different column from the one the wheel is placed by. Below that are the node&amp;#39;s conditions as PostgreSQL printed them: &lt;code&gt;Filter&lt;/code&gt;, &lt;code&gt;Index Cond&lt;/code&gt; and the rest.&lt;/p&gt;
&lt;figure class=&quot;guide-figure&quot;&gt;
&lt;div class=&quot;guide-figure-stage frame&quot; data-island=&quot;plan-inspector&quot;&gt;
&lt;div class=&quot;app-surface&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The inspector for Seq Scan on orders.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;figcaption&gt;
&lt;p&gt;The inspector for &lt;code&gt;Seq Scan on orders&lt;/code&gt;.&lt;/p&gt;
&lt;ol class=&quot;guide-legend&quot;&gt;
&lt;li&gt;&lt;code&gt;Rows&lt;/code&gt;: 12,000,000 read against 206,880 kept.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Rows per loop&lt;/code&gt;: 206,880 found against 612 planned, &lt;code&gt;338× more&lt;/code&gt;. There is no &lt;code&gt;Loops&lt;/code&gt; ruler because the scan ran once.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Pages&lt;/code&gt;: cache against disk, &lt;code&gt;99% from disk&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Indexes · orders&lt;/code&gt;: three indexes. The two that contain &lt;code&gt;placed_at&lt;/code&gt; are both &lt;code&gt;not leading&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;suggested&lt;/code&gt; index on &lt;code&gt;channel, placed_at&lt;/code&gt;, with &lt;code&gt;Test index&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;On this scan &lt;code&gt;heap order&lt;/code&gt; reads &lt;code&gt;channel 0.02&lt;/code&gt;: &lt;code&gt;channel&lt;/code&gt; is scattered through the table, while the wheel above is placed by &lt;code&gt;placed_at&lt;/code&gt; at 0.99. Both are true. The suggested index on &lt;code&gt;channel, placed_at&lt;/code&gt; reads only the web orders of the last 30 days, and because rows were written in &lt;code&gt;placed_at&lt;/code&gt; order, they sit in the recent stretch of the table, mixed in with the other channels.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why.&lt;/strong&gt; Every number in the inspector is a ratio someone has to compute: kept over read, found over planned, disk over cache, used over &lt;code&gt;work_mem&lt;/code&gt;. A ruler shows the ratio as a distance, and a log ruler makes 10× look like 10× whether the counts are tens or millions. The index list exists because &amp;quot;why didn&amp;#39;t it use my index?&amp;quot; is the question I asked most, and the answer is often the column order. The planner does not seek a B-tree by its second column. PostgreSQL 18&amp;#39;s skip scan can, when the leading column has few distinct values. &lt;code&gt;not leading&lt;/code&gt; says that in two words.&lt;/p&gt;
&lt;h2 id=&quot;findings&quot;&gt;Findings&lt;a class=&quot;guide-anchor&quot; href=&quot;#findings&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Seqora reads the analyzed plan for five patterns and lists what it finds under the canvas, three at a time, with &lt;code&gt;N more&lt;/code&gt; for the rest.&lt;/p&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Finding&lt;/th&gt;
&lt;th&gt;Fires when&lt;/th&gt;
&lt;th&gt;Action&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Seq Scan on &amp;lt;table&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A sequential scan read at least 10,000 rows and kept 20% or less.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Test index&lt;/code&gt; on PostgreSQL, &lt;code&gt;Copy CREATE INDEX&lt;/code&gt; elsewhere&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Estimate off N×&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Rows per loop are 10× off the estimate or more, on at least 100 rows. 5× is enough when the guess was low and led to a Nested Loop.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Copy ANALYZE &amp;lt;table&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;node&amp;gt; spilled to disk&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A node wrote to disk.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Retry · &amp;lt;work_mem&amp;gt;&lt;/code&gt; on PostgreSQL reads&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Bitmap went lossy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A bitmap scan ran out of &lt;code&gt;work_mem&lt;/code&gt; and rechecked whole pages.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Retry · &amp;lt;work_mem&amp;gt;&lt;/code&gt; on PostgreSQL reads&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Fewer workers launched&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A parallel node got fewer workers than it planned for.&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;SQL Server adds its own two. &lt;code&gt;Missing index on &amp;lt;table&amp;gt;&lt;/code&gt; is the index its optimizer said it wanted, with the saving it estimated and &lt;code&gt;Copy CREATE INDEX&lt;/code&gt;. A warning SQL Server put on an operator becomes a finding titled with the warning. On SQL Server &lt;code&gt;Estimate off&lt;/code&gt; copies &lt;code&gt;UPDATE STATISTICS&lt;/code&gt; instead of &lt;code&gt;ANALYZE&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The suggested index puts the columns the scan compares with &lt;code&gt;=&lt;/code&gt; first, then the other filter columns, three at most, and is only offered when no index already starts with them. On MySQL, MariaDB and SQLite, &lt;code&gt;Copy CREATE INDEX&lt;/code&gt; copies a &lt;code&gt;CREATE INDEX&lt;/code&gt; named from the table and columns. &lt;code&gt;Estimate off&lt;/code&gt; fires only on the node where the error starts, not on every node above it that inherited the wrong number, never on a node a &lt;code&gt;Limit&lt;/code&gt; cut short, and it says when the table was last analyzed. A low guess ranks above a high one by the same factor, and the title adds &lt;code&gt;· Nested Loop&lt;/code&gt; when the low guess led to one. &lt;code&gt;Retry · &amp;lt;work_mem&amp;gt;&lt;/code&gt; runs the analyze again with a larger &lt;code&gt;work_mem&lt;/code&gt; for that one capture and shows the time before and after. Each finding shows one button, its first action, so on PostgreSQL the &lt;code&gt;Seq Scan&lt;/code&gt; finding offers &lt;code&gt;Test index&lt;/code&gt; and the &lt;code&gt;CREATE INDEX&lt;/code&gt; is yours to write. Before the analyze returns the list says &lt;code&gt;Findings need Analyze&lt;/code&gt;. With nothing to say it says &lt;code&gt;No findings&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The top three findings put a numbered badge on their node in the flow. A node with two findings shows one badge, the number of its strongest, so on the report the scan shows &lt;code&gt;1&lt;/code&gt; while the list shows &lt;code&gt;1&lt;/code&gt; and &lt;code&gt;2&lt;/code&gt;.&lt;/p&gt;
&lt;figure class=&quot;guide-figure&quot;&gt;
&lt;div class=&quot;guide-figure-stage frame&quot; data-island=&quot;plan-findings&quot;&gt;
&lt;div class=&quot;app-surface&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The findings for the report, both on Seq Scan on orders.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;figcaption&gt;
&lt;p&gt;The findings for the report, both on &lt;code&gt;Seq Scan on orders&lt;/code&gt;.&lt;/p&gt;
&lt;ol class=&quot;guide-legend&quot;&gt;
&lt;li&gt;&lt;code&gt;Seq Scan on orders&lt;/code&gt;, &lt;code&gt;keeps 2% · 36% of time&lt;/code&gt;, with &lt;code&gt;Test index&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Estimate off 338× · Nested Loop&lt;/code&gt;, with &lt;code&gt;Copy ANALYZE orders&lt;/code&gt;. Its detail, cut short at this width, is &lt;code&gt;more rows than planned · 207K vs 612 · analyzed 41 days ago&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;Why.&lt;/strong&gt; The findings are rules, written in code, with the thresholds above. There is no model guessing. The same plan gives the same findings every time, and when one is wrong you can see which rule fired. Five rules is a short list on purpose. Four of them come with a fix you can copy or run. The fifth, fewer workers, is there because a plan that asked for four workers and got one is slow for a reason no index fixes.&lt;/p&gt;
&lt;h2 id=&quot;the-plan-in-the-editor&quot;&gt;The plan in the editor&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-plan-in-the-editor&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;While the Plan tab is open, the SQL in the editor carries the plan too. A bar in the gutter on each line shows how much time came from that part of the SQL, against the heaviest line, red where it is hot. A note at the end of the line names the operator, then rows read and kept for a scan that filtered or &lt;code&gt;×N&lt;/code&gt; for a node that ran many times, then the estimate error, any spill and the time. A line with several nodes shows the strongest note and &lt;code&gt;+N&lt;/code&gt; for the rest. Click &lt;code&gt;+N&lt;/code&gt; to show them all. Click a bar or a note to select that node, and select a node to light its lines.&lt;/p&gt;
&lt;p&gt;A scan maps to its table&amp;#39;s name, and to &lt;code&gt;WHERE&lt;/code&gt; when it filtered. A join maps to the table it brings in, an aggregate to &lt;code&gt;GROUP BY&lt;/code&gt;, a sort to &lt;code&gt;ORDER BY&lt;/code&gt;, a limit to &lt;code&gt;LIMIT&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Edit the SQL and the plan no longer describes it. The tab fades, stops taking clicks, and reads &lt;code&gt;SQL changed&lt;/code&gt; with the time the plan was captured, and the editor&amp;#39;s notes go away. The plan belongs to the SQL you ran. Run the statement again to plan the new text. &lt;code&gt;Capture the plan again&lt;/code&gt; re-plans what ran.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why.&lt;/strong&gt; A plan is about SQL you wrote, and the hardest part of reading one is finding which line a node came from. The fade is there because a plan of the old SQL, drawn at full strength next to the new SQL, is a lie with good typography.&lt;/p&gt;
&lt;h2 id=&quot;the-rest-of-the-header&quot;&gt;The rest of the header&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-rest-of-the-header&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt; with the execution and planning times, such as &lt;code&gt;4.58 s exec · 2.4 ms plan&lt;/code&gt;, then the settings the plan ran with: &lt;code&gt;work_mem&lt;/code&gt;, and every setting &lt;code&gt;EXPLAIN (SETTINGS)&lt;/code&gt; reports as changed from the default. When they fit they sit on the line. When they don&amp;#39;t, a button such as &lt;code&gt;2 settings&lt;/code&gt; opens the list. A plan that differs from the one your application gets usually differs here. &lt;code&gt;EXPLAIN&lt;/code&gt; with &lt;code&gt;estimates&lt;/code&gt; on an estimate, or &lt;code&gt;generic plan · estimates&lt;/code&gt; for a statement with parameters.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Plan lens&lt;/code&gt;: &lt;code&gt;Flow&lt;/code&gt;, &lt;code&gt;Time map&lt;/code&gt; and &lt;code&gt;Steps&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Raw plan JSON&lt;/code&gt; opens the plan exactly as the engine returned it, with &lt;code&gt;Copy&lt;/code&gt;. Its title names what produced it, such as &lt;code&gt;Raw plan · EXPLAIN ANALYZE JSON&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Capture the plan again&lt;/code&gt; re-plans and re-analyzes the statement that ran.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Maximize results&lt;/code&gt;, beside the switch, gives the result pane the editor&amp;#39;s space too. &lt;code&gt;Restore editor&lt;/code&gt; brings the editor back.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Before a run the tab reads &lt;code&gt;No plan yet&lt;/code&gt;. After a failed run it reads &lt;code&gt;No plan captured&lt;/code&gt;, after a cancelled one &lt;code&gt;Run cancelled&lt;/code&gt;, each with &lt;code&gt;Capture estimate&lt;/code&gt;, which plans the statement without running it. When the capture itself fails, the tab reads &lt;code&gt;No plan for this statement&lt;/code&gt; with its error and &lt;code&gt;Try again&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;keyboard&quot;&gt;Keyboard&lt;a class=&quot;guide-anchor&quot; href=&quot;#keyboard&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The operators are a tree with one tab stop, the selected node, and each wheel is a tab stop of its own. &lt;code&gt;←&lt;/code&gt; moves to the selected node&amp;#39;s first input, &lt;code&gt;→&lt;/code&gt; to its parent, &lt;code&gt;↑&lt;/code&gt; and &lt;code&gt;↓&lt;/code&gt; to its siblings. &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Space&lt;/kbd&gt;&lt;/kbd&gt; on a wheel opens its guide and &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Esc&lt;/kbd&gt;&lt;/kbd&gt; closes it. In &lt;code&gt;Steps&lt;/code&gt;, &lt;code&gt;↑&lt;/code&gt; and &lt;code&gt;↓&lt;/code&gt; move between rows, &lt;code&gt;Home&lt;/code&gt; and &lt;code&gt;End&lt;/code&gt; go to the first and last. The moving thread on the selected node&amp;#39;s band stops when your system asks for reduced motion.&lt;/p&gt;
&lt;h2 id=&quot;per-engine&quot;&gt;Per engine&lt;a class=&quot;guide-anchor&quot; href=&quot;#per-engine&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Plans from MySQL, MariaDB and SQLite are translated into PostgreSQL&amp;#39;s node names, so a full scan reads &lt;code&gt;Seq Scan&lt;/code&gt; everywhere. &lt;code&gt;Raw plan JSON&lt;/code&gt; keeps each engine&amp;#39;s own output.&lt;/p&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Engine&lt;/th&gt;
&lt;th&gt;What the Plan tab gets&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;PostgreSQL&lt;/td&gt;
&lt;td&gt;Everything on this page. &lt;code&gt;Test index&lt;/code&gt; needs &lt;code&gt;hypopg&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MySQL&lt;/td&gt;
&lt;td&gt;&lt;code&gt;EXPLAIN FORMAT=TREE&lt;/code&gt; and &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt; (8.0.18 or later). Reads only are analyzed. No &lt;code&gt;heap order&lt;/code&gt;, no &lt;code&gt;Test index&lt;/code&gt;, no &lt;code&gt;work_mem&lt;/code&gt; retry.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MariaDB&lt;/td&gt;
&lt;td&gt;&lt;code&gt;EXPLAIN FORMAT=JSON&lt;/code&gt; and &lt;code&gt;ANALYZE FORMAT=JSON&lt;/code&gt;. Reads only are analyzed. Same gaps as MySQL.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SQLite&lt;/td&gt;
&lt;td&gt;&lt;code&gt;EXPLAIN QUERY PLAN&lt;/code&gt;, estimates only, so no timings and no findings.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SQL Server&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SET SHOWPLAN_XML&lt;/code&gt; for the estimate and &lt;code&gt;SET STATISTICS XML&lt;/code&gt; for a measured run. Reads only are analyzed. No &lt;code&gt;Test index&lt;/code&gt;, no &lt;code&gt;work_mem&lt;/code&gt; retry.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;MySQL and MariaDB never analyze a write, because a MyISAM write cannot be rolled back and some statements commit on their own. A &lt;code&gt;SELECT&lt;/code&gt; there that calls a stored function stops at the estimate too, since nothing proves the function writes nothing. &lt;code&gt;Analyze&lt;/code&gt; asks first and says the changes stay, with &lt;code&gt;Run it&lt;/code&gt; in place of &lt;code&gt;Run and roll back&lt;/code&gt;. Neither has &lt;code&gt;pg_stats.correlation&lt;/code&gt;, so their wheels spread the lit pages evenly: Seqora cannot know whether the rows sit together.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt; runs the query. Opening the tab on a 4.6-second read costs 4.6 more seconds of the server&amp;#39;s time.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Analyze in rollback&lt;/code&gt; undoes rows. It does not undo sequence values, the side effects of triggers or functions that call out, or the locks the statement holds while it runs.&lt;/li&gt;
&lt;li&gt;PostgreSQL prints per-loop times to three decimals. A node that ran 206,880 times at &lt;code&gt;0.005&lt;/code&gt; ms could have taken anywhere from 931 to 1,138 ms, and the self time of its parent carries the same 100 ms of doubt. The tab inherits that rounding. It cannot undo it.&lt;/li&gt;
&lt;li&gt;Self time is worked out from inclusive times, corrected for loops, parallel workers and CTE scans. On a plan with parallel workers the per-node times are averages across processes, as PostgreSQL reports them.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Test index&lt;/code&gt; compares the planner&amp;#39;s cost, not time. &lt;code&gt;hypopg&lt;/code&gt; estimates the index&amp;#39;s size, and the planner takes its correlation from the column&amp;#39;s own statistics, so the cost is a guess built on real statistics about an index that does not exist yet.&lt;/li&gt;
&lt;li&gt;Clause mapping in the editor covers the outermost &lt;code&gt;SELECT&lt;/code&gt;. Tables and joins inside CTEs still map.&lt;/li&gt;
&lt;li&gt;The figures on this page come from a 12-million-row copy of the commerce sample.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;The first version of this, in August, was a ledger: every node as a row of numbers, nicer than the text, and still the text. I deleted it. The rule I set for the second one was that the drawing explains the plan by itself, with no sentences in it. Every mark has to be a number you would otherwise compute by hand, and the mark has to show the number&amp;#39;s size, not print it. Where I could not find a drawing for a number, it stays a number, in the inspector. The plan JSON is always one click away, because the drawing should never be the only way to check what PostgreSQL said.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
</content>
  </entry>
  <entry>
    <title>Will this index help?</title>
    <link href="https://seqora.dev/guide/will-this-index-help/" />
    <id>https://seqora.dev/guide/will-this-index-help/</id>
    <published>2026-11-13T00:00:00Z</published>
    <updated>2026-11-13T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Test an index on a 12-million-row table before you build it, read the cost it reports, and know what a hypothetical index cannot tell you.</summary>
    <content type="html">&lt;div class=&quot;guide-gate&quot;&gt;
&lt;p&gt;You need this page when you are about to add an index to a big table and want to know whether it changes the plan before you pay for it in disk, write cost and build time. It also answers the opposite question, whether an index you already have can go. If the table is small enough to index in a second, build it and look at the plan. If you don&amp;#39;t know which index to try yet, &lt;a href=&quot;/guide/which-indexes-are-missing/&quot;&gt;Which indexes are missing?&lt;/a&gt; starts from your whole workload instead of one query.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;the-symptom&quot;&gt;The symptom&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-symptom&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;/guide/why-is-this-query-slow/&quot;&gt;Why is this query slow?&lt;/a&gt; ended with &lt;code&gt;ANALYZE commerce.orders&lt;/code&gt;. After it the planner sees about 206,880 web orders instead of 612, drops the Nested Loops for Hash Joins, and still reads &lt;code&gt;commerce.orders&lt;/code&gt; with a &lt;a class=&quot;guide-term&quot; href=&quot;/guide/seq-scan/&quot; data-term-icon=&quot;list-dashes&quot; data-term-description=&quot;What a Seq Scan reads, the kept-to-read ratio that tells you it is the problem, and the index that replaces it.&quot;&gt;Seq Scan&lt;/a&gt;, 12,000,000 rows for 206,880 kept, because nothing on the table starts with &lt;code&gt;channel&lt;/code&gt;. The suggested fix is an index on &lt;code&gt;(channel, placed_at DESC)&lt;/code&gt;, on a table that is 1.5 GB of heap.&lt;/p&gt;
&lt;h2 id=&quot;two-places-to-find-out-without-building-anything&quot;&gt;Two places to find out without building anything&lt;a class=&quot;guide-anchor&quot; href=&quot;#two-places-to-find-out-without-building-anything&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Both use &lt;code&gt;hypopg&lt;/code&gt;, a PostgreSQL extension that lets the planner see an index that does not exist, or stop seeing one that does, for your session only. Nothing is written and the query is not run.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The Plan tab.&lt;/strong&gt; Open the plan, click the &lt;code&gt;Seq Scan on orders&lt;/code&gt; node, and find &lt;code&gt;suggested&lt;/code&gt; at the bottom of &lt;code&gt;Indexes · orders&lt;/code&gt;, with the columns &lt;code&gt;channel, placed_at&lt;/code&gt; and a &lt;code&gt;Test index&lt;/code&gt; button. The &lt;code&gt;Seq Scan on orders&lt;/code&gt; finding under the canvas has the same button.&lt;/p&gt;
&lt;figure class=&quot;guide-figure&quot;&gt;
&lt;div class=&quot;guide-figure-stage frame&quot; data-island=&quot;plan-inspector&quot;&gt;
&lt;div class=&quot;app-surface&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The inspector for Seq Scan on orders, before Test index is clicked.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;figcaption&gt;
&lt;p&gt;The inspector for &lt;code&gt;Seq Scan on orders&lt;/code&gt;, before &lt;code&gt;Test index&lt;/code&gt; is clicked.&lt;/p&gt;
&lt;ol class=&quot;guide-legend&quot;&gt;
&lt;li&gt;&lt;code&gt;Rows&lt;/code&gt; is the problem the index is for: 12,000,000 read, 206,880 kept, &lt;code&gt;2% kept&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Rows per loop&lt;/code&gt; is &lt;code&gt;338× more&lt;/code&gt; than planned. Run &lt;code&gt;ANALYZE&lt;/code&gt; before you test, or the planner prices the index for 612 rows.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Pages&lt;/code&gt; is &lt;code&gt;99% from disk&lt;/code&gt;, 183,000 pages for one scan. The index would touch the pages the kept rows are on and leave the rest.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Indexes · orders&lt;/code&gt; shows why none of the three existing indexes was used: &lt;code&gt;not leading&lt;/code&gt; on the two that contain &lt;code&gt;placed_at&lt;/code&gt;, because neither starts with &lt;code&gt;channel&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;suggested&lt;/code&gt; is the index the finding proposes, &lt;code&gt;channel, placed_at&lt;/code&gt;, and &lt;code&gt;Test index&lt;/code&gt; is the button this page is about. Click it and the result prints on this line.&lt;/li&gt;
&lt;/ol&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Seqora creates the hypothetical index, plans the same statement again with estimates only, and prints the result on the &lt;code&gt;suggested&lt;/code&gt; line: &lt;code&gt;Index Scan · cost 383,580 → 22,993&lt;/code&gt;. The first word is what the scan of &lt;code&gt;orders&lt;/code&gt; would become. The two numbers are the cost of the whole plan before and after. The scan itself goes from 363,000 to 2,412.88, and the 20,000 that remains is the joins and the aggregate, which the index does not touch. The line is highlighted when the new cost is under 90% of the old. The button reads &lt;code&gt;Testing…&lt;/code&gt; while it plans. Seqora calls &lt;code&gt;hypopg_reset()&lt;/code&gt; once the plan is back, so the hypothetical index is not left behind in your session.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Workload impact&lt;/code&gt;, beside the result, opens the index advisor with this index added, to check it against the rest of the workload instead of one query. &lt;a href=&quot;/guide/which-indexes-are-missing/&quot;&gt;Which indexes are missing?&lt;/a&gt; reads that screen.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The Index page.&lt;/strong&gt; Open any index from the explorer (Pro). The section &lt;code&gt;With and without this index&lt;/code&gt; takes a query, picked with &lt;code&gt;Compare&lt;/code&gt; beside one of &lt;code&gt;Queries it can answer&lt;/code&gt; or typed into &lt;code&gt;Query&lt;/code&gt;. &lt;code&gt;Compare&lt;/code&gt; plans it twice, once as things are and once with this index hidden from the planner. The two plans sit side by side as &lt;code&gt;With this index&lt;/code&gt; and &lt;code&gt;Without it&lt;/code&gt;, under a headline that says how much cheaper the planner expects it to be with it, or &lt;code&gt;The planner expects it to be cheaper without it&lt;/code&gt;, or &lt;code&gt;About the same either way&lt;/code&gt;, or &lt;code&gt;PostgreSQL doesn&amp;#39;t use this index for this query&lt;/code&gt; when the plan with it ignores it. That last one is the headline you want before dropping an index.&lt;/p&gt;
&lt;div class=&quot;guide-island objects-stage&quot; data-island=&quot;object-index&quot;&gt;
&lt;div class=&quot;app-window&quot; data-platform=&quot;macos&quot;&gt;
&lt;div class=&quot;app-window-bar&quot; aria-hidden=&quot;true&quot;&gt;
&lt;span class=&quot;app-window-lights&quot;&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span class=&quot;app-window-title&quot;&gt;Seqora&lt;/span&gt;
&lt;span class=&quot;app-window-controls&quot;&gt;
&lt;svg viewBox=&quot;0 0 10 10&quot;&gt;&lt;path d=&quot;M0 5h10&quot; /&gt;&lt;/svg&gt;
&lt;svg viewBox=&quot;0 0 10 10&quot;&gt;&lt;path d=&quot;M.5.5h9v9h-9z&quot; /&gt;&lt;/svg&gt;
&lt;svg viewBox=&quot;0 0 10 10&quot;&gt;&lt;path d=&quot;M0 0l10 10M10 0L0 10&quot; /&gt;&lt;/svg&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div class=&quot;app-surface&quot; data-page=&quot;index&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The Index page for an index on the commerce sample, with the sections Key, Queries it can answer, With and without this index, and Where the space goes.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;I made both checks plan against an index that isn&amp;#39;t there because building the real one is the expensive part of the experiment: minutes on 12,000,000 rows, writes blocked without &lt;code&gt;CONCURRENTLY&lt;/code&gt;, and a drop afterwards if it was wrong. &lt;code&gt;hypopg&lt;/code&gt; keeps the index in the session&amp;#39;s memory, so nothing in the database changes. The price is that both sides are estimates. &lt;code&gt;hypopg&lt;/code&gt; hides an index from &lt;code&gt;EXPLAIN&lt;/code&gt; but not from &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt;, and a real timing without the index would mean dropping it, which locks the table.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
&lt;h2 id=&quot;what-a-cost-is&quot;&gt;What a cost is&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-a-cost-is&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A cost is the planner&amp;#39;s own estimate of work, in units where reading one page in sequence is 1. It is not milliseconds, and two servers with different settings give different costs for the same plan. A cost is only useful next to another cost for the same query on the same server.&lt;/p&gt;
&lt;p&gt;Read the size of the change, not the number. 363,000 to 2,412.88 is a drop of 150×. That is a different plan shape, a read of the whole table replaced by a walk down an index into a slice of it, and you will feel it. A drop from 363,000 to 340,000 is the same shape with a slightly different guess, and you will not. The estimate also depends on the statistics, which is why this page starts after &lt;code&gt;ANALYZE&lt;/code&gt;. Test an index against stale statistics and you get a confident answer to the wrong question.&lt;/p&gt;
&lt;h2 id=&quot;what-the-test-cannot-tell-you&quot;&gt;What the test cannot tell you&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-the-test-cannot-tell-you&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The write cost.&lt;/strong&gt; Every row inserted into &lt;code&gt;orders&lt;/code&gt; is also written to every index on it, and now to one more. Updates that change &lt;code&gt;channel&lt;/code&gt; or &lt;code&gt;placed_at&lt;/code&gt; pay too. The Index page&amp;#39;s &lt;code&gt;Where the space goes&lt;/code&gt; section shows this as &lt;code&gt;Each write pays for it&lt;/code&gt;, with one square per index the row lands in.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The size.&lt;/strong&gt; A hypothetical index takes no space on disk, and &lt;code&gt;Test index&lt;/code&gt; prints no size for it. The real one on &lt;code&gt;(channel, placed_at DESC)&lt;/code&gt; has the same shape as &lt;code&gt;orders_status_placed_idx&lt;/code&gt; on &lt;code&gt;(status, placed_at DESC)&lt;/code&gt;, which is 179 MB, so expect about that. &lt;code&gt;orders&lt;/code&gt; is 1.5 GB of heap and 2.3 GB with its three indexes today.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The build.&lt;/strong&gt; &lt;code&gt;CREATE INDEX&lt;/code&gt; on 12,000,000 rows takes minutes and, without &lt;code&gt;CONCURRENTLY&lt;/code&gt;, blocks writes to the table while it runs. With &lt;code&gt;CONCURRENTLY&lt;/code&gt; it takes longer and blocks nothing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Whether the server has &lt;code&gt;hypopg&lt;/code&gt;.&lt;/strong&gt; If it is not installed, &lt;code&gt;Test index&lt;/code&gt; prints &lt;code&gt;Install the hypopg extension to test an index without building it.&lt;/code&gt; in place of the result, and the Index page&amp;#39;s compare section offers &lt;code&gt;Open CREATE EXTENSION in a SQL editor&lt;/code&gt; instead of &lt;code&gt;Compare&lt;/code&gt;. Hiding an existing index uses &lt;code&gt;hypopg_hide_index&lt;/code&gt;, which arrived in &lt;code&gt;hypopg&lt;/code&gt; 1.4. An older &lt;code&gt;hypopg&lt;/code&gt; gets &lt;code&gt;Open ALTER EXTENSION in a SQL editor&lt;/code&gt; instead. Installing an extension usually needs a superuser.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;what-to-do&quot;&gt;What to do&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-do&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Test it in the Plan tab, read the cost as a shape change, then build it with &lt;code&gt;CONCURRENTLY&lt;/code&gt; at a quiet time:&lt;/p&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-key&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;INDEX&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;CONCURRENTLY&lt;/span&gt; orders_channel_placed_idx
  &lt;span class=&quot;tok-key&quot;&gt;ON&lt;/span&gt; commerce.orders (channel, placed_at &lt;span class=&quot;tok-key&quot;&gt;DESC&lt;/span&gt;);&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Seqora runs that straight away. Without &lt;code&gt;CONCURRENTLY&lt;/code&gt; the SQL editor stops it at &lt;code&gt;Review high-risk SQL&lt;/code&gt; first, because a plain &lt;code&gt;CREATE INDEX&lt;/code&gt; blocks writes to the table until it is built. Capture the plan again after the build. If the &lt;a class=&quot;guide-term&quot; href=&quot;/guide/index-scan/&quot; data-term-icon=&quot;lightning&quot; data-term-description=&quot;How an Index Scan fetches rows, why 206,880 cheap lookups add up, and what the table&amp;#39;s physical order does to each one.&quot;&gt;Index Scan&lt;/a&gt; is there and the &lt;code&gt;Seq Scan on orders&lt;/code&gt; finding is gone, you are done. What the index costs the table once it exists is in &lt;a href=&quot;/guide/reading-the-stats/&quot;&gt;Reading the stats&lt;/a&gt;.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Test index&lt;/code&gt; and the &lt;code&gt;work_mem&lt;/code&gt; actions in the Plan tab are PostgreSQL only.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;With and without this index&lt;/code&gt; needs no extension on MySQL and MariaDB, which plan the &lt;code&gt;Without it&lt;/code&gt; side with &lt;code&gt;IGNORE INDEX&lt;/code&gt; on the statement, or on SQLite, which plans it on an in-memory copy of the schema with the index dropped. SQLite plans have no costs, so the numbers there are rows visited, from &lt;code&gt;sqlite_stat1&lt;/code&gt;. SQL Server has no compare yet. &lt;a href=&quot;/guide/other-engines/&quot;&gt;MySQL, MariaDB, SQLite and SQL Server&lt;/a&gt; has the table.&lt;/li&gt;
&lt;li&gt;Both sides of every comparison are estimates. The query is not run, so a cost that changes is a change in the planner&amp;#39;s opinion.&lt;/li&gt;
&lt;li&gt;The costs above come from a 12-million-row copy of the sample. A smaller copy gives smaller costs with the same ratio.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry>
    <title>Which indexes are missing?</title>
    <link href="https://seqora.dev/guide/which-indexes-are-missing/" />
    <id>https://seqora.dev/guide/which-indexes-are-missing/</id>
    <published>2026-11-13T00:00:00Z</published>
    <updated>2026-11-13T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Rank the indexes your recorded workload is missing and the ones it never uses, test a set together, and build one without blocking writes.</summary>
    <content type="html">&lt;div class=&quot;guide-gate&quot;&gt;
&lt;p&gt;Open the index advisor when the database as a whole is slow and no one query owns the problem, or when a table carries indexes nobody can explain. It reads what the server has already run and ranks indexes to add and to drop. For one slow query, &lt;a href=&quot;/guide/will-this-index-help/&quot;&gt;Will this index help?&lt;/a&gt; is quicker. For one index in question, read &lt;a href=&quot;/guide/what-an-index-page-tells-you/&quot;&gt;What an index page tells you&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;the-symptom&quot;&gt;The symptom&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-symptom&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The web-orders report from &lt;a href=&quot;/guide/why-is-this-query-slow/&quot;&gt;Why is this query slow?&lt;/a&gt; takes 4,581 ms and reads all 12,000,000 rows of &lt;code&gt;commerce.orders&lt;/code&gt;. &lt;code&gt;billing.invoices&lt;/code&gt; spends 656 MB of its 2.3 GB on indexes, and &lt;code&gt;invoices_customer_id_idx&lt;/code&gt; has not been scanned since the statistics reset. The question is which change saves the most time across everything the server runs, and what it costs the writes.&lt;/p&gt;
&lt;h2 id=&quot;where-the-suggestions-come-from&quot;&gt;Where the suggestions come from&lt;a class=&quot;guide-anchor&quot; href=&quot;#where-the-suggestions-come-from&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Right-click a PostgreSQL connection in the sidebar and choose &lt;code&gt;Index advisor&lt;/code&gt;, or run &lt;code&gt;Index advisor: &amp;lt;connection&amp;gt;&lt;/code&gt; from the command palette. &lt;code&gt;Advise this table&lt;/code&gt; on a table&amp;#39;s indexes page opens it filtered to that table. &lt;code&gt;Workload impact&lt;/code&gt; beside a Plan tab &lt;code&gt;Test index&lt;/code&gt; result brings that index along as a row tagged &lt;code&gt;plan&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The tab runs when it opens and again on &lt;code&gt;Refresh&lt;/code&gt;, on a read-only session of its own. It reads the top 50 statements of the current database in &lt;a href=&quot;https://www.postgresql.org/docs/current/pgstatstatements.html&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;pg_stat_statements&lt;/code&gt;&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; by total time, skipping catalog reads and Seqora&amp;#39;s own queries, and every index with its scans since the statistics reset.&lt;/p&gt;
&lt;p&gt;From each statement it takes the columns compared with &lt;code&gt;=&lt;/code&gt;, joined on, compared as a range and sorted on. A candidate puts the equality columns first, then one range or sort column, three keys at most. Seqora plans each statement with &lt;code&gt;EXPLAIN&lt;/code&gt;, creates the candidate as a &lt;a href=&quot;https://github.com/HypoPG/hypopg&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;hypopg&lt;/code&gt;&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; hypothetical index, and plans again. Statements with &lt;code&gt;$1&lt;/code&gt; in them plan as &lt;code&gt;GENERIC_PLAN&lt;/code&gt; on PostgreSQL 16 and later, and with values sampled from &lt;code&gt;pg_stats&lt;/code&gt; before that. Nothing runs and nothing is built.&lt;/p&gt;
&lt;p&gt;The estimate is the recorded mean time scaled by the change in plan cost. A 4,581 ms statement whose cost falls by 90% is estimated at about 458 ms. Every predicted number carries &lt;code&gt;est.&lt;/code&gt; for that reason.&lt;/p&gt;
&lt;p&gt;An add is listed when it cuts some statement by 10%, saves at least 0.5% of all recorded time, and slows no statement by more than 10%. A three-key index must beat its two-key prefix by another 10%. At most five adds are listed, two per table. A run stops at 30 seconds or 200 candidates and says &lt;code&gt;partial · time budget&lt;/code&gt; or &lt;code&gt;partial · candidate cap&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;the-ranked-list&quot;&gt;The ranked list&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-ranked-list&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/advisor-list.webp?v=5cea6a01e2&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/advisor-list-800.webp?v=60b998dfac&quot; srcset=&quot;/guide/shots/advisor-list-800.webp?v=60b998dfac 800w, /guide/shots/advisor-list.webp?v=5cea6a01e2 2000w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(1000px, 46rem)&quot; width=&quot;1000&quot; height=&quot;563&quot; alt=&quot;The Index advisor tab: source chips in the toolbar, the workload strip, ranked add and drop rows, and the detail pane for the first row.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;The strip reads recorded time now and with every ranked change. The pane lists the statements the selected row changes.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The toolbar names the sources: &lt;code&gt;pg_stat_statements · since reset&lt;/code&gt; with the days, the &lt;code&gt;hypopg&lt;/code&gt; version, and &lt;code&gt;primary only&lt;/code&gt; or &lt;code&gt;primary + 1 replica&lt;/code&gt;. The strip reads &lt;code&gt;Workload&lt;/code&gt;, the recorded total, &lt;code&gt;→&lt;/code&gt;, the total with every ranked change, &lt;code&gt;est.&lt;/code&gt;, and how many are &lt;code&gt;ranked&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Each row is a glyph, the index as table and keys, a reason line, and four numbers:&lt;/p&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Glyph&lt;/th&gt;
&lt;th&gt;Row&lt;/th&gt;
&lt;th&gt;Reason line&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;code&gt;+&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;add&lt;/td&gt;
&lt;td&gt;&lt;code&gt;2 statements&lt;/code&gt;, or &lt;code&gt;2 statements · replaces &amp;lt;index&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;=&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;duplicate&lt;/td&gt;
&lt;td&gt;&lt;code&gt;duplicate of &amp;lt;index&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;⊂&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;left prefix of a longer index&lt;/td&gt;
&lt;td&gt;&lt;code&gt;prefix of &amp;lt;index&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;∅&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;unused&lt;/td&gt;
&lt;td&gt;&lt;code&gt;0 scans&lt;/code&gt; with the window, or &lt;code&gt;too young · 9 d of 60 d&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;workload&lt;/code&gt; is the share of recorded time the change saves, negative being faster. &lt;code&gt;size&lt;/code&gt; is estimated for an add. &lt;code&gt;writes&lt;/code&gt; is the table&amp;#39;s writes per day, &lt;code&gt;+&lt;/code&gt; for an add because each of them now maintains one more index, or &lt;code&gt;HOT lost&lt;/code&gt; when a recorded &lt;code&gt;UPDATE&lt;/code&gt; sets a column the index holds (&lt;a href=&quot;/guide/reading-the-stats/&quot;&gt;Reading the stats&lt;/a&gt; explains HOT). &lt;code&gt;kind&lt;/code&gt; is &lt;code&gt;add&lt;/code&gt;, &lt;code&gt;drop&lt;/code&gt; or &lt;code&gt;skip&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;On the sample, the web-orders report gives &lt;code&gt;orders (channel, placed_at)&lt;/code&gt;: &lt;code&gt;channel&lt;/code&gt; is its equality column and &lt;code&gt;placed_at&lt;/code&gt; its range. The drop is &lt;code&gt;invoices (customer_id)&lt;/code&gt;, &lt;code&gt;prefix of invoices_customer_created_idx&lt;/code&gt;, &lt;code&gt;−96 MB&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Select a row for its evidence. &lt;code&gt;Statements changed&lt;/code&gt; lists each statement as &lt;code&gt;q1&lt;/code&gt;, &lt;code&gt;q2&lt;/code&gt;, with its mean struck through, the estimate, its calls and the time saved. &lt;code&gt;Plan · q1&lt;/code&gt; strikes the nodes that go and shows their replacements, and &lt;code&gt;SQL&lt;/code&gt; holds the statement. Candidates that failed a gate fold under &lt;code&gt;Tested, no gain&lt;/code&gt; with the reason, such as &lt;code&gt;slows a statement&lt;/code&gt; or &lt;code&gt;a shorter prefix does as well&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;On Free the list holds the duplicate, prefix and unused drops, and a locked &lt;code&gt;Ranked adds&lt;/code&gt; row stands for the rest. Ranked adds, the Matrix, the set and &lt;code&gt;Build…&lt;/code&gt; are Pro.&lt;/p&gt;
&lt;h2 id=&quot;one-table-as-a-matrix&quot;&gt;One table as a matrix&lt;a class=&quot;guide-anchor&quot; href=&quot;#one-table-as-a-matrix&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/advisor-matrix.webp?v=61d8c27bce&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/advisor-matrix-800.webp?v=69cdb8c753&quot; srcset=&quot;/guide/shots/advisor-matrix-800.webp?v=69cdb8c753 800w, /guide/shots/advisor-matrix.webp?v=61d8c27bce 2000w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(1000px, 46rem)&quot; width=&quot;1000&quot; height=&quot;335&quot; alt=&quot;The Matrix view of one table: statements down the side, existing indexes then dashed hypothetical ones across the top, with scans and size in the footer rows.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;A column with no filled cell and a &lt;code&gt;+&lt;/code&gt; in every write row is paid for on every insert and read by nothing.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;Matrix&lt;/code&gt; draws one table&amp;#39;s statements against its indexes, existing first, then the ranked adds as dashed columns. Filled is &lt;code&gt;uses now&lt;/code&gt;. An outline is &lt;code&gt;could use&lt;/code&gt;: the index leads with a column the statement filters, joins or sorts on. Accent is &lt;code&gt;would use&lt;/code&gt;, and &lt;code&gt;+&lt;/code&gt; is &lt;code&gt;upkeep on write&lt;/code&gt;. Click a dashed header to switch that index off, and the statements that relied on it fall back to today&amp;#39;s plan.&lt;/p&gt;
&lt;h2 id=&quot;choosing-a-set&quot;&gt;Choosing a set&lt;a class=&quot;guide-anchor&quot; href=&quot;#choosing-a-set&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Tick rows. The footer, &lt;code&gt;Set · 1 add · 1 drop&lt;/code&gt;, puts every ticked change in place at once and plans the touched tables again.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/advisor-set.webp?v=561a1cc1ac&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/advisor-set-800.webp?v=4eb76a464f&quot; srcset=&quot;/guide/shots/advisor-set-800.webp?v=4eb76a464f 800w, /guide/shots/advisor-set.webp?v=561a1cc1ac 1758w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(879px, 46rem)&quot; width=&quot;879&quot; height=&quot;413&quot; alt=&quot;The set footer with one add and one drop ticked, its four totals, and the script buttons.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;p&gt;It shows &lt;code&gt;workload&lt;/code&gt; and where it started &lt;code&gt;from&lt;/code&gt;, &lt;code&gt;disk&lt;/code&gt;, &lt;code&gt;indexes per orders insert&lt;/code&gt;, and &lt;code&gt;HOT updates&lt;/code&gt; as &lt;code&gt;kept&lt;/code&gt; or &lt;code&gt;lost&lt;/code&gt;. A statement more than 1.5× slower is named, as &lt;code&gt;q3 slower&lt;/code&gt;, and &lt;code&gt;Make migration&lt;/code&gt; stays off while one is. A clean set reads &lt;code&gt;none slower&lt;/code&gt;. &lt;code&gt;Make migration&lt;/code&gt; saves one &lt;code&gt;_index_advisor.sql&lt;/code&gt; file, adds before drops, each statement on its own with no &lt;code&gt;BEGIN&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;building-it&quot;&gt;Building it&lt;a class=&quot;guide-anchor&quot; href=&quot;#building-it&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Every statement the advisor writes uses &lt;code&gt;CONCURRENTLY&lt;/code&gt;. A plain &lt;a href=&quot;https://www.postgresql.org/docs/current/sql-createindex.html#SQL-CREATEINDEX-CONCURRENTLY&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;CREATE INDEX&lt;/code&gt;&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; blocks writes to &lt;code&gt;commerce.orders&lt;/code&gt; until it finishes, minutes on 12,000,000 rows. &lt;code&gt;CONCURRENTLY&lt;/code&gt; lets writes continue, scans the table twice, waits for open transactions, and cannot run in a transaction block. A failed build leaves an invalid index that still costs writes.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Build…&lt;/code&gt; opens &lt;code&gt;Build index&lt;/code&gt; with the SQL and &lt;code&gt;CONCURRENTLY · own connection · no transaction&lt;/code&gt;. On production, type the database name first. Seqora runs the one statement on its own connection and waits at most 10 seconds for a lock. A failure reads &lt;code&gt;Invalid index left&lt;/code&gt; with a &lt;code&gt;DROP&lt;/code&gt; to copy.&lt;/p&gt;
&lt;p&gt;The index then joins &lt;code&gt;Built&lt;/code&gt; under the list. After a day and 1,000 new calls, Seqora measures the mean: &lt;code&gt;verified&lt;/code&gt; within 1.25× of the estimate, &lt;code&gt;miss&lt;/code&gt; otherwise, &lt;code&gt;collecting&lt;/code&gt; until then.&lt;/p&gt;
&lt;h2 id=&quot;without-the-extensions&quot;&gt;Without the extensions&lt;a class=&quot;guide-anchor&quot; href=&quot;#without-the-extensions&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/advisor-setup.webp?v=9c5e983e53&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/advisor-setup-800.webp?v=a69044ca63&quot; srcset=&quot;/guide/shots/advisor-setup-800.webp?v=a69044ca63 800w, /guide/shots/advisor-setup.webp?v=9c5e983e53 1542w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(771px, 46rem)&quot; width=&quot;771&quot; height=&quot;245&quot; alt=&quot;The setup card at the top of the advisor list, with rows for pg_stat_statements, hypopg, replica stats and the window. The two extension rows carry the statement to copy.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;p&gt;When either extension is missing, a setup card opens with the fix to copy: &lt;code&gt;CREATE EXTENSION pg_stat_statements;&lt;/code&gt;, &lt;code&gt;shared_preload_libraries = &amp;#39;pg_stat_statements&amp;#39;&lt;/code&gt; when the library isn&amp;#39;t loaded, or &lt;code&gt;CREATE EXTENSION hypopg;&lt;/code&gt;. Seqora never runs them, and lists catalog drops only until both exist. An unused index waits for 30 days of statistics with replicas linked under &lt;code&gt;Replica stats&lt;/code&gt;, 60 without, because a replica may read what the primary never does.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Every index costs writes. The &lt;code&gt;writes&lt;/code&gt; number on an add is how many rows a day will write one more index entry. The ranking charges recorded writes for it, but not the build or the disk.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pg_stat_statements_reset()&lt;/code&gt; empties the workload and &lt;code&gt;pg_stat_reset()&lt;/code&gt; the scan counts. An index a monthly job uses looks unused until the job runs.&lt;/li&gt;
&lt;li&gt;The advisor sees only what the server recorded. With &lt;code&gt;pg_stat_statements.track&lt;/code&gt; at &lt;code&gt;top&lt;/code&gt;, the default, the foreign-key checks inside a &lt;code&gt;DELETE&lt;/code&gt; are not recorded, so the missing &lt;code&gt;billing.payments (invoice_id)&lt;/code&gt; index from &lt;a href=&quot;/guide/why-does-this-delete-take-three-minutes/&quot;&gt;Why does this DELETE take three minutes?&lt;/a&gt; never appears. The &lt;a href=&quot;/guide/what-is-in-this-database/&quot;&gt;database brief&lt;/a&gt; flags it as &lt;code&gt;FK without index&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Estimates follow the statistics. Run &lt;code&gt;ANALYZE&lt;/code&gt; on a stale table first.&lt;/li&gt;
&lt;li&gt;Partial, GIN, GiST and &lt;code&gt;INCLUDE&lt;/code&gt; candidates are not generated.&lt;/li&gt;
&lt;li&gt;MySQL and MariaDB get drops only, made &lt;code&gt;INVISIBLE&lt;/code&gt; or &lt;code&gt;IGNORED&lt;/code&gt; first. SQL Server gets drops and its missing-index views&amp;#39; adds, marked &lt;code&gt;untested&lt;/code&gt;. None has the Matrix, the set or &lt;code&gt;Build…&lt;/code&gt;, and SQLite has no advisor. See &lt;a href=&quot;/guide/other-engines/&quot;&gt;MySQL, MariaDB and SQLite&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;I rank changes one round at a time, with each pick left in place as a hypothetical before the next round, because two candidates on one table often save the same time. Tested one by one, both would be credited with it and you would build both. The set footer tests your ticks together for the same reason.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
</content>
  </entry>
  <entry>
    <title>Reading the stats</title>
    <link href="https://seqora.dev/guide/reading-the-stats/" />
    <id>https://seqora.dev/guide/reading-the-stats/</id>
    <published>2026-11-13T00:00:00Z</published>
    <updated>2026-11-13T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Know which numbers on Seqora&#39;s pages are estimates and which are counters, what correlation, n_distinct, HOT updates and idx_scan mean, and when to worry.</summary>
    <content type="html">&lt;div class=&quot;guide-gate&quot;&gt;
&lt;p&gt;Open this page when a number on an index page, in the column inspector or in the Plan tab makes you wonder whether to worry. You do not need it to read a plan. &lt;a href=&quot;/guide/why-is-this-query-slow/&quot;&gt;Why is this query slow?&lt;/a&gt; does that and sends you here for the rest.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;the-symptom&quot;&gt;The symptom&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-symptom&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The Index page says &lt;code&gt;invoices_customer_id_idx&lt;/code&gt; was &lt;code&gt;never used in 55 days&lt;/code&gt;. The column inspector says &lt;code&gt;customer_id&lt;/code&gt; has about 398,000 distinct values. The Plan tab says &lt;code&gt;orders&lt;/code&gt; was &lt;code&gt;analyzed 41 days ago&lt;/code&gt;. Before you act on any of them you need to know which kind of number each one is, because each kind lies in its own way.&lt;/p&gt;
&lt;h2 id=&quot;two-kinds-of-numbers&quot;&gt;Two kinds of numbers&lt;a class=&quot;guide-anchor&quot; href=&quot;#two-kinds-of-numbers&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;PostgreSQL keeps two kinds of statistics about a table.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Estimates&lt;/strong&gt; come from &lt;code&gt;ANALYZE&lt;/code&gt;. It reads a sample of the table, 30,000 rows by default, and writes what it found to &lt;a href=&quot;https://www.postgresql.org/docs/current/view-pg-stats.html&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;pg_stats&lt;/code&gt;&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;: distinct values, the share of nulls, the most common values, the physical order of a column. This is the planner&amp;#39;s picture of the table, as fresh as the last &lt;code&gt;ANALYZE&lt;/code&gt; and sampled, so 398,000 means roughly that.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Counters&lt;/strong&gt; come from the &lt;a href=&quot;https://www.postgresql.org/docs/current/monitoring-stats.html&quot; rel=&quot;noopener&quot;&gt;cumulative statistics system&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. Every insert, update and index scan adds one to a counter in &lt;code&gt;pg_stat_all_tables&lt;/code&gt; or &lt;code&gt;pg_stat_all_indexes&lt;/code&gt;. They are exact and count from the last reset. The sample&amp;#39;s counters were reset on 2026-08-23, so every &amp;quot;never&amp;quot; below means &amp;quot;not since then&amp;quot;.&lt;/p&gt;
&lt;p&gt;Sizes are a third kind, measured from the files, and they never reset.&lt;/p&gt;
&lt;p&gt;Seqora prints estimates with &lt;code&gt;≈&lt;/code&gt;. A number without one is a counter or a measurement.&lt;/p&gt;
&lt;h2 id=&quot;correlation&quot;&gt;correlation&lt;a class=&quot;guide-anchor&quot; href=&quot;#correlation&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;correlation&lt;/code&gt; is how closely the physical order of rows in the table matches the order of a column&amp;#39;s values. 1 means the table is laid out in that column&amp;#39;s order, 0 means no relationship, negative means reversed.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;orders.placed_at&lt;/code&gt; has a correlation of 0.99: orders are appended as they are placed, so the last 30 days sit in the last few thousand of the table&amp;#39;s 183,000 pages. &lt;code&gt;orders.customer_id&lt;/code&gt; has 0.01: one customer&amp;#39;s orders are scattered across all of them. An index range scan on &lt;code&gt;placed_at&lt;/code&gt; reads a run of neighbouring pages. The same scan on &lt;code&gt;customer_id&lt;/code&gt; for a customer with 30 orders reads 30 pages from 30 places. The planner prices the second high, and may pick a &lt;a class=&quot;guide-term&quot; href=&quot;/guide/seq-scan/&quot; data-term-icon=&quot;list-dashes&quot; data-term-description=&quot;What a Seq Scan reads, the kept-to-read ratio that tells you it is the problem, and the index that replaces it.&quot;&gt;Seq Scan&lt;/a&gt; over the index you expected.&lt;/p&gt;
&lt;p&gt;Where Seqora shows it: the Plan tab inspector draws a &lt;code&gt;heap order&lt;/code&gt; sketch under &lt;code&gt;Indexes · &amp;lt;table&amp;gt;&lt;/code&gt; for the column the scan filters on, with the correlation beside it. The column inspector (click a column&amp;#39;s header in a grid, then press &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Space&lt;/kbd&gt;&lt;/kbd&gt;) prints &lt;code&gt;Correlation&lt;/code&gt;.&lt;/p&gt;
&lt;figure class=&quot;guide-figure&quot;&gt;
&lt;div class=&quot;guide-figure-stage frame&quot; data-island=&quot;plan-inspector&quot;&gt;
&lt;div class=&quot;app-surface&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The inspector for Seq Scan on orders. Each section is one of the two kinds of number.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;figcaption&gt;
&lt;p&gt;The inspector for &lt;code&gt;Seq Scan on orders&lt;/code&gt;. Each section is one of the two kinds of number.&lt;/p&gt;
&lt;ol class=&quot;guide-legend&quot;&gt;
&lt;li&gt;&lt;code&gt;Rows&lt;/code&gt; is measured: 12,000,000 read and 206,880 kept is what the run did.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Rows per loop&lt;/code&gt; puts the estimate against the measurement: 612 is the planner&amp;#39;s picture from &lt;code&gt;pg_stats&lt;/code&gt;, 41 days old, and 206,880 is what happened.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Pages&lt;/code&gt; is measured too, &lt;code&gt;cache 1,204&lt;/code&gt; against &lt;code&gt;disk 182K&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Indexes · orders&lt;/code&gt; is the catalog, and under its list &lt;code&gt;heap order&lt;/code&gt; sketches &lt;code&gt;placed_at 0.99&lt;/code&gt;, the correlation from &lt;code&gt;pg_stats&lt;/code&gt;. The sketch is what tells you an index range on &lt;code&gt;placed_at&lt;/code&gt; reads neighbouring pages.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;suggested&lt;/code&gt; is an estimate of a third kind: &lt;code&gt;Test index&lt;/code&gt; asks the planner what it would do with an index that does not exist.&lt;/li&gt;
&lt;/ol&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;ndistinct&quot;&gt;n_distinct&lt;a class=&quot;guide-anchor&quot; href=&quot;#ndistinct&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;n_distinct&lt;/code&gt; is how many different values a column has. Positive is a count. Negative is a fraction of the row count, used when distinct values grow with the table: -1 means every row is different, and -0.92 on &lt;code&gt;orders.placed_at&lt;/code&gt; means 92% of rows have a value nobody else has.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;orders.status&lt;/code&gt; has 5. For &lt;code&gt;WHERE status = &amp;#39;shipped&amp;#39;&lt;/code&gt; the planner expects millions of rows, so the query gets a Seq Scan however good the index on &lt;code&gt;status&lt;/code&gt; is. &lt;code&gt;orders.customer_id&lt;/code&gt; has 398,000, so &lt;code&gt;WHERE customer_id = $1&lt;/code&gt; expects about 30 rows and the index wins.&lt;/p&gt;
&lt;p&gt;Where Seqora shows it: the column inspector prints &lt;code&gt;Distinct&lt;/code&gt; as a count, a share of rows, or both, and lists &lt;code&gt;Most common values&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;nullfrac&quot;&gt;null_frac&lt;a class=&quot;guide-anchor&quot; href=&quot;#nullfrac&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;null_frac&lt;/code&gt; is the share of rows where the column is null. The planner uses it to shrink the estimate for &lt;code&gt;IS NOT NULL&lt;/code&gt; and grow it for &lt;code&gt;IS NULL&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Where Seqora shows it: the column inspector&amp;#39;s &lt;code&gt;NULL&lt;/code&gt; section draws a bar: the share that &lt;code&gt;have a value&lt;/code&gt; and the share that is &lt;code&gt;NULL&lt;/code&gt;, with the estimated row count beside it.&lt;/p&gt;
&lt;h2 id=&quot;inserts-updates-and-hot-updates&quot;&gt;Inserts, updates and HOT updates&lt;a class=&quot;guide-anchor&quot; href=&quot;#inserts-updates-and-hot-updates&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;billing.invoices&lt;/code&gt; has counted 9,000,000 inserts and 1,000,000 updates since the reset, and 640,000 of the updates were HOT. They are &lt;code&gt;n_tup_ins&lt;/code&gt;, &lt;code&gt;n_tup_upd&lt;/code&gt; and &lt;code&gt;n_tup_hot_upd&lt;/code&gt; in &lt;code&gt;pg_stat_all_tables&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;A &lt;a href=&quot;https://www.postgresql.org/docs/current/storage-hot.html&quot; rel=&quot;noopener&quot;&gt;HOT update&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; writes the new row version on the same page as the old one and leaves every index alone. It is only possible when the update touches no indexed column and the page has room. The other 360,000 updates changed a column some index stores, and wrote a new entry into every index on the table. &lt;code&gt;invoices_customer_created_idx&lt;/code&gt; stores &lt;code&gt;status&lt;/code&gt; through its &lt;code&gt;INCLUDE&lt;/code&gt;, so a status change on an invoice cannot be HOT while that index exists. The index pays on every one of those updates whether or not it is ever read.&lt;/p&gt;
&lt;p&gt;Where Seqora shows it: on the Index page, under &lt;code&gt;Where the space goes&lt;/code&gt;, hover the table&amp;#39;s block for &lt;code&gt;Inserts counted&lt;/code&gt; and &lt;code&gt;Updates in place&lt;/code&gt;, printed as a share of all updates. That hover is the only place these three counters appear.&lt;/p&gt;
&lt;h2 id=&quot;lastanalyze&quot;&gt;last_analyze&lt;a class=&quot;guide-anchor&quot; href=&quot;#lastanalyze&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;last_analyze&lt;/code&gt; and &lt;code&gt;last_autoanalyze&lt;/code&gt; in &lt;code&gt;pg_stat_all_tables&lt;/code&gt; say when the estimates were last refreshed. &lt;code&gt;commerce.orders&lt;/code&gt; was analysed 41 days ago, which is why the Plan tab expected 612 rows from the last 30 days and found 206,880. Autovacuum analyses a table once about a tenth of it has changed, and a tenth of 12,000,000 rows is a month of orders. Tables that grow in one direction age worst, because the newest values are the ones the sample has never seen.&lt;/p&gt;
&lt;p&gt;Where Seqora shows it: the Plan tab&amp;#39;s &lt;code&gt;Estimate off&lt;/code&gt; finding ends with &lt;code&gt;analyzed 41 days ago&lt;/code&gt;, next to &lt;code&gt;Copy ANALYZE orders&lt;/code&gt;. Double-click a table wheel for the &lt;code&gt;Table wheel&lt;/code&gt; guide, where &lt;code&gt;Statistics&lt;/code&gt; reads &lt;code&gt;analyzed 41 days ago&lt;/code&gt; or &lt;code&gt;never analyzed&lt;/code&gt;. The column inspector&amp;#39;s footer names the source and when &lt;code&gt;ANALYZE&lt;/code&gt; last ran, &lt;code&gt;Estimate · pg_stats · ANALYZE last month&lt;/code&gt; for &lt;code&gt;orders&lt;/code&gt;, with &lt;code&gt;Run exact&lt;/code&gt; beside it, which counts the whole table instead.&lt;/p&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;I put the age of the statistics next to every number that comes from them: in the finding, in the wheel guide and in the column inspector&amp;#39;s footer. An estimate without its age reads like a fact. With the age beside it, 612 is a guess made 41 days ago, and the fix, &lt;code&gt;Copy ANALYZE orders&lt;/code&gt;, sits on the same card.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
&lt;h2 id=&quot;idxscan-and-lastidxscan&quot;&gt;idx_scan and last_idx_scan&lt;a class=&quot;guide-anchor&quot; href=&quot;#idxscan-and-lastidxscan&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;pg_stat_all_indexes&lt;/code&gt; counts &lt;code&gt;idx_scan&lt;/code&gt; for every index, and since PostgreSQL 16 records &lt;code&gt;last_idx_scan&lt;/code&gt;. &lt;code&gt;invoices_customer_id_idx&lt;/code&gt;, on &lt;code&gt;customer_id&lt;/code&gt; alone, has 0 scans: not once since 2026-08-23. It is 96 MB, and &lt;code&gt;invoices&lt;/code&gt; writes to it on every insert and on every update that is not HOT. Beside it, &lt;code&gt;invoices_customer_created_idx&lt;/code&gt; on &lt;code&gt;(customer_id, created_at DESC)&lt;/code&gt; is 388 MB and has been scanned 2.8 million times. Every lookup the first can answer, the second answers too, which is why the Index page calls the first &lt;code&gt;covered by this index&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;idx_tup_read&lt;/code&gt;, which the Index page calls &lt;code&gt;Entries read&lt;/code&gt;, is how many index entries scans have walked. &lt;code&gt;idx_tup_fetch&lt;/code&gt;, &lt;code&gt;Rows fetched&lt;/code&gt;, is how many table rows those scans then went and got. Entries read far above rows fetched means the index is walked and then filtered.&lt;/p&gt;
&lt;p&gt;Where Seqora shows it: the Index page header prints the size and the usage beside the name, &lt;code&gt;never used in 55 days&lt;/code&gt; for &lt;code&gt;invoices_customer_id_idx&lt;/code&gt;. A note under the sections reads &lt;code&gt;Usage counted since stats reset on&lt;/code&gt; and the date. &lt;code&gt;Entries read&lt;/code&gt; and &lt;code&gt;Rows fetched&lt;/code&gt; are under &lt;code&gt;All properties&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;size-space-and-bloat&quot;&gt;Size, space and bloat&lt;a class=&quot;guide-anchor&quot; href=&quot;#size-space-and-bloat&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;pg_relation_size&lt;/code&gt; is the index on disk and &lt;code&gt;pg_total_relation_size&lt;/code&gt; is the table with everything attached. &lt;code&gt;commerce.orders&lt;/code&gt; is 1.5 GB of heap and 2.3 GB in total. &lt;code&gt;commerce.order_items&lt;/code&gt; is 3.0 GB of heap and 5.6 GB in total: more index than table.&lt;/p&gt;
&lt;p&gt;Sizes cannot say how much of an index is dead: deleted and updated rows leave entries behind until vacuum reclaims them, and the space stays inside the page. The Index page&amp;#39;s &lt;code&gt;Where the space goes&lt;/code&gt; estimates &lt;code&gt;Wasted space&lt;/code&gt; for a B-tree, marked &lt;code&gt;Estimated from table statistics&lt;/code&gt;. The schema&amp;#39;s &lt;code&gt;Indexes&lt;/code&gt; report has &lt;code&gt;Estimate bloat&lt;/code&gt; (Pro), which runs the estimate across the schema and marks the worst &lt;code&gt;Bloated&lt;/code&gt;. Both are estimates. Seqora does not use &lt;code&gt;pgstattuple&lt;/code&gt;, which measures it exactly by reading every page.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Counters reset. &lt;code&gt;pg_stat_reset()&lt;/code&gt; and crash recovery set them to zero, and a &lt;code&gt;never used&lt;/code&gt; index is never used since then.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pg_stats&lt;/code&gt; is sampled. &lt;code&gt;SELECT count(DISTINCT customer_id)&lt;/code&gt; is the truth, and it reads the whole table. So does the column inspector&amp;#39;s &lt;code&gt;Run exact&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The counters above come from a 12-million-row copy reset on 2026-08-23. A downloaded copy starts from zero.&lt;/li&gt;
&lt;li&gt;MySQL 8 shows histograms in the column inspector, which are not &lt;code&gt;pg_stats&lt;/code&gt;. MariaDB, SQLite and SQL Server show no column statistics there, only &lt;code&gt;Run exact&lt;/code&gt;. On SQL Server the footer says when the statistics were last updated instead of when &lt;code&gt;ANALYZE&lt;/code&gt; ran. &lt;a href=&quot;/guide/other-engines/&quot;&gt;MySQL, MariaDB, SQLite and SQL Server&lt;/a&gt; has the table.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry>
    <title>What is in this database?</title>
    <link href="https://seqora.dev/guide/what-is-in-this-database/" />
    <id>https://seqora.dev/guide/what-is-in-this-database/</id>
    <published>2026-11-13T00:00:00Z</published>
    <updated>2026-11-13T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Read the database brief: a schema&#39;s areas, where its bytes sit, every table in the ledger, and the smells worth fixing before you change anything.</summary>
    <content type="html">&lt;div class=&quot;guide-gate&quot;&gt;
&lt;p&gt;Read this when you have connected to a database you have never opened and want the shape of a schema in a minute: which tables matter, where the data is, and what is wrong with it. You don&amp;#39;t need it for a schema you wrote last week. For one table at a time, &lt;a href=&quot;/guide/what-does-this-table-do/&quot;&gt;What does this table do?&lt;/a&gt; goes deeper.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;the-symptom&quot;&gt;The symptom&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-symptom&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You add the commerce sample and connect. The explorer lists six schemas. &lt;code&gt;billing&lt;/code&gt; alone has &lt;code&gt;invoices&lt;/code&gt;, &lt;code&gt;invoice_lines&lt;/code&gt;, &lt;code&gt;payments&lt;/code&gt;, &lt;code&gt;events&lt;/code&gt;, &lt;code&gt;invoice_events&lt;/code&gt; and &lt;code&gt;event_attachments&lt;/code&gt;, and nothing says which of them the others hang off, which column has no index, or which key is closest to the end of its integer range.&lt;/p&gt;
&lt;h2 id=&quot;when-the-brief-opens&quot;&gt;When the brief opens&lt;a class=&quot;guide-anchor&quot; href=&quot;#when-the-brief-opens&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The brief opens the first time you connect to a database, once per connection. Saving a new connection, connecting from the sidebar and opening something on an offline connection all count. Reconnects at launch or after a drop don&amp;#39;t, and neither do the connections compare and drift open. It waits for the table list, then opens on &lt;code&gt;public&lt;/code&gt; if that has tables, else on the schema with the most. The commerce sample has no &lt;code&gt;public&lt;/code&gt;, so you get &lt;code&gt;Brief · billing&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;To open it again, right-click a schema and choose &lt;code&gt;Database brief&lt;/code&gt;, or pick &lt;code&gt;Database brief&lt;/code&gt; in the command palette. &lt;code&gt;Open the brief of a new database&lt;/code&gt;, in Settings › General, turns the first opening off.&lt;/p&gt;
&lt;p&gt;The brief is per schema. A foreign key into another schema, like &lt;code&gt;billing.invoices.customer_id&lt;/code&gt; to &lt;code&gt;crm.customers&lt;/code&gt;, is not part of any area.&lt;/p&gt;
&lt;h2 id=&quot;the-masthead&quot;&gt;The masthead&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-masthead&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;While it builds, three stations run across the top, &lt;code&gt;catalog&lt;/code&gt;, &lt;code&gt;stats&lt;/code&gt; and &lt;code&gt;brief&lt;/code&gt;, each with its time. Then come the build time, &lt;code&gt;Refresh&lt;/code&gt;, a &lt;code&gt;Page&lt;/code&gt; and &lt;code&gt;Ledger&lt;/code&gt; switch, and &lt;code&gt;Export&lt;/code&gt;. The title is the database name, with tags for the schema, the server version and any framework or extensions found. Below are the vitals: &lt;code&gt;tables&lt;/code&gt;, &lt;code&gt;on disk&lt;/code&gt;, &lt;code&gt;rows&lt;/code&gt;, &lt;code&gt;areas&lt;/code&gt;, &lt;code&gt;islands&lt;/code&gt; and &lt;code&gt;links&lt;/code&gt;. On &lt;code&gt;billing&lt;/code&gt;, &lt;code&gt;tables&lt;/code&gt; is 6 and &lt;code&gt;links&lt;/code&gt; is 2 with &lt;code&gt;+3&lt;/code&gt;: two declared foreign keys inside the schema, three links inferred from names. &lt;code&gt;rows&lt;/code&gt; carries &lt;code&gt;≈&lt;/code&gt; because it is the planner&amp;#39;s estimate.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/brief-front-page.webp?v=a2db648d3a&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/brief-front-page-800.webp?v=13bcff23d4&quot; srcset=&quot;/guide/shots/brief-front-page-800.webp?v=13bcff23d4 800w, /guide/shots/brief-front-page.webp?v=a2db648d3a 1872w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(936px, 46rem)&quot; width=&quot;936&quot; height=&quot;526&quot; alt=&quot;The database brief for the billing schema: the masthead with its vitals, and the Areas map with invoices numbered 1.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;&lt;code&gt;links&lt;/code&gt; reads 2 declared plus 3 inferred. The badge on &lt;code&gt;invoices&lt;/code&gt; marks the table to read first.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;areas&quot;&gt;Areas&lt;a class=&quot;guide-anchor&quot; href=&quot;#areas&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;Areas&lt;/code&gt; is a metro map. Each line is an area: tables that link to each other more than to the rest. Solid track is a &lt;code&gt;declared&lt;/code&gt; foreign key and dashed track is &lt;code&gt;inferred&lt;/code&gt;. A large ring marks a &lt;code&gt;hub&lt;/code&gt;: the table an area is laid out around, and any table that at least five others point at. A numbered badge is &lt;code&gt;read first&lt;/code&gt;: up to six tables, the most pointed-at table of each area first. Tables with no link to another table in the schema are islands, counted in the vitals.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;billing&lt;/code&gt; splits into two areas, ringed at &lt;code&gt;invoices&lt;/code&gt; and &lt;code&gt;events&lt;/code&gt;. &lt;code&gt;invoices&lt;/code&gt; has four tables pointing at it, two by name only, and gets the badge &lt;code&gt;1&lt;/code&gt;: start there. Click a station to open its table.&lt;/p&gt;
&lt;h2 id=&quot;weight-and-tables&quot;&gt;Weight and tables&lt;a class=&quot;guide-anchor&quot; href=&quot;#weight-and-tables&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;Weight&lt;/code&gt; is a waffle of 100 squares over the bytes on disk. The six largest tables get a colour and a legend line, and the rest share a hatched &lt;code&gt;n others&lt;/code&gt;. &lt;code&gt;Tables&lt;/code&gt; below it is one dot per table, by area, hollow when &lt;code&gt;dormant&lt;/code&gt;. With twelve tables or fewer the dots become names.&lt;/p&gt;
&lt;h2 id=&quot;house-style&quot;&gt;House style&lt;a class=&quot;guide-anchor&quot; href=&quot;#house-style&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;House style&lt;/code&gt; writes a &lt;code&gt;CREATE TABLE&lt;/code&gt; in the schema&amp;#39;s own conventions: table names, the primary key, foreign key names, timestamps, JSON. Each line carries the share of tables that follow it and a count of outliers, whose names show on hover.&lt;/p&gt;
&lt;h2 id=&quot;smells&quot;&gt;Smells&lt;a class=&quot;guide-anchor&quot; href=&quot;#smells&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;Smells&lt;/code&gt; is a matrix. Each row is one kind of problem, with its glyph coloured by severity, most severe first. Each column is an area, then &lt;code&gt;all&lt;/code&gt;. A dot&amp;#39;s size is the count. Click a row to list its objects.&lt;/p&gt;
&lt;p&gt;On &lt;code&gt;billing&lt;/code&gt; it raises four, each a known flaw of the sample:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;FK without index&lt;/code&gt;: &lt;code&gt;payments.invoice_id&lt;/code&gt;, &lt;code&gt;→ invoices.id&lt;/code&gt;. Critical, because &lt;code&gt;invoices&lt;/code&gt; has 8,100,000 rows. This is the &lt;a href=&quot;/guide/why-does-this-delete-take-three-minutes/&quot;&gt;three-minute DELETE&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Key-named, no FK&lt;/code&gt;: &lt;code&gt;invoice_lines.invoice_id&lt;/code&gt;, &lt;code&gt;invoice_events.invoice_id&lt;/code&gt; and &lt;code&gt;event_attachments.event_id&lt;/code&gt;. Each looks like a foreign key and has no constraint.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Duplicate index&lt;/code&gt;: &lt;code&gt;invoices.invoices_customer_id_idx&lt;/code&gt;, &lt;code&gt;covered by invoices_customer_created_idx&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Sequence near its limit&lt;/code&gt;: &lt;code&gt;events.id&lt;/code&gt;, &lt;code&gt;71% of integer&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Every smell the brief can raise, and what it reads:&lt;/p&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Smell&lt;/th&gt;
&lt;th&gt;What it means&lt;/th&gt;
&lt;th&gt;Read from&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FK without index&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No valid B-tree index leads with the key&amp;#39;s columns, so each delete on the referenced table scans this one. Critical from 1,000,000 referenced rows.&lt;/td&gt;
&lt;td&gt;Declared &lt;a href=&quot;https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-FK&quot; rel=&quot;noopener&quot;&gt;foreign keys&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;, indexes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Sequence near its limit&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A serial or identity column has used half its type&amp;#39;s range or more. Warning at 75%, critical at 90%.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;pg_depend&lt;/code&gt;, &lt;a href=&quot;https://www.postgresql.org/docs/current/view-pg-sequences.html&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;pg_sequences&lt;/code&gt;&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;No primary key&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No primary key, and no unique key on &lt;code&gt;NOT NULL&lt;/code&gt; columns.&lt;/td&gt;
&lt;td&gt;Keys, nullability&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Key-named, no FK&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A &lt;code&gt;customer_id&lt;/code&gt; column with no constraint, and a &lt;code&gt;customers&lt;/code&gt; table with a one-column key of the same type family. With a &lt;code&gt;customer_type&lt;/code&gt; partner it is &lt;code&gt;polymorphic&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;Names, keys, types&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FK type mismatch&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A foreign key column whose type differs from the column it references.&lt;/td&gt;
&lt;td&gt;Declared keys, types&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Duplicate index&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A plain index whose columns lead another index of the same kind.&lt;/td&gt;
&lt;td&gt;Indexes, not partial or expression ones&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Cascade reach&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Deleting one row cascades through 5 tables or more, or about 10,000,000 rows.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ON DELETE CASCADE&lt;/code&gt; keys, row estimates&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Same name, different type&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A key-named column on three tables or more, with a type most of them don&amp;#39;t use.&lt;/td&gt;
&lt;td&gt;Names, types&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Timestamp without zone&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A &lt;a href=&quot;https://www.postgresql.org/docs/current/datatype-datetime.html&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;timestamp&lt;/code&gt;&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; column, which stores no time zone.&lt;/td&gt;
&lt;td&gt;Types&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Dormant or empty&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No writes since the statistics reset, or no rows.&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-ALL-TABLES-VIEW&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;pg_stat_user_tables&lt;/code&gt;&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;, row estimates&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Naming outlier&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A name that breaks the house case or plural.&lt;/td&gt;
&lt;td&gt;Names&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FK cycle&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Foreign keys that run in a loop between tables, self-references left out.&lt;/td&gt;
&lt;td&gt;Declared keys&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;h2 id=&quot;fixing-what-it-flags&quot;&gt;Fixing what it flags&lt;a class=&quot;guide-anchor&quot; href=&quot;#fixing-what-it-flags&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A row with a script ends in &lt;code&gt;Fix&lt;/code&gt;. Fix scripts, the orphan check and &lt;code&gt;Open as design&lt;/code&gt; are Pro. The smells and their objects are not.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Fix&lt;/code&gt; opens the row with every fixable object ticked and the script for them on the right, headed &lt;code&gt;1 chosen&lt;/code&gt;. For &lt;code&gt;FK without index&lt;/code&gt; on &lt;code&gt;billing&lt;/code&gt; it reads:&lt;/p&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-comment&quot;&gt;-- payments.invoice_id · → invoices.id&lt;/span&gt;
&lt;span class=&quot;tok-key&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;INDEX&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;CONCURRENTLY&lt;/span&gt; payments_invoice_id_idx
  &lt;span class=&quot;tok-key&quot;&gt;ON&lt;/span&gt; billing.payments (invoice_id);&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The scripts are written for a live server. Indexes are built and dropped &lt;a href=&quot;https://www.postgresql.org/docs/current/sql-createindex.html#SQL-CREATEINDEX-CONCURRENTLY&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;CONCURRENTLY&lt;/code&gt;&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;. An inferred foreign key is added &lt;code&gt;NOT VALID&lt;/code&gt;, then validated, with an index first when it needs one. A retype warns in a comment that it rewrites the table under an exclusive lock. Nothing runs from the brief: &lt;code&gt;Copy&lt;/code&gt; takes the script, and &lt;code&gt;Open in SQL editor&lt;/code&gt; puts it in a new editor for you to read and run. For the two key smells, &lt;code&gt;Open as design&lt;/code&gt; starts a schema design instead.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/brief-fix-script.webp?v=57ec64ce94&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/brief-fix-script-800.webp?v=ab6f2c0975&quot; srcset=&quot;/guide/shots/brief-fix-script-800.webp?v=ab6f2c0975 800w, /guide/shots/brief-fix-script.webp?v=57ec64ce94 1872w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(936px, 46rem)&quot; width=&quot;936&quot; height=&quot;417&quot; alt=&quot;The FK without index row opened in the Smells matrix, with payments.invoice_id ticked and its CREATE INDEX CONCURRENTLY script on the right.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;The script is only shown. &lt;code&gt;Open in SQL editor&lt;/code&gt; is the way to run it.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Before you add a key the brief inferred, press &lt;code&gt;Check orphans&lt;/code&gt;. It counts the rows whose value has no match in the target, and stops at 10,000 (&lt;code&gt;10000+ orphans&lt;/code&gt;). A key with orphans would fail to validate, so the brief unticks it. Each check runs in a read-only transaction and gives up after 5 seconds with &lt;code&gt;timed out&lt;/code&gt;.&lt;/p&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;I built the brief from the catalog and the planner&amp;#39;s statistics only, with no generated prose, so the same database always gives the same brief and every line traces back to a catalog fact. Opening it never scans a table. The one thing that reads rows, the orphan check, runs only when you press it, under a time limit.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
&lt;p&gt;For indexes beyond foreign keys, see &lt;a href=&quot;/guide/which-indexes-are-missing/&quot;&gt;Which indexes are missing?&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;the-ledger&quot;&gt;The ledger&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-ledger&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;Ledger&lt;/code&gt; lists every table under its area, islands last, with &lt;code&gt;Role&lt;/code&gt;, &lt;code&gt;≈Rows&lt;/code&gt;, &lt;code&gt;Size&lt;/code&gt;, &lt;code&gt;In · Links · Out&lt;/code&gt;, &lt;code&gt;Writes&lt;/code&gt; as a mix of &lt;code&gt;ins&lt;/code&gt;, &lt;code&gt;upd&lt;/code&gt; and &lt;code&gt;del&lt;/code&gt;, &lt;code&gt;Time cols&lt;/code&gt; and &lt;code&gt;Smells&lt;/code&gt;. A role is &lt;code&gt;hub&lt;/code&gt;, &lt;code&gt;entity&lt;/code&gt;, &lt;code&gt;join&lt;/code&gt;, &lt;code&gt;lookup&lt;/code&gt;, &lt;code&gt;log&lt;/code&gt; or &lt;code&gt;island&lt;/code&gt;, read from links, size and writes. Filters along the top pick a role, &lt;code&gt;has smell&lt;/code&gt; or &lt;code&gt;no updated_at&lt;/code&gt;. No &lt;code&gt;billing&lt;/code&gt; table has an &lt;code&gt;updated_at&lt;/code&gt;, so that last one keeps all six.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/brief-ledger.webp?v=f96fcdd535&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/brief-ledger-800.webp?v=d02e5232d8&quot; srcset=&quot;/guide/shots/brief-ledger-800.webp?v=d02e5232d8 800w, /guide/shots/brief-ledger.webp?v=f96fcdd535 1872w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(936px, 46rem)&quot; width=&quot;936&quot; height=&quot;385&quot; alt=&quot;The brief&amp;#39;s Ledger view for billing, every table under its area with role, row estimate, size bar, link butterfly, write mix, time columns and smell glyphs.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;Export&lt;/code&gt; copies the brief as Markdown or agent context, or saves it as Markdown or HTML.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The brief reads catalog and statistics views, never table data. On PostgreSQL that is one round trip of four queries, on top of what the ER diagram reads.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;≈Rows&lt;/code&gt; is &lt;code&gt;reltuples&lt;/code&gt;, as fresh as the last &lt;code&gt;ANALYZE&lt;/code&gt;. Writes count from the last statistics reset, or server start, and a table needs seven days of them to be called dormant.&lt;/li&gt;
&lt;li&gt;A role that cannot read a sequence gets no &lt;code&gt;last_value&lt;/code&gt; from &lt;code&gt;pg_sequences&lt;/code&gt;, so &lt;code&gt;Sequence near its limit&lt;/code&gt; stays silent.&lt;/li&gt;
&lt;li&gt;MySQL and MariaDB keep no per-table write counters, so there is no &lt;code&gt;Writes&lt;/code&gt; column and only empty tables count as dormant. &lt;code&gt;AUTO_INCREMENT&lt;/code&gt; columns stand in for sequences.&lt;/li&gt;
&lt;li&gt;SQLite keeps no per-table sizes or write counters, so the waffle weighs rows and there is no sequence smell. Its fix scripts rebuild the table to add a key or change a type.&lt;/li&gt;
&lt;li&gt;SQL Server&amp;#39;s write counters need &lt;code&gt;VIEW DATABASE STATE&lt;/code&gt;, or &lt;code&gt;VIEW SERVER STATE&lt;/code&gt; before SQL Server 2022, and reset at restart. Without the permission the brief leaves writes out.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Timestamp without zone&lt;/code&gt; is PostgreSQL only.&lt;/li&gt;
&lt;li&gt;The buildable sample keeps only the last 500,000 rows of &lt;code&gt;billing.events&lt;/code&gt;, not the 1.5 billion other pages quote, so its &lt;code&gt;rows&lt;/code&gt; and &lt;code&gt;on disk&lt;/code&gt; are smaller. The smells are the same.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
&lt;p&gt;When the brief has told you where to start, &lt;a href=&quot;/guide/a-schema-you-did-not-write/&quot;&gt;A schema you did not write&lt;/a&gt; walks the rest of the first hour.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>A schema you did not write</title>
    <link href="https://seqora.dev/guide/a-schema-you-did-not-write/" />
    <id>https://seqora.dev/guide/a-schema-you-did-not-write/</id>
    <published>2026-11-13T00:00:00Z</published>
    <updated>2026-11-13T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Spend the first hour with an inherited database well: the diagram, the hubs, the three schema reports, three tables, a first query, and what to write down.</summary>
    <content type="html">&lt;div class=&quot;guide-gate&quot;&gt;
&lt;p&gt;You have been handed a database and the person who built it is gone. You don&amp;#39;t need this page if the schema has twelve tables and a README. You need it when it has six schemas, nobody remembers which view the dashboard reads, and your first ticket is due this week.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;the-symptom&quot;&gt;The symptom&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-symptom&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The explorer lists &lt;code&gt;audit&lt;/code&gt;, &lt;code&gt;billing&lt;/code&gt;, &lt;code&gt;catalog&lt;/code&gt;, &lt;code&gt;commerce&lt;/code&gt;, &lt;code&gt;crm&lt;/code&gt; and &lt;code&gt;identity&lt;/code&gt;. Fourteen tables, a few views, a few functions. Opening them one at a time tells you what columns exist, not which three tables matter, which way the arrows point, or what breaks if you drop something. An hour in the right order answers all three.&lt;/p&gt;
&lt;p&gt;The first time you connect, Seqora opens the &lt;a href=&quot;/guide/what-is-in-this-database/&quot;&gt;database brief&lt;/a&gt;, a one-page summary of every schema. It is a good map to hold while you do the rest of this hour by hand. A schema&amp;#39;s menu in the explorer opens it again under &lt;code&gt;Database brief&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;the-diagram-first&quot;&gt;The diagram first&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-diagram-first&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Press &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;E&lt;/kbd&gt;&lt;/kbd&gt;, or pick &lt;code&gt;Open ER diagram…&lt;/code&gt; from the command palette, and choose &lt;code&gt;commerce&lt;/code&gt;. The diagram is per schema. It draws the schema&amp;#39;s own tables and pulls in the tables from other schemas that a foreign key reaches, counted as linked tables in the header.&lt;/p&gt;
&lt;div class=&quot;guide-island frame&quot; data-island=&quot;design&quot; data-demo-stage&gt;
&lt;div class=&quot;app-surface&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The ER diagram of the commerce sample as the app draws it, with the design mode it can step into.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The figure opens in diagram mode. The design mode it can step into is another page, &lt;a href=&quot;/guide/design-a-schema-change/&quot;&gt;Design a schema change&lt;/a&gt;. For this hour, stay in the diagram.&lt;/p&gt;
&lt;p&gt;The diagram opens in &lt;code&gt;Keys only&lt;/code&gt;. Every table shrinks to its primary key, unique keys and foreign keys, which is all you need to see the shape. &lt;code&gt;Selected table&lt;/code&gt; and &lt;code&gt;All columns&lt;/code&gt; show more. &lt;code&gt;Find table…&lt;/code&gt; jumps to a table when the canvas outgrows the screen.&lt;/p&gt;
&lt;p&gt;Click a table. The inspector on the right names it, gives the row estimate, &lt;code&gt;~412,000 rows&lt;/code&gt; on &lt;code&gt;crm.customers&lt;/code&gt;, and has &lt;code&gt;Open table&lt;/code&gt;. A table from another schema is marked &lt;code&gt;Boundary&lt;/code&gt;. &lt;code&gt;Columns&lt;/code&gt; lists every column with its type, a &lt;code&gt;?&lt;/code&gt; when it can be &lt;code&gt;NULL&lt;/code&gt;, and &lt;code&gt;PK&lt;/code&gt;, &lt;code&gt;UQ&lt;/code&gt; and &lt;code&gt;FK&lt;/code&gt; badges. A foreign key column carries a chip naming the table it points to: hover it for the columns and the constraint name, click it to go there. An icon beside it says when a delete on the other side cascades, sets &lt;code&gt;NULL&lt;/code&gt; or resets the default. A foreign key that no index starts with gets a warning mark, and hovering it on &lt;code&gt;orders&lt;/code&gt; reads &lt;code&gt;No index on store_id. Joins and deletes through this key scan orders.&lt;/code&gt; Under the columns, &lt;code&gt;Referenced by&lt;/code&gt; lists the tables that point here, each with its constraint name. &lt;code&gt;Indexes&lt;/code&gt; and &lt;code&gt;DDL&lt;/code&gt; fold out at the bottom.&lt;/p&gt;
&lt;h2 id=&quot;find-the-hubs&quot;&gt;Find the hubs&lt;a class=&quot;guide-anchor&quot; href=&quot;#find-the-hubs&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Count inbound edges. The hub is the table everything points at, here &lt;code&gt;crm.customers&lt;/code&gt;: &lt;code&gt;commerce.orders.customer_id&lt;/code&gt;, &lt;code&gt;billing.invoices.customer_id&lt;/code&gt; and &lt;code&gt;identity.accounts.customer_id&lt;/code&gt; all land on it. Select it and &lt;code&gt;Referenced by&lt;/code&gt; lists them. &lt;code&gt;commerce.orders&lt;/code&gt; is the second hub: &lt;code&gt;commerce.order_items&lt;/code&gt; and &lt;code&gt;billing.invoices&lt;/code&gt; point at it.&lt;/p&gt;
&lt;p&gt;Then the tables nothing points at. &lt;code&gt;commerce.order_items&lt;/code&gt;, &lt;code&gt;billing.invoice_lines&lt;/code&gt;, &lt;code&gt;billing.payments&lt;/code&gt; and &lt;code&gt;audit.change_log&lt;/code&gt; have no inbound edges, and their inspector has no &lt;code&gt;Referenced by&lt;/code&gt;. They are leaves: detail rows, logs, history. Nothing downstream breaks when you change them.&lt;/p&gt;
&lt;p&gt;Then the odd one. Open the diagram for &lt;code&gt;catalog&lt;/code&gt;. &lt;code&gt;catalog.categories&lt;/code&gt; has an edge that leaves the table and comes back: &lt;code&gt;parent_id&lt;/code&gt; references &lt;code&gt;categories.id&lt;/code&gt;, and its chip in the inspector names &lt;code&gt;categories&lt;/code&gt; itself. That is a tree in one table, 310 rows of it, and any query for a category&amp;#39;s ancestors will be recursive.&lt;/p&gt;
&lt;h2 id=&quot;the-three-reports&quot;&gt;The three reports&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-three-reports&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Under each schema in the explorer, &lt;code&gt;Schema reports&lt;/code&gt;: &lt;code&gt;Columns&lt;/code&gt;, &lt;code&gt;Indexes&lt;/code&gt;, &lt;code&gt;Constraints&lt;/code&gt;. They read the whole schema at once.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Columns&lt;/code&gt; has four views, &lt;code&gt;All&lt;/code&gt;, &lt;code&gt;Mixed types&lt;/code&gt;, &lt;code&gt;FK without index&lt;/code&gt; and &lt;code&gt;Mostly empty&lt;/code&gt;, from &lt;code&gt;pg_stats&lt;/code&gt; and the catalog. &lt;code&gt;Mixed types&lt;/code&gt; finds a column name declared &lt;code&gt;integer&lt;/code&gt; in one table and &lt;code&gt;bigint&lt;/code&gt; in another, which will bite in a join. &lt;code&gt;FK without index&lt;/code&gt; finds the foreign keys whose deletes will scan. &lt;code&gt;Mostly empty&lt;/code&gt; finds columns nobody fills in. All three are things the person who left knew and did not write down.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Indexes&lt;/code&gt; has &lt;code&gt;Map&lt;/code&gt; and &lt;code&gt;Table&lt;/code&gt; views, a &lt;code&gt;Needs a look&lt;/code&gt; list of indexes that are unused, covered by another or invalid, and &lt;code&gt;Other checks&lt;/code&gt;. On &lt;code&gt;billing&lt;/code&gt;, &lt;code&gt;Other checks&lt;/code&gt; counts one foreign key without an index and names it: &lt;code&gt;payments.invoice_id&lt;/code&gt;. Write it down. It is the whole of &lt;a href=&quot;/guide/why-does-this-delete-take-three-minutes/&quot;&gt;Why does this DELETE take three minutes?&lt;/a&gt;.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/schema-report-indexes.webp?v=3fb049a38b&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/schema-report-indexes-800.webp?v=5e9555f7f3&quot; srcset=&quot;/guide/shots/schema-report-indexes-800.webp?v=5e9555f7f3 800w, /guide/shots/schema-report-indexes.webp?v=3fb049a38b 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;822&quot; alt=&quot;The Indexes report for billing in Map view: each index as a dot by size and scans, Needs a look on the right, and Other checks naming payments.invoice_id.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;&lt;code&gt;billing&lt;/code&gt;, with &lt;code&gt;payments.invoice_id&lt;/code&gt; under &lt;code&gt;Other checks&lt;/code&gt;.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;Constraints&lt;/code&gt; lays every table out as &lt;code&gt;Points at it&lt;/code&gt;, &lt;code&gt;Table and its rules&lt;/code&gt; and &lt;code&gt;Points to&lt;/code&gt;, with its own &lt;code&gt;Needs a look&lt;/code&gt; count for rules added &lt;code&gt;NOT VALID&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;open-three-tables&quot;&gt;Open three tables&lt;a class=&quot;guide-anchor&quot; href=&quot;#open-three-tables&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Press &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;P&lt;/kbd&gt;&lt;/kbd&gt; for &lt;code&gt;Open table…&lt;/code&gt; and open &lt;code&gt;crm.customers&lt;/code&gt;, &lt;code&gt;commerce.orders&lt;/code&gt; and &lt;code&gt;billing.invoices&lt;/code&gt;. The two hubs and the thing that gets paid: every ticket will touch one of them.&lt;/p&gt;
&lt;p&gt;The status bar on each shows an estimate, &lt;code&gt;of ~12M&lt;/code&gt; on &lt;code&gt;orders&lt;/code&gt;. Click &lt;code&gt;Count&lt;/code&gt; for the exact number when it matters. Then read ten rows with the value inspector: select a cell and press Space. It decodes a timestamp into UTC, ISO 8601 and Unix seconds, and tells you which UUID version &lt;code&gt;stores.id&lt;/code&gt; is. It opens &lt;code&gt;attributes&lt;/code&gt; on &lt;code&gt;customers&lt;/code&gt; as a JSON tree, and says under &lt;code&gt;In this table&lt;/code&gt; how many loaded rows share the value. Ten rows read this way tell you what &lt;code&gt;status&lt;/code&gt; holds and whether &lt;code&gt;total_cents&lt;/code&gt; is really cents.&lt;/p&gt;
&lt;h2 id=&quot;the-first-query&quot;&gt;The first query&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-first-query&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Write it against a hub, not a leaf:&lt;/p&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-key&quot;&gt;SELECT&lt;/span&gt; status, count(*)
&lt;span class=&quot;tok-key&quot;&gt;FROM&lt;/span&gt;   commerce.orders
&lt;span class=&quot;tok-key&quot;&gt;WHERE&lt;/span&gt;  placed_at &amp;gt;= now() - &lt;span class=&quot;tok-key&quot;&gt;interval&lt;/span&gt; &lt;span class=&quot;tok-string&quot;&gt;&amp;#39;30 days&amp;#39;&lt;/span&gt;
&lt;span class=&quot;tok-key&quot;&gt;GROUP&lt;/span&gt;  &lt;span class=&quot;tok-key&quot;&gt;BY&lt;/span&gt; status
&lt;span class=&quot;tok-key&quot;&gt;ORDER&lt;/span&gt;  &lt;span class=&quot;tok-key&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;tok-number&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;DESC&lt;/span&gt;;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;If it is slow, the next page is &lt;a href=&quot;/guide/why-is-this-query-slow/&quot;&gt;Why is this query slow?&lt;/a&gt;. If it is fast, you have your first fact about the business: how many orders a month, in which states.&lt;/p&gt;
&lt;h2 id=&quot;what-to-write-down-after-the-hour&quot;&gt;What to write down after the hour&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-write-down-after-the-hour&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Four lines, in a file next to the ticket:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The hubs: &lt;code&gt;crm.customers&lt;/code&gt;, &lt;code&gt;commerce.orders&lt;/code&gt;, &lt;code&gt;billing.invoices&lt;/code&gt;, each keyed on &lt;code&gt;id&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The audit trigger: &lt;code&gt;orders&lt;/code&gt; and &lt;code&gt;invoices&lt;/code&gt; both write to &lt;code&gt;audit.change_log&lt;/code&gt; on every change. Every UPDATE you run is recorded there, 4,000,000 rows and counting.&lt;/li&gt;
&lt;li&gt;The one foreign key with no index: &lt;code&gt;billing.payments.invoice_id&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The view nobody understands: &lt;code&gt;billing.monthly_revenue&lt;/code&gt;, over &lt;code&gt;invoices&lt;/code&gt;, &lt;code&gt;payments&lt;/code&gt; and &lt;code&gt;identity.accounts&lt;/code&gt;. A view, &lt;code&gt;billing.revenue_dashboard&lt;/code&gt;, and a function, &lt;code&gt;billing.export_revenue()&lt;/code&gt;, depend on it, and a materialized copy, &lt;code&gt;billing.monthly_revenue_mv&lt;/code&gt;, is refreshed by &lt;code&gt;billing.refresh_revenue()&lt;/code&gt; as &lt;code&gt;reporting_owner&lt;/code&gt;. The view page, which is Pro, shows this under &lt;code&gt;Used by&lt;/code&gt;. It is why you do not rename a column in &lt;code&gt;invoices&lt;/code&gt; on day one. See &lt;a href=&quot;/guide/what-a-view-page-tells-you/&quot;&gt;What a view page tells you&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The diagram draws declared foreign keys only. A relationship the schema never declared is invisible: a column called &lt;code&gt;customer_id&lt;/code&gt; in a table with no edge to &lt;code&gt;customers&lt;/code&gt; looks like any other column. Spot one by its name, then confirm on that table&amp;#39;s &lt;code&gt;Constraints&lt;/code&gt; page, which will say &lt;code&gt;Points to no other table.&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;The row estimate in the inspector and &lt;code&gt;of ~12M&lt;/code&gt; in the status bar are catalog estimates from the last ANALYZE. &lt;code&gt;Count&lt;/code&gt; is exact.&lt;/li&gt;
&lt;li&gt;The layout is saved per diagram in the app&amp;#39;s browser store. Tables you move stay moved on this computer, and nowhere else.&lt;/li&gt;
&lt;li&gt;MySQL, MariaDB, SQLite and SQL Server draw the diagram, open the brief and have the Columns, Indexes and Constraints reports. The value inspector&amp;#39;s column facts come from MySQL 8 histograms there, and MariaDB, SQLite and SQL Server have none. See &lt;a href=&quot;/guide/other-engines/&quot;&gt;MySQL, MariaDB, SQLite and SQL Server&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;The diagram draws only what the catalog declares. I thought about guessing edges from column names and decided against it. A guessed edge looks exactly like a real one, and the point of the first hour is to learn what is actually enforced. A column that looks like a foreign key and isn&amp;#39;t is a finding.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
</content>
  </entry>
  <entry>
    <title>What an index page tells you</title>
    <link href="https://seqora.dev/guide/what-an-index-page-tells-you/" />
    <id>https://seqora.dev/guide/what-an-index-page-tells-you/</id>
    <published>2026-11-13T00:00:00Z</published>
    <updated>2026-11-13T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Read an index page: how its entries are ordered, which queries it serves, what every insert pays for it, and when to drop one nobody uses.</summary>
    <content type="html">&lt;div class=&quot;guide-gate&quot;&gt;
&lt;p&gt;Open an index page when a table has more indexes than you can explain, or when someone asks whether one can go. If the question is whether a new index would help one slow query, &lt;a href=&quot;/guide/will-this-index-help/&quot;&gt;Will this index help?&lt;/a&gt; is the page, and &lt;a href=&quot;/guide/which-indexes-are-missing/&quot;&gt;the index advisor&lt;/a&gt; looks at every index in the database at once. This one reads an index that already exists.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;the-symptom&quot;&gt;The symptom&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-symptom&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;billing.invoices&lt;/code&gt; is 2.3 GB on disk and 656 MB of that is indexes. Someone asks whether &lt;code&gt;invoices_customer_id_idx&lt;/code&gt; can go. The table has 8,100,000 rows, nobody remembers who added the index, and &lt;code&gt;DROP INDEX&lt;/code&gt; on a guess is how a quarterly report gets slow in January.&lt;/p&gt;
&lt;div class=&quot;guide-island objects-stage&quot; data-island=&quot;object-index&quot;&gt;
&lt;div class=&quot;app-window&quot; data-platform=&quot;macos&quot;&gt;
&lt;div class=&quot;app-window-bar&quot; aria-hidden=&quot;true&quot;&gt;
&lt;span class=&quot;app-window-lights&quot;&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span class=&quot;app-window-title&quot;&gt;Seqora&lt;/span&gt;
&lt;span class=&quot;app-window-controls&quot;&gt;
&lt;svg viewBox=&quot;0 0 10 10&quot;&gt;&lt;path d=&quot;M0 5h10&quot; /&gt;&lt;/svg&gt;
&lt;svg viewBox=&quot;0 0 10 10&quot;&gt;&lt;path d=&quot;M.5.5h9v9h-9z&quot; /&gt;&lt;/svg&gt;
&lt;svg viewBox=&quot;0 0 10 10&quot;&gt;&lt;path d=&quot;M0 0l10 10M10 0L0 10&quot; /&gt;&lt;/svg&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div class=&quot;app-surface&quot; data-page=&quot;index&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The index page of &lt;code&gt;billing.invoices_customer_created_idx&lt;/code&gt;, a B-tree on &lt;code&gt;(customer_id, created_at DESC) INCLUDE (status)&lt;/code&gt;, with the one index that overlaps it.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&quot;what-an-index-is&quot;&gt;What an index is&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-an-index-is&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;An index is a copy of a few columns of a table, kept sorted, with a pointer from each entry back to its row. This one holds every &lt;code&gt;customer_id&lt;/code&gt; and &lt;code&gt;created_at&lt;/code&gt; pair in &lt;code&gt;invoices&lt;/code&gt; sorted by customer, so Postgres finds customer 1042&amp;#39;s invoices by walking down a tree instead of reading 8,100,000 rows.&lt;/p&gt;
&lt;p&gt;The header gives the size, 388 MB, and the usage: used 2.8 million times since the statistics were reset on 2026-08-23, and when it was last used.&lt;/p&gt;
&lt;p&gt;Under it, &lt;code&gt;Definition&lt;/code&gt; holds the &lt;code&gt;CREATE INDEX&lt;/code&gt; with &lt;code&gt;Copy&lt;/code&gt;, beside the facts a daily lookup wants: &lt;code&gt;Status&lt;/code&gt;, &lt;code&gt;Method&lt;/code&gt;, &lt;code&gt;Owner&lt;/code&gt;, &lt;code&gt;Constraint&lt;/code&gt; and &lt;code&gt;Serves queries&lt;/code&gt;. A lookup can stop there. &lt;code&gt;On this page&lt;/code&gt; jumps to the sections below, and each section folds to its heading and one line. Seqora remembers what you folded for every index page.&lt;/p&gt;
&lt;p&gt;The page is Pro. On Free the header keeps only the kind, the table and the engine, then &lt;code&gt;Definition&lt;/code&gt;, then a panel, &lt;code&gt;Index details are part of Seqora Pro.&lt;/code&gt;, that lists the sections Pro adds (&lt;a href=&quot;/guide/object-pages/&quot;&gt;Object pages&lt;/a&gt; shows the gate).&lt;/p&gt;
&lt;h2 id=&quot;key&quot;&gt;Key&lt;a class=&quot;guide-anchor&quot; href=&quot;#key&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The signature reads &lt;code&gt;(customer_id asc, created_at desc) include status&lt;/code&gt;, above the first eight entries of the index, grouped by &lt;code&gt;customer_id&lt;/code&gt;. &lt;code&gt;How the entries are ordered&lt;/code&gt; reads the sample for you: to find &lt;code&gt;customer_id = 1042&lt;/code&gt;, Postgres jumps straight to that group and reads down. Entries in a group are already in &lt;code&gt;created_at&lt;/code&gt; order, so &lt;code&gt;ORDER BY created_at&lt;/code&gt; with a &lt;code&gt;LIMIT&lt;/code&gt; stops early.&lt;/p&gt;
&lt;p&gt;The first column decides where an entry sits. The second only orders entries within one value of the first, so a filter on &lt;code&gt;created_at&lt;/code&gt; alone gets nothing here. &lt;code&gt;INCLUDE (status)&lt;/code&gt; copies &lt;code&gt;status&lt;/code&gt; into each entry without making it part of the order: a query that needs only &lt;code&gt;status&lt;/code&gt; can skip the table, but nothing can search by it.&lt;/p&gt;
&lt;h2 id=&quot;queries-it-can-answer&quot;&gt;Queries it can answer&lt;a class=&quot;guide-anchor&quot; href=&quot;#queries-it-can-answer&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;One row per query shape, with the verdict the page prints:&lt;/p&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Shape&lt;/th&gt;
&lt;th&gt;Verdict&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;code&gt;WHERE customer_id = $1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Can use it&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;WHERE customer_id = $1 ORDER BY created_at DESC LIMIT 20&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Can use it&lt;/code&gt;, no sort step&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SELECT status … WHERE customer_id = $1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Can use it&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;WHERE created_at &amp;gt; $1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Can&amp;#39;t use it&lt;/code&gt;, &lt;code&gt;created_at&lt;/code&gt; is second&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;WHERE status = $1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Can&amp;#39;t use it&lt;/code&gt;, &lt;code&gt;status&lt;/code&gt; is only carried&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;h2 id=&quot;with-and-without-this-index&quot;&gt;With and without this index&lt;a class=&quot;guide-anchor&quot; href=&quot;#with-and-without-this-index&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;Compare&lt;/code&gt; beside a shape plans the query with and without this index, hiding it from the planner in your session through &lt;code&gt;hypopg&lt;/code&gt;. For the &lt;code&gt;ORDER BY&lt;/code&gt; shape the headline is &lt;code&gt;About 51× cheaper with it&lt;/code&gt;: planner cost 6.2 with the index, 317 without. Both are estimates, not timings.&lt;/p&gt;
&lt;h2 id=&quot;where-the-space-goes&quot;&gt;Where the space goes&lt;a class=&quot;guide-anchor&quot; href=&quot;#where-the-space-goes&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A treemap draws the table&amp;#39;s rows and each index with area equal to size on disk. &lt;code&gt;invoices&lt;/code&gt; and its indexes take 2.3 GB, and this index is 388 MB of it, 17%.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Each write pays for it&lt;/code&gt;: a new row is written to the table and to up to 3 indexes, this one included. 64% of updates on &lt;code&gt;invoices&lt;/code&gt; are done in place, so no index entry moves. An update that changes &lt;code&gt;customer_id&lt;/code&gt;, &lt;code&gt;created_at&lt;/code&gt; or &lt;code&gt;status&lt;/code&gt; never is, because this index stores them.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Wasted space&lt;/code&gt; estimates what a rebuild would reclaim: about 31 MB here, 8% of the index, so &lt;code&gt;No rebuild needed&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;one-other-index-overlaps-this-one&quot;&gt;One other index overlaps this one&lt;a class=&quot;guide-anchor&quot; href=&quot;#one-other-index-overlaps-this-one&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The table lists each sibling that shares this index&amp;#39;s first column. &lt;code&gt;invoices_customer_id_idx&lt;/code&gt; is 96 MB, has 0 scans and was last used &lt;code&gt;never&lt;/code&gt;, counting since the statistics were reset on 2026-08-23. The page marks it &lt;code&gt;covered by this index&lt;/code&gt;, because every lookup it answers this one answers too: dropping it frees 96 MB and one write per insert, and the foreign key on &lt;code&gt;customer_id&lt;/code&gt; stays indexed by this one.&lt;/p&gt;
&lt;h2 id=&quot;an-index-nobody-uses&quot;&gt;An index nobody uses&lt;a class=&quot;guide-anchor&quot; href=&quot;#an-index-nobody-uses&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;That is the common problem: an index every insert pays for and no query reads. &lt;code&gt;idx_scan&lt;/code&gt; and &lt;code&gt;last_idx_scan&lt;/code&gt; count since the last statistics reset, and the footer says when that was, so check the window first. A month is not long enough for an index that serves a quarterly report. Seqora won&amp;#39;t call an index unused until seven days have passed, and never flags one under 1 MB or one that backs a constraint.&lt;/p&gt;
&lt;p&gt;Then &lt;code&gt;Open DROP in a SQL editor&lt;/code&gt; opens the statement with the caveats as comments, and nothing runs until you run it:&lt;/p&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-comment&quot;&gt;-- invoices_customer_id_idx is covered by invoices_customer_created_idx.&lt;/span&gt;
&lt;span class=&quot;tok-comment&quot;&gt;-- Scan counts are per server: check read replicas before dropping.&lt;/span&gt;
&lt;span class=&quot;tok-key&quot;&gt;DROP&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;INDEX&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;CONCURRENTLY&lt;/span&gt; billing.invoices_customer_id_idx;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;Open in advisor&lt;/code&gt; beside it opens the &lt;a href=&quot;/guide/which-indexes-are-missing/&quot;&gt;index advisor&lt;/a&gt; on this index&amp;#39;s drop row.&lt;/p&gt;
&lt;p&gt;The chips under the sections say &lt;code&gt;Valid and ready&lt;/code&gt;, or &lt;code&gt;Not usable yet&lt;/code&gt; after a &lt;code&gt;CREATE INDEX CONCURRENTLY&lt;/code&gt; that failed, and an invalid index gets a red verdict at the top with &lt;code&gt;Open REINDEX in a SQL editor&lt;/code&gt;. &lt;code&gt;All properties&lt;/code&gt; folds out last.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Usage counts are per server and per statistics reset. An index the primary never reads may be what keeps a reporting replica fast.&lt;/li&gt;
&lt;li&gt;Indexes that back a primary key, unique or exclusion constraint are never called redundant, because they enforce something.&lt;/li&gt;
&lt;li&gt;On MySQL and MariaDB the column is &lt;code&gt;Reads&lt;/code&gt;, not &lt;code&gt;Scans&lt;/code&gt;, and the page offers &lt;code&gt;INVISIBLE&lt;/code&gt; (&lt;code&gt;IGNORED&lt;/code&gt; on MariaDB) as a reversible way to try life without an index. On SQL Server it is &lt;code&gt;Uses&lt;/code&gt;, counted by &lt;code&gt;sys.dm_db_index_usage_stats&lt;/code&gt; since the server started, and there is no &lt;code&gt;With and without this index&lt;/code&gt;. SQLite counts no index usage. The sizes here come from the 12-million-row copy of the sample.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;I drew the space as a treemap because a list of sizes never made me drop anything. Seeing one index as a sixth of the table on disk, next to the sentence about what every insert pays, did.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
</content>
  </entry>
  <entry>
    <title>Connect</title>
    <link href="https://seqora.dev/guide/connect/" />
    <id>https://seqora.dev/guide/connect/</id>
    <published>2026-11-13T00:00:00Z</published>
    <updated>2026-11-13T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Add a PostgreSQL, MySQL, MariaDB, SQLite or SQL Server connection, place it in a workspace and environment, and decide when it may write.</summary>
    <content type="html">&lt;p&gt;Read this the first time you add a database, or when a connection opened read-only and you want
to know why. Every connection goes through the same two-step dialog, and every one opens locked
unless you say otherwise.&lt;/p&gt;
&lt;h2 id=&quot;reach-the-server&quot;&gt;Reach the server&lt;a class=&quot;guide-anchor&quot; href=&quot;#reach-the-server&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Press &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;N&lt;/kbd&gt;&lt;/kbd&gt; on macOS or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;N&lt;/kbd&gt;&lt;/kbd&gt; on Windows. The dialog opens as &lt;code&gt;Connect a database&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Pick the engine. &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Alt&lt;/kbd&gt;&lt;kbd&gt;1&lt;/kbd&gt;&lt;/kbd&gt; to &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Alt&lt;/kbd&gt;&lt;kbd&gt;5&lt;/kbd&gt;&lt;/kbd&gt; choose PostgreSQL, MySQL, MariaDB, SQLite and SQL Server,
in that order.&lt;/li&gt;
&lt;li&gt;Give it the address. Paste a URL such as &lt;code&gt;postgresql://app@db.internal:5432/commerce&lt;/code&gt; into
&lt;code&gt;Connection URL&lt;/code&gt;, or fill in &lt;code&gt;Host&lt;/code&gt;, &lt;code&gt;Port&lt;/code&gt;, &lt;code&gt;Username&lt;/code&gt;, &lt;code&gt;Password&lt;/code&gt; and &lt;code&gt;Database&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click the TLS chip under the fields if this server needs another mode.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Connect&lt;/code&gt;. The button reads &lt;code&gt;Connecting…&lt;/code&gt; while it works.&lt;/li&gt;
&lt;/ol&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/connect-step-one.webp?v=768f9a159f&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/connect-step-one-800.webp?v=04a9419fa6&quot; srcset=&quot;/guide/shots/connect-step-one-800.webp?v=04a9419fa6 800w, /guide/shots/connect-step-one.webp?v=768f9a159f 1200w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(600px, 46rem)&quot; width=&quot;600&quot; height=&quot;520&quot; alt=&quot;The Connect a database dialog with PostgreSQL chosen and a connection URL filled in, its host, port, username and database below, and three chips.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;A pasted URL fills the fields. A host that isn&amp;#39;t local starts at &lt;code&gt;TLS required&lt;/code&gt;, and the URL shows it as &lt;code&gt;sslmode=require&lt;/code&gt;.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;A URL already on your clipboard shows up as &lt;code&gt;Connection URL on your clipboard&lt;/code&gt;, with &lt;code&gt;Use it&lt;/code&gt;.
A password inside the URL moves to the &lt;code&gt;Password&lt;/code&gt; field and is never kept in the URL. SQLite asks
for a &lt;code&gt;Database file&lt;/code&gt; instead and stores only its path. &lt;code&gt;Database&lt;/code&gt; is &lt;code&gt;Optional&lt;/code&gt; on MySQL and
MariaDB and &lt;code&gt;Required&lt;/code&gt; on SQL Server.&lt;/p&gt;
&lt;p&gt;SQL Server also takes an &lt;code&gt;Instance&lt;/code&gt;, such as &lt;code&gt;SQLEXPRESS&lt;/code&gt;, and asks how to sign in: &lt;code&gt;SQL login&lt;/code&gt;,
&lt;code&gt;Entra token&lt;/code&gt; (a Microsoft Entra access token pasted where the password goes), or &lt;code&gt;Windows&lt;/code&gt;, which
signs in as the account you&amp;#39;re logged in to Windows with and saves no password. &lt;code&gt;Windows&lt;/code&gt; is
greyed out on macOS.&lt;/p&gt;
&lt;p&gt;There&amp;#39;s no test button. &lt;code&gt;Connect&lt;/code&gt; is the test, and a failure keeps you on this step. A wrong
field is marked with &lt;code&gt;Seqora couldn’t connect.&lt;/code&gt;. Anything else says what went wrong and names
the engine, such as &amp;quot;PostgreSQL rejected the credentials for “app”. Check the username and
password.&amp;quot;, and a slow or TLS failure offers a one-click &lt;code&gt;Retry with a 30s timeout&lt;/code&gt; or
&lt;code&gt;Retry without certificate verification&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&quot;other-ways-in&quot;&gt;Other ways in&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Import connections…&lt;/code&gt;, at the bottom of this step and in the command palette, reads
&lt;code&gt;.pgpass&lt;/code&gt;, &lt;code&gt;pg_service.conf&lt;/code&gt;, a MySQL option file, a &lt;code&gt;.env&lt;/code&gt; file, and the saved connections of
DBeaver, DataGrip and TablePlus, SQL Server ones among them. It also reads the SQL Server
connections saved in &lt;a href=&quot;/guide/coming-from-azure-data-studio/&quot;&gt;Azure Data Studio&lt;/a&gt;, and on Windows the registered servers of SQL Server
Management Studio. Nothing is uploaded. Those tools&amp;#39; encrypted passwords aren&amp;#39;t
read, so an imported connection asks for its password the first time you connect. Imported
connections start offline and locked.&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;seqora://connect?url=…&lt;/code&gt; link opens this dialog with the URL filled in and the banner
&lt;code&gt;From a link. Check it before you connect.&lt;/code&gt;. PostgreSQL, MySQL, MariaDB and SQL Server URLs
(&lt;code&gt;sqlserver://&lt;/code&gt; or &lt;code&gt;mssql://&lt;/code&gt;) are accepted.&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;.sqlite&lt;/code&gt; file double-clicked in the OS, dropped on the window, or opened with &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;O&lt;/kbd&gt;&lt;/kbd&gt; or
&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;O&lt;/kbd&gt;&lt;/kbd&gt; opens on its saved connection, or lands here already tested and waiting for a name.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;tls-modes&quot;&gt;TLS modes&lt;/h3&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Mode&lt;/th&gt;
&lt;th&gt;What the dialog says&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Prefer&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Uses TLS when the server offers it.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Require&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Refuses to connect without TLS.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Verify&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Requires TLS and checks the certificate and hostname.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Off&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Sends traffic unencrypted. Use only on trusted networks.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;SQL Server adds a fifth, &lt;code&gt;Strict&lt;/code&gt;: TLS starts before any SQL Server traffic and the certificate is
always checked (TDS 8.0). It needs SQL Server 2022 or Azure SQL.&lt;/p&gt;
&lt;p&gt;Use &lt;code&gt;Verify&lt;/code&gt; for anything on the public internet. &lt;code&gt;Require&lt;/code&gt; encrypts but doesn&amp;#39;t check who
answered.&lt;/p&gt;
&lt;h3 id=&quot;through-a-bastion&quot;&gt;Through a bastion&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Click the &lt;code&gt;No SSH tunnel&lt;/code&gt; chip.&lt;/li&gt;
&lt;li&gt;Turn on &lt;code&gt;Connect through an SSH tunnel&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Pick a host listed under &lt;code&gt;From ~/.ssh/config&lt;/code&gt;, or fill in &lt;code&gt;SSH host&lt;/code&gt;, &lt;code&gt;Port&lt;/code&gt; and &lt;code&gt;SSH username&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Choose how to sign in. &lt;code&gt;Private key&lt;/code&gt; takes a key file such as &lt;code&gt;~/.ssh/id_ed25519&lt;/code&gt; and an
optional &lt;code&gt;Passphrase&lt;/code&gt;. &lt;code&gt;Password&lt;/code&gt; takes an &lt;code&gt;SSH password&lt;/code&gt;. &lt;code&gt;SSH agent&lt;/code&gt; uses the keys your
agent already holds: ssh-agent, Pageant or 1Password.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Connect&lt;/code&gt;. The first time you reach a server, the panel stops at &lt;code&gt;Trust this SSH server?&lt;/code&gt; with the host&amp;#39;s fingerprint. Check it against the one the server&amp;#39;s administrator
gave you, then click &lt;code&gt;Trust and connect&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/connect-ssh-tunnel.webp?v=ee7ef6f430&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/connect-ssh-tunnel-800.webp?v=6cbc172add&quot; srcset=&quot;/guide/shots/connect-ssh-tunnel-800.webp?v=6cbc172add 800w, /guide/shots/connect-ssh-tunnel.webp?v=ee7ef6f430 1200w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(600px, 46rem)&quot; width=&quot;600&quot; height=&quot;780&quot; alt=&quot;The Connect a database dialog with an SSH tunnel turned on: a host from the SSH config, the SSH host, port and username, and the sign-in choices.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;The &lt;code&gt;No SSH tunnel&lt;/code&gt; chip open, with a host picked from &lt;code&gt;~/.ssh/config&lt;/code&gt;.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The chip now reads &lt;code&gt;SSH via bastion.internal&lt;/code&gt;. A passphrase or SSH password is stored
encrypted on this device, next to the database password. If the server&amp;#39;s key changes later,
Seqora refuses to connect and offers &lt;code&gt;Forget the saved host key&lt;/code&gt;, which you should click only
when you know why the key changed.&lt;/p&gt;
&lt;p&gt;The third chip sets &lt;code&gt;Connection timeout&lt;/code&gt; in seconds, 10 unless you changed the setting of the
same name.&lt;/p&gt;
&lt;h2 id=&quot;name-it-and-place-it&quot;&gt;Name it and place it&lt;a class=&quot;guide-anchor&quot; href=&quot;#name-it-and-place-it&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;After &lt;code&gt;Connect&lt;/code&gt; succeeds the dialog shows &lt;code&gt;Connected · PostgreSQL&lt;/code&gt; and the server version.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Type a &lt;code&gt;Name&lt;/code&gt;, for example &lt;code&gt;commerce-primary&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Choose the &lt;code&gt;Database&lt;/code&gt; from the list the server reported.&lt;/li&gt;
&lt;li&gt;Choose or type a &lt;code&gt;Workspace&lt;/code&gt;. A new one asks for a &lt;code&gt;New workspace color&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Choose or type an &lt;code&gt;Environment&lt;/code&gt;, such as &lt;code&gt;dev&lt;/code&gt;, &lt;code&gt;staging&lt;/code&gt; or &lt;code&gt;prod&lt;/code&gt;. A server on this
computer starts in &lt;code&gt;Development&lt;/code&gt;. A remote one starts with no environment, so a production
database is never filed under &lt;code&gt;Development&lt;/code&gt; by accident, and a host or name that mentions
production offers &lt;code&gt;Use Production&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Leave &lt;code&gt;Open read-only&lt;/code&gt; on unless you are about to write.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Save connection&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/connect-step-two.webp?v=d0c0d92b87&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/connect-step-two-800.webp?v=2352a5ec1a&quot; srcset=&quot;/guide/shots/connect-step-two-800.webp?v=2352a5ec1a 800w, /guide/shots/connect-step-two.webp?v=d0c0d92b87 1200w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(600px, 46rem)&quot; width=&quot;600&quot; height=&quot;568&quot; alt=&quot;The Save connection dialog: connected to PostgreSQL 17, named commerce-primary, in a new workspace Commerce and environment prod, with Open read-only on.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;&lt;code&gt;prod&lt;/code&gt; is a production name, so &lt;code&gt;Open read-only&lt;/code&gt; is on and says why.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The connection appears in the sidebar under its workspace and environment, with a lock beside it.
The first time you connect to a database, its brief opens in a tab:
&lt;a href=&quot;/guide/what-is-in-this-database/&quot;&gt;What is in this database?&lt;/a&gt; reads it. &lt;code&gt;Open the brief of a new database&lt;/code&gt;, in Settings › General, turns that off.&lt;/p&gt;
&lt;h2 id=&quot;where-the-password-goes&quot;&gt;Where the password goes&lt;a class=&quot;guide-anchor&quot; href=&quot;#where-the-password-goes&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Seqora keeps connection profiles and passwords in a SQLite database on your computer, encrypted
with SQLCipher. The key to that database lives in Windows Credential Manager on Windows,
your login keychain on macOS, and a keyring such as GNOME Keyring or KWallet on Linux. Nothing goes into a config file. If the keychain refuses to hand
over the key, Seqora shows &lt;code&gt;Seqora could not unlock your workspace&lt;/code&gt; instead of opening the store.&lt;/p&gt;
&lt;h2 id=&quot;why-it-opens-locked&quot;&gt;Why it opens locked&lt;a class=&quot;guide-anchor&quot; href=&quot;#why-it-opens-locked&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;Lock writes by default&lt;/code&gt;, in Settings › Connections and safety, is on from install. So every new
connection starts with &lt;code&gt;Open read-only&lt;/code&gt; on, its lock reads &lt;code&gt;Locked · read-only&lt;/code&gt;, and the status
bar shows &lt;code&gt;Read-only&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;A locked connection refuses anything Seqora cannot prove is a read, with &amp;quot;This connection is
locked and only read-only SQL can run.&amp;quot; It also disables &lt;code&gt;Begin&lt;/code&gt; and &lt;code&gt;Commit&lt;/code&gt;, stops table
edits with &amp;quot;Unlock the connection to change rows.&amp;quot;, and blocks applying a schema design.&lt;/p&gt;
&lt;p&gt;To unlock:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Click the lock beside the connection in the sidebar, or the &lt;code&gt;Locked · read-only&lt;/code&gt; button in an
editor&amp;#39;s header.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Unlock&lt;/code&gt; in the &lt;code&gt;Unlock for writes?&lt;/code&gt; popover next to the lock. On a production
connection it reads &lt;code&gt;Unlock production for writes?&lt;/code&gt;, &lt;code&gt;Cancel&lt;/code&gt; has the focus, and the button
is a red &lt;code&gt;Unlock production&lt;/code&gt;. &lt;code&gt;Cancel&lt;/code&gt;, &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Esc&lt;/kbd&gt;&lt;/kbd&gt; or a click outside backs out.&lt;/li&gt;
&lt;/ol&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/review-unlock.webp?v=ec87311cf3&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/review-unlock.webp?v=ec87311cf3&quot; width=&quot;265&quot; height=&quot;143&quot; alt=&quot;The Unlock production for writes popover next to the lock, naming commerce-primary in prod, with Cancel and Unlock production buttons.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;p&gt;The lock now reads &lt;code&gt;Unlocked · writes enabled&lt;/code&gt;. To lock it again, click the same lock, or run
&lt;code&gt;Lock writes: commerce-primary&lt;/code&gt; from the command palette. &lt;code&gt;Re-lock after unlocking&lt;/code&gt;, in
Settings › Connections and safety, locks it again after a set time once running SQL and open
transactions finish. Left at &lt;code&gt;Never&lt;/code&gt;, a production connection still locks again after 15
minutes.&lt;/p&gt;
&lt;h2 id=&quot;what-naming-an-environment-prod-changes&quot;&gt;What naming an environment prod changes&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-naming-an-environment-prod-changes&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;There is no production checkbox. An environment with &lt;code&gt;prod&lt;/code&gt; or &lt;code&gt;production&lt;/code&gt; as one of its
words, such as &lt;code&gt;prod-eu&lt;/code&gt;, &lt;code&gt;EU Prod&lt;/code&gt; or &lt;code&gt;prod2&lt;/code&gt;, changes four things:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Open read-only&lt;/code&gt; is on even if &lt;code&gt;Lock writes by default&lt;/code&gt; is off, with the note &amp;quot;On by default
for production. Unlock from the explorer when you need to write.&amp;quot;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Review staged changes&lt;/code&gt; shows a &lt;code&gt;Production&lt;/code&gt; badge, its apply button turns red, and it needs
&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;↩&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt; rather than a bare &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt;.&lt;/li&gt;
&lt;li&gt;Applying a schema design asks you to type the database name: &amp;quot;This is a production
connection. Type &lt;code&gt;commerce&lt;/code&gt; to apply.&amp;quot;&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;Review high-risk SQL&lt;/code&gt; panel asks you to type the connection&amp;#39;s name, &lt;code&gt;commerce-primary&lt;/code&gt;,
where other environments confirm with a click or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;↩&lt;/kbd&gt;&lt;/kbd&gt; / &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;An environment called &lt;code&gt;live&lt;/code&gt; gets none of this, and neither do &lt;code&gt;pre-prod&lt;/code&gt;, &lt;code&gt;non-prod&lt;/code&gt; or
&lt;code&gt;preprod&lt;/code&gt;, because the word before &lt;code&gt;prod&lt;/code&gt; says they aren&amp;#39;t. Name it for what it is. The same
rule decides which imported connections open locked and when Analyze asks before a write.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The lock is Seqora&amp;#39;s, not the server&amp;#39;s. For a guarantee, connect as a database user that only
has &lt;code&gt;SELECT&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;SQLite connections are a file path. There is no TLS or SSH tunnel to set.&lt;/li&gt;
&lt;li&gt;SQL Server&amp;#39;s &lt;code&gt;Windows&lt;/code&gt; sign-in works only when Seqora runs on Windows. An Entra token expires
after about an hour, and the server refuses it after that until you paste a fresh one.&lt;/li&gt;
&lt;li&gt;A named SQL Server instance (&lt;code&gt;Instance&lt;/code&gt;, or &lt;code&gt;host\SQLEXPRESS&lt;/code&gt;) is found through the SQL Server
Browser on UDP 1434. Through an SSH tunnel, leave &lt;code&gt;Instance&lt;/code&gt; empty and give the instance&amp;#39;s TCP
port instead.&lt;/li&gt;
&lt;li&gt;Seqora speaks SSH itself rather than running your system &lt;code&gt;ssh&lt;/code&gt;. It reads &lt;code&gt;~/.ssh/config&lt;/code&gt; for
each host&amp;#39;s &lt;code&gt;HostName&lt;/code&gt;, &lt;code&gt;Port&lt;/code&gt;, &lt;code&gt;User&lt;/code&gt; and &lt;code&gt;IdentityFile&lt;/code&gt;, and &lt;code&gt;known_hosts&lt;/code&gt; for keys it has
already seen. Other options in the config, such as &lt;code&gt;ProxyJump&lt;/code&gt;, are not followed.&lt;/li&gt;
&lt;li&gt;Changing &lt;code&gt;Lock writes by default&lt;/code&gt; affects connections you add afterwards. Existing ones keep
their lock state.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;Most of the time you open a database to look at it, and the two mistakes are not the same size.
Unlocking a connection you meant to write to costs a click. Writing to one you meant to read can
cost a restore and an apology to whoever owned the rows. So the default is the cheap mistake,
and the lock sits in the sidebar where you can see which windows can do damage before you type.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
</content>
  </entry>
  <entry>
    <title>Run, cancel, and transactions</title>
    <link href="https://seqora.dev/guide/run-cancel-and-transactions/" />
    <id>https://seqora.dev/guide/run-cancel-and-transactions/</id>
    <published>2026-11-13T00:00:00Z</published>
    <updated>2026-11-13T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Run one statement or a whole script, stop a query that is taking too long, and hold a change in a transaction until you have checked it.</summary>
    <content type="html">&lt;p&gt;Read this before you run something that writes, or when a query has been running longer than
you expected. It covers what each key runs, how to stop it, and how to keep a change open until
you have looked at the result.&lt;/p&gt;
&lt;h2 id=&quot;run-a-statement&quot;&gt;Run a statement&lt;a class=&quot;guide-anchor&quot; href=&quot;#run-a-statement&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Put the cursor anywhere inside the statement, or select the text you want.&lt;/li&gt;
&lt;li&gt;Press &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;↩&lt;/kbd&gt;&lt;/kbd&gt; on macOS or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt; on Windows.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;That is &lt;code&gt;Run selection or current statement&lt;/code&gt;, the &lt;code&gt;Run&lt;/code&gt; button in the editor&amp;#39;s toolbar. To run
every statement in the editor, press &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;↩&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt;: &lt;code&gt;Run entire script&lt;/code&gt;, the
&lt;code&gt;Run all&lt;/code&gt; button. &lt;code&gt;Run all&lt;/code&gt; sends the whole script as one request and the server runs its
statements in order.&lt;/p&gt;
&lt;h2 id=&quot;read-the-result-pane&quot;&gt;Read the result pane&lt;a class=&quot;guide-anchor&quot; href=&quot;#read-the-result-pane&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The editor&amp;#39;s footer carries the run: &lt;code&gt;Running&lt;/code&gt; with a timer counting up, then &lt;code&gt;Completed&lt;/code&gt;,
&lt;code&gt;Failed&lt;/code&gt; or &lt;code&gt;Cancelled&lt;/code&gt;, with the rows loaded, the rows affected, the time, and &lt;code&gt;N notices&lt;/code&gt;
when the server sent any.&lt;/p&gt;
&lt;p&gt;The pane under the editor is headed &lt;code&gt;Result&lt;/code&gt;, &lt;code&gt;Chart&lt;/code&gt; and &lt;code&gt;Plan&lt;/code&gt;, then &lt;code&gt;N rows · M columns&lt;/code&gt;. &lt;code&gt;Chart&lt;/code&gt;
draws the rows, as &lt;a href=&quot;/guide/chart-a-query-result/&quot;&gt;Chart a query result&lt;/a&gt; shows. A script
with several result sets shows a &lt;code&gt;Result set&lt;/code&gt; group numbered &lt;code&gt;1&lt;/code&gt;, &lt;code&gt;2&lt;/code&gt;, &lt;code&gt;3&lt;/code&gt;. Pick one to see
its rows. Notices, such as a &lt;code&gt;RAISE NOTICE&lt;/code&gt; from a function, are listed under &lt;code&gt;Run details&lt;/code&gt;
as &lt;code&gt;N notices&lt;/code&gt;, each marked with its &lt;code&gt;Statement N&lt;/code&gt;.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/run-editor-and-result.webp?v=86476cb352&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/run-editor-and-result-800.webp?v=c0b1c84edf&quot; srcset=&quot;/guide/shots/run-editor-and-result-800.webp?v=c0b1c84edf 800w, /guide/shots/run-editor-and-result.webp?v=86476cb352 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;622&quot; alt=&quot;A query that has run: Completed, 20 loaded and the time in the editor&amp;#39;s footer, and the Result, Chart and Plan switch and 20 rows in the pane below.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;p&gt;A failed run keeps its time and shows an error card in place of the grid. The card has the
message, its &lt;code&gt;SQLSTATE&lt;/code&gt; on PostgreSQL, where it failed (&lt;code&gt;Statement 2 of 3 · Line 4, column 8&lt;/code&gt; in
a script), the failed line with a caret under what the server pointed at, and the &lt;code&gt;Detail&lt;/code&gt;,
&lt;code&gt;Hint&lt;/code&gt; and &lt;code&gt;Context&lt;/code&gt; the server sent. The editor marks the same position. Under them sit the
actions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A quick fix, when one applies: &lt;code&gt;Add IF NOT EXISTS&lt;/code&gt; for an object that already exists,
&lt;code&gt;Add IF EXISTS&lt;/code&gt; for a &lt;code&gt;DROP&lt;/code&gt; of one that doesn&amp;#39;t, or &lt;code&gt;Use orders.status&lt;/code&gt; for a misspelt
column. It changes the SQL in the editor. Run it again to apply it.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Go to line 4&lt;/code&gt; selects the failure in the editor.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Copy error&lt;/code&gt; copies the error as text, laid out the way &lt;code&gt;psql&lt;/code&gt; prints it.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Reconnect and retry&lt;/code&gt; when the connection failed, not the SQL.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Show earlier results&lt;/code&gt; when statements before the failure returned rows.&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/run-failed.webp?v=b65b62a5d0&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/run-failed-800.webp?v=b57fd90aa7&quot; srcset=&quot;/guide/shots/run-failed-800.webp?v=b57fd90aa7 800w, /guide/shots/run-failed.webp?v=b65b62a5d0 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;622&quot; alt=&quot;A failed run: Failed in the footer and a marker in the SQL, and a card with column statuss does not exist, SQLSTATE 42703, the hint from the server, and Use orders.status.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;The server&amp;#39;s &lt;code&gt;Hint&lt;/code&gt; becomes a button: &lt;code&gt;Use orders.status&lt;/code&gt; fixes the typo.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;Plan&lt;/code&gt; switches from the rows to how the database got them. &lt;code&gt;Plan&lt;/code&gt; is Pro, and
&lt;a href=&quot;/guide/why-is-this-query-slow/&quot;&gt;Why is this query slow?&lt;/a&gt; reads one. Sorting and filtering a
result happen in memory. Nothing is re-run.&lt;/p&gt;
&lt;h2 id=&quot;the-row-cap&quot;&gt;The row cap&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-row-cap&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Seqora keeps at most &lt;code&gt;Rows kept per result&lt;/code&gt; rows of each result, and stops earlier if the rows
grow too large in bytes. The default is 10,000, and the other choices are 1,000, 50,000 and
100,000. Run &lt;code&gt;SELECT * FROM commerce.orders&lt;/code&gt; and the grid holds the first 10,000 of
12,000,000. The footer says so with &lt;code&gt;Row limit reached&lt;/code&gt;, or &lt;code&gt;Size limit reached&lt;/code&gt; for the byte
cap, and its &lt;code&gt;Change limit&lt;/code&gt; link opens the setting.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/run-row-cap.webp?v=511ee4a3f1&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/run-row-cap-800.webp?v=0da7ce18d4&quot; srcset=&quot;/guide/shots/run-row-cap-800.webp?v=0da7ce18d4 800w, /guide/shots/run-row-cap.webp?v=511ee4a3f1 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;622&quot; alt=&quot;SELECT star from commerce.orders on a locked connection, with Row limit reached, stopped on the server after 10,000 rows, and Change limit in the footer.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;On a locked connection the read stops on the server.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;What happens to the rest depends on where you ran it. On a locked connection, outside a
transaction, Seqora stops a plain read on the server at the cap, with &lt;code&gt;pg_cancel_backend&lt;/code&gt; on
PostgreSQL and &lt;code&gt;KILL QUERY&lt;/code&gt; on MySQL and MariaDB, and the footer reads
&lt;code&gt;Row limit reached · stopped on the server after 10,000 rows&lt;/code&gt;. The total is unknown then.
Anywhere else the server sends every row and Seqora reads and drops them, so the footer can say
&lt;code&gt;11,990,000 more not kept&lt;/code&gt;. On PostgreSQL the stop also waits until the session has written
nothing, so a &lt;code&gt;SELECT&lt;/code&gt; that calls a writing function is never cut short. Add a &lt;code&gt;LIMIT&lt;/code&gt; when you
only want to look.&lt;/p&gt;
&lt;h2 id=&quot;cancel&quot;&gt;Cancel&lt;a class=&quot;guide-anchor&quot; href=&quot;#cancel&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Click &lt;code&gt;Cancel run&lt;/code&gt;. It sits where &lt;code&gt;Run&lt;/code&gt; was while a query runs.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;.&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;.&lt;/kbd&gt;&lt;/kbd&gt; does the same wherever focus is, and so does &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Esc&lt;/kbd&gt;&lt;/kbd&gt; inside the editor&amp;#39;s result
pane. The button reads &lt;code&gt;Cancellation requested…&lt;/code&gt; until the server stops, and then the
statement&amp;#39;s status becomes &lt;code&gt;Cancelled&lt;/code&gt;. The palette has the same action as
&lt;code&gt;Cancel running query&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;For a limit that doesn&amp;#39;t need you watching, set Settings › Connections and safety ›
&lt;code&gt;Statement timeout&lt;/code&gt;: &lt;code&gt;Off&lt;/code&gt; by default, or 30 seconds up to an hour. On PostgreSQL it is
&lt;code&gt;statement_timeout&lt;/code&gt; for the editor&amp;#39;s session. On MySQL, MariaDB and SQLite, Seqora stops the
statement at the deadline the same way &lt;code&gt;Cancel run&lt;/code&gt; does.&lt;/p&gt;
&lt;h2 id=&quot;hold-a-change-in-a-transaction&quot;&gt;Hold a change in a transaction&lt;a class=&quot;guide-anchor&quot; href=&quot;#hold-a-change-in-a-transaction&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The badge next to the run buttons shows the editor&amp;#39;s transaction state, and only the buttons
that make sense for that state are shown.&lt;/p&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Badge&lt;/th&gt;
&lt;th&gt;What it means&lt;/th&gt;
&lt;th&gt;Buttons&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Autocommit&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No open transaction. Each statement commits as it finishes.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Begin&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Manual commit&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No open transaction yet. The next run begins one.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Begin&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Transaction open&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Changes are made but not committed.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Commit&lt;/code&gt;, &lt;code&gt;Rollback&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Transaction failed&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A statement failed inside the transaction. Roll back to continue.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Rollback&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;State unknown&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Seqora could not confirm the state with the server.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Rollback&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Connection lost&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The server closed the editor&amp;#39;s connection and any open transaction with it. Refresh or run to reconnect.&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Disconnected&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The connection is down. Reconnect to continue.&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Unavailable&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Seqora has not read a transaction state for this editor yet.&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;Refresh transaction&lt;/code&gt; asks the server again in any state. An editor starts in &lt;code&gt;Autocommit&lt;/code&gt;
unless Settings › SQL editor › &lt;code&gt;New editors start in&lt;/code&gt; is set to &lt;code&gt;Manual commit&lt;/code&gt;, which begins a
transaction before the first run so every change waits for &lt;code&gt;Commit&lt;/code&gt;.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Click &lt;code&gt;Begin&lt;/code&gt;. The badge reads &lt;code&gt;Transaction open&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;UPDATE commerce.orders SET status = &amp;#39;cancelled&amp;#39; WHERE id = 81723;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Check the result: one row affected, and a &lt;code&gt;SELECT&lt;/code&gt; shows the new status.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Commit&lt;/code&gt; to keep it, or &lt;code&gt;Rollback&lt;/code&gt; to &amp;quot;Discard every change since Begin&amp;quot;.&lt;/li&gt;
&lt;/ol&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/run-transaction-open.webp?v=a18542ac63&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/run-transaction-open-800.webp?v=5600626b7d&quot; srcset=&quot;/guide/shots/run-transaction-open-800.webp?v=5600626b7d 800w, /guide/shots/run-transaction-open.webp?v=a18542ac63 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;235&quot; alt=&quot;An editor after an UPDATE inside a transaction: the Transaction open badge with Commit and Rollback, the connection unlocked, and 1 row affected in the footer.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;One row changed and nothing committed.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;Begin&lt;/code&gt; and &lt;code&gt;Commit&lt;/code&gt; are disabled on a locked connection. Unlock it first, as
&lt;a href=&quot;/guide/connect/&quot;&gt;Connect&lt;/a&gt; explains. Run the &lt;code&gt;UPDATE&lt;/code&gt; while the connection is still locked and
nothing runs: the footer reads &lt;code&gt;Failed&lt;/code&gt; and the lock button in the editor&amp;#39;s header lights up,
with &amp;quot;This connection is locked, so only read-only SQL can run. Unlock it to run this SQL.&amp;quot; in
its tooltip. Click it to unlock, and focus goes back to your SQL.&lt;/p&gt;
&lt;p&gt;On MySQL and MariaDB the server&amp;#39;s error replies don&amp;#39;t carry the transaction state. A plain
statement that fails in autocommit leaves the badge at &lt;code&gt;Autocommit&lt;/code&gt;. An error inside a
transaction, with autocommit off, or in a &lt;code&gt;CALL&lt;/code&gt; or &lt;code&gt;EXECUTE&lt;/code&gt;, leaves it at &lt;code&gt;State unknown&lt;/code&gt;:
&lt;code&gt;Run&lt;/code&gt;, &lt;code&gt;Run all&lt;/code&gt;, &lt;code&gt;Begin&lt;/code&gt; and &lt;code&gt;Commit&lt;/code&gt; are disabled until &lt;code&gt;Rollback&lt;/code&gt; or &lt;code&gt;Refresh transaction&lt;/code&gt;
settles it.&lt;/p&gt;
&lt;p&gt;An editor with an open transaction can&amp;#39;t be closed quietly. Closing its tab, or its pane in a
split, opens &lt;code&gt;Transaction still open&lt;/code&gt; with &lt;code&gt;Keep editing&lt;/code&gt; and &lt;code&gt;Roll back and close&lt;/code&gt;. A query
still running opens &lt;code&gt;Query still running&lt;/code&gt; with &lt;code&gt;Cancel query and close&lt;/code&gt;. Changing the editor&amp;#39;s
connection, or disconnecting, is refused with &amp;quot;Commit or roll back the open transaction before
changing this editor’s connection.&amp;quot;&lt;/p&gt;
&lt;h2 id=&quot;review-high-risk-sql&quot;&gt;Review high-risk SQL&lt;a class=&quot;guide-anchor&quot; href=&quot;#review-high-risk-sql&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Statements that remove or change something stop and ask before they run, in every environment:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;statements starting with &lt;code&gt;DROP&lt;/code&gt;, &lt;code&gt;TRUNCATE&lt;/code&gt;, &lt;code&gt;ALTER&lt;/code&gt;, &lt;code&gt;GRANT&lt;/code&gt;, &lt;code&gt;REVOKE&lt;/code&gt;, &lt;code&gt;COPY&lt;/code&gt;, &lt;code&gt;DO&lt;/code&gt;,
&lt;code&gt;CALL&lt;/code&gt;, &lt;code&gt;VACUUM&lt;/code&gt; or &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt;. A &lt;code&gt;DROP TABLE&lt;/code&gt; gives &amp;quot;Removes the table and every row
in it.&amp;quot;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;CREATE OR REPLACE&lt;/code&gt;, and a &lt;code&gt;CREATE&lt;/code&gt; of anything but a table, view, index, schema, sequence,
type or domain, such as a trigger, policy, role or function&lt;/li&gt;
&lt;li&gt;on PostgreSQL, a &lt;code&gt;CREATE INDEX&lt;/code&gt; without &lt;code&gt;CONCURRENTLY&lt;/code&gt;, since it blocks writes while it
builds, and a table created &lt;code&gt;PARTITION OF&lt;/code&gt; or &lt;code&gt;INHERITS&lt;/code&gt; another&lt;/li&gt;
&lt;li&gt;a &lt;code&gt;WITH&lt;/code&gt; query that writes&lt;/li&gt;
&lt;li&gt;an &lt;code&gt;UPDATE&lt;/code&gt; or &lt;code&gt;DELETE&lt;/code&gt; with no top-level &lt;code&gt;WHERE&lt;/code&gt;: &amp;quot;No WHERE clause, so this changes every
row in the table.&amp;quot;&lt;/li&gt;
&lt;li&gt;anything Seqora can&amp;#39;t classify, &lt;code&gt;ANALYZE&lt;/code&gt; among them: &amp;quot;Seqora could not prove this statement
is read-only.&amp;quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A plain &lt;code&gt;CREATE TABLE&lt;/code&gt;, &lt;code&gt;CREATE VIEW&lt;/code&gt; or &lt;code&gt;CREATE INDEX CONCURRENTLY&lt;/code&gt; only adds an object, so it
runs without asking, like an &lt;code&gt;INSERT&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Run &lt;code&gt;UPDATE commerce.orders SET status = &amp;#39;cancelled&amp;#39;;&lt;/code&gt; on &lt;code&gt;prod&lt;/code&gt; and this happens:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Read the &lt;code&gt;Review high-risk SQL&lt;/code&gt; panel, which opens in the editor&amp;#39;s result pane, or under the
SQL when the editor has no result pane. It lists the first line
of each statement it stopped for with the reason, and the target as environment, connection
and database, for example &lt;code&gt;prod / commerce-primary / commerce · production connection&lt;/code&gt;, with
the schema after the database when one is selected.&lt;/li&gt;
&lt;li&gt;Type the connection&amp;#39;s name in the box under &amp;quot;Type commerce-primary to confirm&amp;quot;. The box has
focus, so nothing you type lands in the SQL. Outside production there is no box.&lt;/li&gt;
&lt;li&gt;Press &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt;, &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;↩&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt;, or click &lt;code&gt;Confirm and run&lt;/code&gt;. The Run shortcut counts
only as a new press a moment after the panel opens, so the press that ran the statement
can&amp;#39;t also approve it. &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Esc&lt;/kbd&gt;&lt;/kbd&gt;, &lt;code&gt;Cancel&lt;/code&gt; or the toolbar&amp;#39;s &lt;code&gt;Cancel run&lt;/code&gt; leaves the statement
unrun.&lt;/li&gt;
&lt;/ol&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/review-high-risk.webp?v=eb70965b4e&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/review-high-risk-800.webp?v=f70fb85f8b&quot; srcset=&quot;/guide/shots/review-high-risk-800.webp?v=f70fb85f8b 800w, /guide/shots/review-high-risk.webp?v=eb70965b4e 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;235&quot; alt=&quot;The Review high-risk SQL panel in an editor&amp;#39;s result pane: the UPDATE, No WHERE clause, the target prod, commerce-primary, commerce, and a box to type the connection&amp;#39;s name.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;p&gt;Settings › Connections and safety › &lt;code&gt;Confirm high-risk SQL&lt;/code&gt; changes the second step:
&lt;code&gt;Type the name on production&lt;/code&gt; is the default, &lt;code&gt;Type RUN to confirm&lt;/code&gt; asks for &lt;code&gt;RUN&lt;/code&gt; in every
environment, &lt;code&gt;Confirm with a click&lt;/code&gt; drops the typing, and &lt;code&gt;Run without asking&lt;/code&gt; turns the panel
off. A locked connection still refuses writes either way.&lt;/p&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;I review only the statements that remove or change something, and I ask for the connection&amp;#39;s
name only on production. When the panel stopped every &lt;code&gt;CREATE&lt;/code&gt;, a new view on a development
SQLite file asked for the same typing as a &lt;code&gt;DROP&lt;/code&gt; on production, and a check you pass for
harmless SQL is a check you stop reading. The Run shortcut also waits a moment after the panel
opens, so the press that ran the statement can&amp;#39;t approve it.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
&lt;h2 id=&quot;format-and-save&quot;&gt;Format and save&lt;a class=&quot;guide-anchor&quot; href=&quot;#format-and-save&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;Format&lt;/code&gt; in the toolbar, &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;⌥&lt;/kbd&gt;&lt;kbd&gt;F&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;Alt&lt;/kbd&gt;&lt;kbd&gt;F&lt;/kbd&gt;&lt;/kbd&gt;, re-indents the editor. &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;S&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;S&lt;/kbd&gt;&lt;/kbd&gt; is
&lt;code&gt;Save SQL&lt;/code&gt;, which names the editor and keeps it as a &lt;code&gt;.sql&lt;/code&gt; file. Both are covered in
&lt;a href=&quot;/guide/history-and-sql-files/&quot;&gt;History and SQL files&lt;/a&gt;.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;On PostgreSQL each SQL editor holds two server connections: the editor&amp;#39;s own and a read-only
one that watches its transaction. Ten editors use twenty of &lt;code&gt;max_connections&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;In MySQL and MariaDB, a DDL statement such as &lt;code&gt;ALTER TABLE&lt;/code&gt; commits the open transaction.
&lt;code&gt;Rollback&lt;/code&gt; won&amp;#39;t undo it.&lt;/li&gt;
&lt;li&gt;The MySQL and MariaDB editor refuses &lt;code&gt;SET NAMES&lt;/code&gt; and other character set changes, &lt;code&gt;RESET&lt;/code&gt;, a
bare &lt;code&gt;DELIMITER&lt;/code&gt;, and executable comments, because they would change how Seqora reads the
connection. A stored program with a &lt;code&gt;BEGIN … END&lt;/code&gt; body must be wrapped in
&lt;code&gt;DELIMITER $$ … $$&lt;/code&gt;, and a &lt;code&gt;SET sql_mode&lt;/code&gt; must be the last statement of its script. &lt;code&gt;SET&lt;/code&gt;
session variables, &lt;code&gt;PREPARE&lt;/code&gt; and &lt;code&gt;EXECUTE&lt;/code&gt; run after the high-risk review.&lt;/li&gt;
&lt;li&gt;SQLite refuses &lt;code&gt;ATTACH&lt;/code&gt; and &lt;code&gt;DETACH&lt;/code&gt;, allows a fixed list of &lt;code&gt;PRAGMA&lt;/code&gt;s on a locked connection,
and rejects statements with unbound parameters: &amp;quot;Unbound SQL parameters are not supported.&amp;quot;&lt;/li&gt;
&lt;li&gt;Cancelling stops the statement that is running. In autocommit, the statements of a script
that finished before it stay committed, as they would in &lt;code&gt;psql&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry>
    <title>Chart a query result</title>
    <link href="https://seqora.dev/guide/chart-a-query-result/" />
    <id>https://seqora.dev/guide/chart-a-query-result/</id>
    <published>2026-11-13T00:00:00Z</published>
    <updated>2026-11-13T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Draw a line, bar, area, scatter, histogram or big number from a SQL result in Seqora, and change which columns it plots.</summary>
    <content type="html">&lt;p&gt;A grid of about 120 rows tells you each day&amp;#39;s count per channel. It does not show you whether &lt;code&gt;web&lt;/code&gt; orders dip at weekends while the other three channels hold steady. Open a chart when the question is about shape: a trend over days, which of 40 stores carries the revenue, how order totals spread. Stay in the grid when you need exact values or the row behind one.&lt;/p&gt;
&lt;h2 id=&quot;draw-the-chart&quot;&gt;Draw the chart&lt;a class=&quot;guide-anchor&quot; href=&quot;#draw-the-chart&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Run an aggregate in a SQL tab. Orders per day for the last 30 days, split by channel:&lt;/p&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-key&quot;&gt;SELECT&lt;/span&gt; date_trunc(&lt;span class=&quot;tok-string&quot;&gt;&amp;#39;day&amp;#39;&lt;/span&gt;, placed_at) &lt;span class=&quot;tok-key&quot;&gt;AS&lt;/span&gt; day,
       channel,
       count(*) &lt;span class=&quot;tok-key&quot;&gt;AS&lt;/span&gt; orders
&lt;span class=&quot;tok-key&quot;&gt;FROM&lt;/span&gt;   commerce.orders
&lt;span class=&quot;tok-key&quot;&gt;WHERE&lt;/span&gt;  placed_at &amp;gt;= now() - &lt;span class=&quot;tok-key&quot;&gt;interval&lt;/span&gt; &lt;span class=&quot;tok-string&quot;&gt;&amp;#39;30 days&amp;#39;&lt;/span&gt;
&lt;span class=&quot;tok-key&quot;&gt;GROUP&lt;/span&gt;  &lt;span class=&quot;tok-key&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;tok-number&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;tok-number&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;tok-key&quot;&gt;ORDER&lt;/span&gt;  &lt;span class=&quot;tok-key&quot;&gt;BY&lt;/span&gt; &lt;span class=&quot;tok-number&quot;&gt;1&lt;/span&gt;;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The &lt;a href=&quot;/guide/result-pane/&quot;&gt;result pane&lt;/a&gt; shows &lt;code&gt;Result&lt;/code&gt;, &lt;code&gt;Chart&lt;/code&gt; and &lt;code&gt;Plan&lt;/code&gt;. &lt;code&gt;Chart&lt;/code&gt; carries a small sparkline of what it would draw. When the result has nothing to chart, the button is dimmed and its tooltip says &lt;code&gt;Nothing to chart&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;code&gt;Chart&lt;/code&gt;. Seqora draws a line per channel: &lt;code&gt;day&lt;/code&gt; on the X axis, &lt;code&gt;orders&lt;/code&gt; up the side, one coloured series for each of the four channels and a legend above the plot.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Hover the plot. A dashed line snaps to the nearest day, and a card lists that date and each channel&amp;#39;s count. Axis labels are compact (&lt;code&gt;12k&lt;/code&gt;, &lt;code&gt;1.5M&lt;/code&gt;). The card shows the full value.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/chart-orders-by-day.webp?v=27eb39d22a&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/chart-orders-by-day-800.webp?v=0f74d0ced8&quot; srcset=&quot;/guide/shots/chart-orders-by-day-800.webp?v=0f74d0ced8 800w, /guide/shots/chart-orders-by-day.webp?v=27eb39d22a 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;541&quot; alt=&quot;The Chart view of orders per day over 30 days, four channel lines, the legend above, and the hover card on one day listing each channel&amp;#39;s orders.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;The &lt;code&gt;x&lt;/code&gt;, &lt;code&gt;y&lt;/code&gt; and &lt;code&gt;split&lt;/code&gt; chips read &lt;code&gt;day&lt;/code&gt;, &lt;code&gt;orders&lt;/code&gt; and &lt;code&gt;channel&lt;/code&gt;. &lt;code&gt;Line&lt;/code&gt; is pressed.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;ol start=&quot;4&quot;&gt;
&lt;li&gt;&lt;p&gt;Change the chart with the chips in the header. &lt;code&gt;x&lt;/code&gt; picks the axis column, &lt;code&gt;y&lt;/code&gt; picks the measure, &lt;code&gt;split&lt;/code&gt; picks the column whose values become series, or &lt;code&gt;None&lt;/code&gt;. The type buttons switch between &lt;code&gt;Line&lt;/code&gt;, &lt;code&gt;Area&lt;/code&gt;, &lt;code&gt;Bar&lt;/code&gt;, &lt;code&gt;Scatter&lt;/code&gt;, &lt;code&gt;Number&lt;/code&gt; and &lt;code&gt;Histogram&lt;/code&gt;. With a split, &lt;code&gt;Area&lt;/code&gt; and &lt;code&gt;Bar&lt;/code&gt; stack the channels.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click a channel in the legend to hide it. The axis rescales to what is left. Click it again to bring it back.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Copy the chart with &lt;code&gt;Copy image&lt;/code&gt; (a PNG at twice the size on screen) or &lt;code&gt;Copy SVG&lt;/code&gt;. The copy carries a title, &lt;code&gt;orders by day&lt;/code&gt; here, the visible legend entries, and a footer with the connection name and the time you copied it. The hover line and card are left out.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Run the query again and the chart keeps your choices, as long as the result has the same column names. Change the columns and Seqora picks again. The choices last until you quit Seqora. A tab that was on &lt;code&gt;Chart&lt;/code&gt; stays on &lt;code&gt;Chart&lt;/code&gt; when you run it again.&lt;/p&gt;
&lt;h2 id=&quot;how-seqora-picks-what-to-draw&quot;&gt;How Seqora picks what to draw&lt;a class=&quot;guide-anchor&quot; href=&quot;#how-seqora-picks-what-to-draw&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Seqora reads the column types and a sample of up to 200 cells per column. Each column becomes one of four things:&lt;/p&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Column&lt;/th&gt;
&lt;th&gt;Counts as&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;code&gt;date&lt;/code&gt;, &lt;code&gt;timestamp&lt;/code&gt;, &lt;code&gt;timestamptz&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;time&lt;/td&gt;
&lt;td&gt;&lt;code&gt;day&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;integer, &lt;code&gt;numeric&lt;/code&gt;, float&lt;/td&gt;
&lt;td&gt;number&lt;/td&gt;
&lt;td&gt;&lt;code&gt;orders&lt;/code&gt;, &lt;code&gt;revenue_cents&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;text, boolean&lt;/td&gt;
&lt;td&gt;category&lt;/td&gt;
&lt;td&gt;&lt;code&gt;channel&lt;/code&gt;, &lt;code&gt;store&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;time&lt;/code&gt;, &lt;code&gt;interval&lt;/code&gt;, &lt;code&gt;jsonb&lt;/code&gt;, anything else&lt;/td&gt;
&lt;td&gt;not charted&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;A text column where every sampled cell is an ISO date counts as time, so &lt;code&gt;to_char(placed_at, &amp;#39;YYYY-MM-DD&amp;#39;)&lt;/code&gt; charts as dates. A number column counts only when 90% of its sampled cells parse as numbers.&lt;/p&gt;
&lt;p&gt;Then it picks the first rule that fits:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;One row, no time column:&lt;/strong&gt; &lt;code&gt;Number&lt;/code&gt;, each measure as a large figure.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A time column:&lt;/strong&gt; &lt;code&gt;Line&lt;/code&gt; over time. A category column with 12 or fewer distinct values becomes the split.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A category column:&lt;/strong&gt; &lt;code&gt;Bar&lt;/code&gt;, one bar per value, in the order the query returned them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Two number columns:&lt;/strong&gt; &lt;code&gt;Line&lt;/code&gt; when the first one ascends, &lt;code&gt;Scatter&lt;/code&gt; when it doesn&amp;#39;t.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One number column, many rows:&lt;/strong&gt; &lt;code&gt;Histogram&lt;/code&gt; of its values.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A number column named &lt;code&gt;id&lt;/code&gt; or ending in &lt;code&gt;_id&lt;/code&gt;, such as &lt;code&gt;store_id&lt;/code&gt;, is not picked as the measure. It counts rows and measures nothing.&lt;/p&gt;
&lt;p&gt;Revenue by store shows the bar rule:&lt;/p&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-key&quot;&gt;SELECT&lt;/span&gt; s.name &lt;span class=&quot;tok-key&quot;&gt;AS&lt;/span&gt; store,
       sum(o.total_cents) &lt;span class=&quot;tok-key&quot;&gt;AS&lt;/span&gt; revenue_cents
&lt;span class=&quot;tok-key&quot;&gt;FROM&lt;/span&gt;   commerce.orders o
&lt;span class=&quot;tok-key&quot;&gt;JOIN&lt;/span&gt;   commerce.stores s &lt;span class=&quot;tok-key&quot;&gt;ON&lt;/span&gt; s.id = o.store_id
&lt;span class=&quot;tok-key&quot;&gt;GROUP&lt;/span&gt;  &lt;span class=&quot;tok-key&quot;&gt;BY&lt;/span&gt; s.name
&lt;span class=&quot;tok-key&quot;&gt;ORDER&lt;/span&gt;  &lt;span class=&quot;tok-key&quot;&gt;BY&lt;/span&gt; revenue_cents &lt;span class=&quot;tok-key&quot;&gt;DESC&lt;/span&gt;;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;commerce.stores&lt;/code&gt; has 40 rows under 24 names, so the chart draws 24 bars. A bar chart draws at most 30. Past that, Seqora keeps the 30 categories with the largest totals and the header says how many it kept out of how many there were.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/chart-revenue-by-store.webp?v=0cffaed6e8&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/chart-revenue-by-store-800.webp?v=d26eb75f1b&quot; srcset=&quot;/guide/shots/chart-revenue-by-store-800.webp?v=d26eb75f1b 800w, /guide/shots/chart-revenue-by-store.webp?v=0cffaed6e8 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;541&quot; alt=&quot;A bar chart of revenue_cents by store name, 24 bars from largest to smallest.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;p&gt;A type button that doesn&amp;#39;t fit the columns stays dimmed, and its tooltip says why: &lt;code&gt;Histogram: A histogram needs at least two rows to show a spread.&lt;/code&gt;, &lt;code&gt;Number: Big numbers show a single row or a time series.&lt;/code&gt; &lt;code&gt;Number&lt;/code&gt; on a time series shows the latest value with a sparkline under it.&lt;/p&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;I draw the chart from the rows the run already returned, so opening &lt;code&gt;Chart&lt;/code&gt; sends nothing to the server and the picture always agrees with the grid. The chips also refuse to point at themselves: &lt;code&gt;x&lt;/code&gt; doesn&amp;#39;t offer the column &lt;code&gt;y&lt;/code&gt; measures, and &lt;code&gt;y&lt;/code&gt; doesn&amp;#39;t offer the &lt;code&gt;x&lt;/code&gt; column. A chart that plots a column against itself has nothing left to measure and collapses into a histogram, which hides &lt;code&gt;y&lt;/code&gt; and &lt;code&gt;split&lt;/code&gt; and turns off &lt;code&gt;Line&lt;/code&gt; and &lt;code&gt;Bar&lt;/code&gt;.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
&lt;h2 id=&quot;when-there-is-nothing-to-chart&quot;&gt;When there is nothing to chart&lt;a class=&quot;guide-anchor&quot; href=&quot;#when-there-is-nothing-to-chart&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A result with no number column, such as &lt;code&gt;SELECT email, country FROM crm.customers&lt;/code&gt;, has nothing to measure. &lt;code&gt;Chart&lt;/code&gt; stays dimmed. If the tab was already on &lt;code&gt;Chart&lt;/code&gt; when you ran it, the view says &lt;code&gt;Nothing to chart&lt;/code&gt; and &lt;code&gt;Charts need a number column, with a time or text column to plot it against.&lt;/code&gt;&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/chart-nothing-to-chart.webp?v=59c55ee689&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/chart-nothing-to-chart-800.webp?v=8fe7b8c155&quot; srcset=&quot;/guide/shots/chart-nothing-to-chart-800.webp?v=8fe7b8c155 800w, /guide/shots/chart-nothing-to-chart.webp?v=59c55ee689 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;304&quot; alt=&quot;The Chart view after a query with only text columns, an empty state reading Nothing to chart.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The chart reads at most 10,000 rows. Past that it draws the first 10,000 and the header says &lt;code&gt;10,000 of N rows&lt;/code&gt;. The result itself keeps 10,000 rows by default (see &lt;a href=&quot;/guide/result-pane/&quot;&gt;the row cap&lt;/a&gt;), so aggregate in SQL rather than charting raw rows.&lt;/li&gt;
&lt;li&gt;A filter in &lt;code&gt;Result&lt;/code&gt; narrows the chart too. The header then reads &lt;code&gt;N of M rows&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Rows that share an X value are added together, and a &lt;code&gt;Σ&lt;/code&gt; mark appears with &lt;code&gt;Rows with the same day are summed&lt;/code&gt;. Group in the query if you meant something other than a sum.&lt;/li&gt;
&lt;li&gt;A split draws at most eight series. The values with the smallest totals fold into one series called &lt;code&gt;other&lt;/code&gt;. &lt;code&gt;y&lt;/code&gt; draws at most six measures, and &lt;code&gt;All numbers&lt;/code&gt; picks them all.&lt;/li&gt;
&lt;li&gt;A NULL measure leaves a gap in a line or area, so a missing day reads as missing. A NULL time or number on the X axis drops that row. A NULL category becomes a bar labelled &lt;code&gt;NULL&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Times are plotted as the database printed them, in the session time zone. A daylight saving change inside the range can shift a point by an hour.&lt;/li&gt;
&lt;li&gt;Charts work on SQL results on every engine Seqora connects to. A table tab has no &lt;code&gt;Chart&lt;/code&gt;. Run a &lt;code&gt;SELECT&lt;/code&gt; instead, or &lt;a href=&quot;/guide/watch-a-table/&quot;&gt;watch the table&lt;/a&gt; to see its rows change.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry>
    <title>Edit data</title>
    <link href="https://seqora.dev/guide/edit-data/" />
    <id>https://seqora.dev/guide/edit-data/</id>
    <published>2026-11-13T00:00:00Z</published>
    <updated>2026-11-13T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Change, add and delete rows in the grid, review the SQL Seqora will run, and apply it in one transaction.</summary>
    <content type="html">&lt;p&gt;Read this when a few rows need fixing by hand: a wrong status, a missing value, a duplicate to
remove. Seqora stages every change in the grid and writes nothing until you have read the SQL
and applied it.&lt;/p&gt;
&lt;h2 id=&quot;open-the-table&quot;&gt;Open the table&lt;a class=&quot;guide-anchor&quot; href=&quot;#open-the-table&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Edits happen in a table tab, or in a partition&amp;#39;s tab, which edits the same way. A query result
can&amp;#39;t be edited, because its rows have no guaranteed path back to one row of one table, and its
controls say &amp;quot;Query results are read-only.&amp;quot; A view opens in the grid too, but reads &amp;quot;Views are
read-only here. Change rows in the tables the view reads from.&amp;quot; A materialized view reads
&amp;quot;Materialized views are read-only. Refresh the view to update its rows.&amp;quot;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Press &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;P&lt;/kbd&gt;&lt;/kbd&gt; on macOS or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;P&lt;/kbd&gt;&lt;/kbd&gt; on Windows.&lt;/li&gt;
&lt;li&gt;Type &lt;code&gt;orders&lt;/code&gt; and press &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt;. The &lt;code&gt;commerce.orders&lt;/code&gt; tab opens.&lt;/li&gt;
&lt;li&gt;Unlock the connection if the grid says &amp;quot;Unlock the connection to change rows.&amp;quot;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;guide-island frame safety-stage&quot; data-island=&quot;grid&quot;&gt;
&lt;div class=&quot;app-surface&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The data grid on the orders table with one cell edit staged, the pending-changes bar under it, and the review it opens.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&quot;stage-a-change&quot;&gt;Stage a change&lt;a class=&quot;guide-anchor&quot; href=&quot;#stage-a-change&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Double-click a cell in &lt;code&gt;status&lt;/code&gt;. &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;F2&lt;/kbd&gt;&lt;/kbd&gt;, &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt; or right-click › &lt;code&gt;Edit value&lt;/code&gt; do the same.&lt;/li&gt;
&lt;li&gt;Type &lt;code&gt;refunded&lt;/code&gt; and press &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Nothing is written. The row gets a dot, &amp;quot;Edited row&amp;quot;, and a bar appears under the grid.&lt;/p&gt;
&lt;p&gt;The cell editor checks the value against the column&amp;#39;s type as you type. Type &lt;code&gt;12.5&lt;/code&gt; into
&lt;code&gt;total_cents&lt;/code&gt; and the cell gets a red outline and a warning icon. &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt; and &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Tab&lt;/kbd&gt;&lt;/kbd&gt; stop and
show the type with &amp;quot;Enter a whole number.&amp;quot; &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Esc&lt;/kbd&gt;&lt;/kbd&gt;, or a click on another cell, drops the edit.&lt;/p&gt;
&lt;p&gt;The other kinds of change stage the same way:&lt;/p&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Change&lt;/th&gt;
&lt;th&gt;How&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;Set a value to &lt;code&gt;NULL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Right-click the cell › &lt;code&gt;Set to NULL&lt;/code&gt;, or the &lt;code&gt;NULL&lt;/code&gt; button in the cell editor. Only on nullable columns.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Insert a row&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Add row&lt;/code&gt; in the toolbar. Required columns with no default are flagged.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Copy a row&lt;/td&gt;
&lt;td&gt;Right-click it › &lt;code&gt;Duplicate row&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Delete rows&lt;/td&gt;
&lt;td&gt;Select them and press &lt;code&gt;Delete&lt;/code&gt;, or right-click › &lt;code&gt;Delete row&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Undo a delete&lt;/td&gt;
&lt;td&gt;Right-click the row › &lt;code&gt;Keep row&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;A deleted row stays on screen, marked, until you apply or keep it. Opening a &lt;code&gt;NULL&lt;/code&gt; cell&amp;#39;s
editor and leaving it without typing stages nothing: the cell stays &lt;code&gt;NULL&lt;/code&gt;, not empty.&lt;/p&gt;
&lt;h2 id=&quot;check-whats-pending&quot;&gt;Check what&amp;#39;s pending&lt;a class=&quot;guide-anchor&quot; href=&quot;#check-whats-pending&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The bar reads &lt;code&gt;3 pending changes&lt;/code&gt; with a count per kind, and &amp;quot;Kept in this window until you
apply them&amp;quot;. Click the count to list every change. Each line has a revert button, &amp;quot;Revert this
change&amp;quot;, and clicking the line scrolls the grid to it.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/edit-data-pending.webp?v=2d90fc1a4b&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/edit-data-pending-800.webp?v=84fcc75a9d&quot; srcset=&quot;/guide/shots/edit-data-pending-800.webp?v=84fcc75a9d 800w, /guide/shots/edit-data-pending.webp?v=2d90fc1a4b 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;622&quot; alt=&quot;The orders grid with two status cells edited and one row marked deleted, and the bar under it reading 3 pending changes, 2 edited, 1 deleted, with Discard and Review.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;Discard&lt;/code&gt; asks &amp;quot;Discard all 3?&amp;quot; and offers &lt;code&gt;Keep&lt;/code&gt; or &lt;code&gt;Discard&lt;/code&gt;. &lt;code&gt;Review&lt;/code&gt; opens the review, and
so does &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;S&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;S&lt;/kbd&gt;&lt;/kbd&gt; while the table tab has focus.&lt;/p&gt;
&lt;h2 id=&quot;review-and-apply&quot;&gt;Review and apply&lt;a class=&quot;guide-anchor&quot; href=&quot;#review-and-apply&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Click &lt;code&gt;Review&lt;/code&gt;. &lt;code&gt;Review staged changes&lt;/code&gt; opens with &amp;quot;3 staged changes across 3 rows&amp;quot;.&lt;/li&gt;
&lt;li&gt;Read &lt;code&gt;Visual diff&lt;/code&gt;. Each row is tagged &lt;code&gt;UPDATE&lt;/code&gt;, &lt;code&gt;DELETE&lt;/code&gt; or &lt;code&gt;INSERT&lt;/code&gt;, with the value before
and after.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;SQL script&lt;/code&gt; to read the statements, under &amp;quot;SQL for these changes, run as one
transaction:&amp;quot;. &lt;code&gt;Copy SQL&lt;/code&gt; copies them.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Apply 3 changes&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;A deleted row also says what else goes with it. On PostgreSQL, a foreign key with
&lt;code&gt;ON DELETE CASCADE&lt;/code&gt; reads &amp;quot;Also deletes&amp;quot; and the count of rows from each table it reaches. A new
row that leaves a required column empty is named in a banner. Keep editing to fill it, or tick
&amp;quot;A trigger or the server supplies this value, so apply anyway&amp;quot;.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/review-staged-diff.webp?v=2327d003aa&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/review-staged-diff-800.webp?v=2876c04400&quot; srcset=&quot;/guide/shots/review-staged-diff-800.webp?v=2876c04400 800w, /guide/shots/review-staged-diff.webp?v=2327d003aa 1560w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(780px, 46rem)&quot; width=&quot;780&quot; height=&quot;496&quot; alt=&quot;Review staged changes in Visual diff: UPDATE rows with old and new status values, a DELETE, a Production badge, Keep editing, and a red Apply 3 changes button.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;On production the button is red and takes &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;↩&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt;.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The script shows values inline so you can read it. Seqora sends them as bound parameters, and
every &lt;code&gt;UPDATE&lt;/code&gt; and &lt;code&gt;DELETE&lt;/code&gt; checks that the row still holds the values you loaded. The footer
puts it in one line: &amp;quot;One transaction · rolls back if any row changed since it loaded&amp;quot;.&lt;/p&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;I stage grid edits instead of writing each one as you leave the cell, so you read the whole
change before the database sees any of it: the values in the diff, the statements in the SQL.
Then it goes as one transaction, and every &lt;code&gt;UPDATE&lt;/code&gt; and &lt;code&gt;DELETE&lt;/code&gt; checks the row still holds what
you loaded. A row someone changed in the meantime stops the apply and shows you both versions,
so you never overwrite a change you didn&amp;#39;t see.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/review-staged-sql.webp?v=4b1ef00d98&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/review-staged-sql-800.webp?v=56131e1949&quot; srcset=&quot;/guide/shots/review-staged-sql-800.webp?v=56131e1949 800w, /guide/shots/review-staged-sql.webp?v=4b1ef00d98 1560w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(780px, 46rem)&quot; width=&quot;780&quot; height=&quot;582&quot; alt=&quot;Review staged changes on SQL script: the atomic transaction script, with UPDATE and DELETE statements that each check the row&amp;#39;s loaded values.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt; applies, unless the set contains a delete or the connection is production, as
&lt;a href=&quot;/guide/connect/&quot;&gt;Connect&lt;/a&gt; defines it. Then it takes &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;↩&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt;, so a stray &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt;
can&amp;#39;t delete rows.&lt;/p&gt;
&lt;p&gt;A toast reports the outcome. &amp;quot;Applied 3 changes to &lt;code&gt;orders&lt;/code&gt;&amp;quot; comes with the row count and the
time. &amp;quot;Couldn’t apply to &lt;code&gt;orders&lt;/code&gt; · rolled back&amp;quot; comes with the reason, the row or cell that
failed, and a &lt;code&gt;Review&lt;/code&gt; button that reopens your changes with that cell marked. &amp;quot;Outcome unknown
for &lt;code&gt;orders&lt;/code&gt;&amp;quot; comes with &lt;code&gt;Refresh&lt;/code&gt;: the connection went away mid-commit, so reload before you
try again. The grid stays read-only while an apply runs: the bar reads &amp;quot;You can edit again when
this finishes&amp;quot;.&lt;/p&gt;
&lt;h2 id=&quot;when-a-row-changed-under-you&quot;&gt;When a row changed under you&lt;a class=&quot;guide-anchor&quot; href=&quot;#when-a-row-changed-under-you&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;If someone changed a row after you loaded it, the apply rolls back and &lt;code&gt;Review&lt;/code&gt; reopens on the
conflict: &amp;quot;A staged change conflicts with the server. Nothing was applied.&amp;quot; Each conflicting
cell shows &lt;code&gt;Original&lt;/code&gt;, &lt;code&gt;Server now&lt;/code&gt; and &lt;code&gt;Yours&lt;/code&gt;.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Click &lt;code&gt;Keep mine&lt;/code&gt; to write your value over theirs, or &lt;code&gt;Take theirs&lt;/code&gt; to drop your edit.&lt;/li&gt;
&lt;li&gt;With several conflicts, &lt;code&gt;Keep all mine&lt;/code&gt; and &lt;code&gt;Take all theirs&lt;/code&gt; settle them at once.&lt;/li&gt;
&lt;li&gt;Apply again.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;A row deleted on the server reads &amp;quot;This row is gone from the server, or its key changed.&amp;quot; with
&lt;code&gt;Drop these edits&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Every applied statement is recorded in the sidebar&amp;#39;s &lt;code&gt;History&lt;/code&gt; view, one run per statement
(&lt;a href=&quot;/guide/history-and-sql-files/&quot;&gt;History and SQL files&lt;/a&gt;).&lt;/p&gt;
&lt;h2 id=&quot;what-cant-be-edited&quot;&gt;What can&amp;#39;t be edited&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-cant-be-edited&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The grid disables the control and gives the reason in its tooltip.&lt;/p&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Situation&lt;/th&gt;
&lt;th&gt;What Seqora says&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;The table has no primary key and no unique index&lt;/td&gt;
&lt;td&gt;&amp;quot;A primary key or complete unique index is required.&amp;quot;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A row&amp;#39;s unique key contains &lt;code&gt;NULL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&amp;quot;This row has no complete non-null unique identity.&amp;quot;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;You try to change the key itself&lt;/td&gt;
&lt;td&gt;&amp;quot;Row identity columns cannot be edited.&amp;quot;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A generated column&lt;/td&gt;
&lt;td&gt;&amp;quot;Generated columns cannot be edited.&amp;quot;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A binary column&lt;/td&gt;
&lt;td&gt;&amp;quot;Binary values cannot be edited in the grid.&amp;quot;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;An array column&lt;/td&gt;
&lt;td&gt;&amp;quot;Array values cannot be edited in the grid.&amp;quot;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A JSON column&lt;/td&gt;
&lt;td&gt;&amp;quot;Edit JSON in the value inspector once the row is saved.&amp;quot;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The connection is locked&lt;/td&gt;
&lt;td&gt;&amp;quot;Unlock the connection to change rows.&amp;quot;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A view&lt;/td&gt;
&lt;td&gt;&amp;quot;Views are read-only here.&amp;quot;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A materialized view&lt;/td&gt;
&lt;td&gt;&amp;quot;Materialized views are read-only.&amp;quot;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;Locking a connection with changes staged keeps them: the table reloads and the staged edits
carry over, with &lt;code&gt;Review&lt;/code&gt; disabled until you unlock again.&lt;/p&gt;
&lt;p&gt;Without a key, Seqora can&amp;#39;t write a &lt;code&gt;WHERE&lt;/code&gt; that hits exactly one row, so it doesn&amp;#39;t try. Add a
primary key, or write the &lt;code&gt;UPDATE&lt;/code&gt; yourself and
&lt;a href=&quot;/guide/run-cancel-and-transactions/&quot;&gt;run it in a transaction&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;edit-a-json-cell&quot;&gt;Edit a JSON cell&lt;a class=&quot;guide-anchor&quot; href=&quot;#edit-a-json-cell&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;crm.customers.attributes&lt;/code&gt; is &lt;code&gt;jsonb&lt;/code&gt;. JSON cells are edited in the value inspector, not in the
cell.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Double-click an &lt;code&gt;attributes&lt;/code&gt; cell. The inspector opens beside the grid with the value in a
JSON editor.&lt;/li&gt;
&lt;li&gt;Make the change. The status line reads &lt;code&gt;Valid JSON&lt;/code&gt;, or the line and column of the first
error.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Format JSON&lt;/code&gt;, or press &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;⌥&lt;/kbd&gt;&lt;kbd&gt;F&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;Alt&lt;/kbd&gt;&lt;kbd&gt;F&lt;/kbd&gt;&lt;/kbd&gt;, to re-indent it. It re-lays out the
text you typed, so &lt;code&gt;9007199254740993&lt;/code&gt; and &lt;code&gt;1.50&lt;/code&gt; stay as they are.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Apply&lt;/code&gt;. This stages the change. Nothing is written yet.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In the review, a JSON change shows &lt;code&gt;Original JSON&lt;/code&gt; and &lt;code&gt;Proposed JSON&lt;/code&gt; side by side. If the two
parse to the same value, it says &amp;quot;Only formatting or key order differs&amp;quot;. On a &lt;code&gt;jsonb&lt;/code&gt; column
that change does nothing, because PostgreSQL keeps neither the formatting nor the key order.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&amp;quot;Rolls back if any row changed since it loaded&amp;quot; means a whole apply fails if one row was
changed by someone else after you loaded it. Settle the conflict in the review, or &lt;code&gt;Refresh&lt;/code&gt;
and look at the rows again.&lt;/li&gt;
&lt;li&gt;Staged changes belong to the tab and are kept in this window until you apply them. Closing the tab
opens the review first, so you apply or discard them before it goes.&lt;/li&gt;
&lt;li&gt;Editing works the same way on PostgreSQL, MySQL, MariaDB, SQLite and SQL Server. On SQL Server,
identity, computed, &lt;code&gt;rowversion&lt;/code&gt;, period and graph id columns are read-only.&lt;/li&gt;
&lt;li&gt;For more than a screenful of rows, write the &lt;code&gt;UPDATE&lt;/code&gt; and run it in a transaction. The grid is
for the handful you can check by eye.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry>
    <title>Watch a table</title>
    <link href="https://seqora.dev/guide/watch-a-table/" />
    <id>https://seqora.dev/guide/watch-a-table/</id>
    <published>2026-11-13T00:00:00Z</published>
    <updated>2026-11-13T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Watch commerce.orders as rows are written: new, changed and deleted rows marked in the grid, a write tape across a schema, and pinned watches.</summary>
    <content type="html">&lt;p&gt;Watch a table when something else is supposed to be writing to it and you want to see it happen,
such as a worker that should be inserting orders or a migration backfilling a column. The grid
stays where it is and marks what changed since you pressed &lt;code&gt;Watch&lt;/code&gt;. If you only want the grid to
reload on a timer, the auto-refresh menu in the &lt;a href=&quot;/guide/data-grid/&quot;&gt;data grid&lt;/a&gt; does that without
marking anything.&lt;/p&gt;
&lt;h2 id=&quot;start-a-watch&quot;&gt;Start a watch&lt;a class=&quot;guide-anchor&quot; href=&quot;#start-a-watch&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Right-click &lt;code&gt;orders&lt;/code&gt; under &lt;code&gt;commerce&lt;/code&gt; in the sidebar and choose &lt;code&gt;Watch&lt;/code&gt;. In an open table tab,
&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;⌥&lt;/kbd&gt;&lt;kbd&gt;W&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Alt&lt;/kbd&gt;&lt;kbd&gt;W&lt;/kbd&gt;&lt;/kbd&gt; does the same, and so does &lt;code&gt;Watch&lt;/code&gt; at the top of the toolbar&amp;#39;s
auto-refresh menu.&lt;/li&gt;
&lt;li&gt;Look at the toolbar. The auto-refresh button is now the watch control: a dot that beats once
per check, &lt;code&gt;Watching · 1s&lt;/code&gt;, the counters &lt;code&gt;+0 ~0 −0&lt;/code&gt; and &lt;code&gt;since 14:22:01&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The tab sorts by &lt;code&gt;id&lt;/code&gt;, newest first, so new rows arrive at the top. A table without a numeric key
is sorted by a column named like &lt;code&gt;created_at&lt;/code&gt; instead, or keeps its order.&lt;/p&gt;
&lt;h2 id=&quot;see-rows-arrive&quot;&gt;See rows arrive&lt;a class=&quot;guide-anchor&quot; href=&quot;#see-rows-arrive&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Write some rows from somewhere else, your app or &lt;code&gt;psql&lt;/code&gt; in a terminal.&lt;/p&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-key&quot;&gt;INSERT&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;INTO&lt;/span&gt; commerce.orders (customer_id, store_id, channel, total_cents)
&lt;span class=&quot;tok-key&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;tok-number&quot;&gt;40213&lt;/span&gt;, id, &lt;span class=&quot;tok-string&quot;&gt;&amp;#39;web&amp;#39;&lt;/span&gt;, &lt;span class=&quot;tok-number&quot;&gt;5400&lt;/span&gt;
&lt;span class=&quot;tok-key&quot;&gt;FROM&lt;/span&gt;   commerce.stores &lt;span class=&quot;tok-key&quot;&gt;ORDER&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;BY&lt;/span&gt; name &lt;span class=&quot;tok-key&quot;&gt;LIMIT&lt;/span&gt; &lt;span class=&quot;tok-number&quot;&gt;3&lt;/span&gt;;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;On the 12-million-row sample the three orders get ids &lt;code&gt;12000001&lt;/code&gt; to &lt;code&gt;12000003&lt;/code&gt;, with &lt;code&gt;status&lt;/code&gt;
at its default, &lt;code&gt;pending&lt;/code&gt;. At the next check they appear at the top of the grid, tinted for a few
seconds, each with a &lt;code&gt;+&lt;/code&gt; in the gutter. The counters read &lt;code&gt;+3 ~0 −0&lt;/code&gt;.&lt;/p&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-key&quot;&gt;UPDATE&lt;/span&gt; commerce.orders &lt;span class=&quot;tok-key&quot;&gt;SET&lt;/span&gt; status = &lt;span class=&quot;tok-string&quot;&gt;&amp;#39;paid&amp;#39;&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;WHERE&lt;/span&gt; id = &lt;span class=&quot;tok-number&quot;&gt;12000001&lt;/span&gt;;
&lt;span class=&quot;tok-key&quot;&gt;DELETE&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;FROM&lt;/span&gt; commerce.orders &lt;span class=&quot;tok-key&quot;&gt;WHERE&lt;/span&gt; id = &lt;span class=&quot;tok-number&quot;&gt;12000003&lt;/span&gt;;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The changed cell shows &lt;code&gt;pending&lt;/code&gt; struck through beside &lt;code&gt;paid&lt;/code&gt; for about six seconds. Order
&lt;code&gt;12000001&lt;/code&gt; keeps its &lt;code&gt;+&lt;/code&gt;, because it is still new since the watch started. A row that existed
before the watch gets a &lt;code&gt;~&lt;/code&gt;. The deleted order leaves the grid, and a strip above it reads &lt;code&gt;−1&lt;/code&gt;
with &lt;code&gt;12000003&lt;/code&gt; struck through. The counters read &lt;code&gt;+3 ~1 −1&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Click the &lt;code&gt;+&lt;/code&gt; or &lt;code&gt;~&lt;/code&gt; in a row&amp;#39;s gutter, or press &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌥&lt;/kbd&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Alt&lt;/kbd&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt;, to follow that row: a strip of
how long it held each value, and its versions with their times.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/watch-grid-live.webp?v=ffb6ebc3e5&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/watch-grid-live-800.webp?v=bf733ecd83&quot; srcset=&quot;/guide/shots/watch-grid-live-800.webp?v=bf733ecd83 800w, /guide/shots/watch-grid-live.webp?v=ffb6ebc3e5 2000w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(1000px, 46rem)&quot; width=&quot;1000&quot; height=&quot;451&quot; alt=&quot;The commerce.orders tab while watching, two new orders at the top with plus marks, one status cell showing pending struck through beside paid, and a strip holding the one deleted order above the grid.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;The counters read &lt;code&gt;+3 ~1 −1&lt;/code&gt;. The third new order is the one in the strip above the grid, which holds what was deleted. The control reads &lt;code&gt;Watching · 1s → 10s&lt;/code&gt; here because this connection is production, so the 1 s interval is held to 10 s.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Scrolled down, the rows hold still and a pill counts what arrived: &lt;code&gt;↑ 3 new&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;watch-a-whole-schema&quot;&gt;Watch a whole schema&lt;a class=&quot;guide-anchor&quot; href=&quot;#watch-a-whole-schema&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Right-click &lt;code&gt;commerce&lt;/code&gt;, or its &lt;code&gt;Tables&lt;/code&gt; folder, and choose &lt;code&gt;Watch tables&lt;/code&gt;. A &lt;code&gt;Watch · commerce&lt;/code&gt;
tab opens with each table, a checkbox and its own &lt;code&gt;+ ~ −&lt;/code&gt; counts on the left. Up to 16 tables are
watched at once.&lt;/p&gt;
&lt;p&gt;On the right is the write tape, oldest first. Each line is one change: the time to a tenth of a
second, the glyph, the table and key (&lt;code&gt;orders 12000001&lt;/code&gt;), then up to three columns of an insert,
&lt;code&gt;status pending → paid&lt;/code&gt; for an update, or &lt;code&gt;deleted&lt;/code&gt;. Changes split into bursts on a quiet gap of
1.5 s, with &lt;code&gt;quiet 8.2 s&lt;/code&gt; between them. On PostgreSQL, rows written by one transaction share a
dot on the spine, &lt;code&gt;tx&lt;/code&gt; and its id on hover.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Mark&lt;/code&gt; starts a new burst by hand, and &lt;code&gt;Name this burst&lt;/code&gt; labels one. &lt;code&gt;Copy as fixtures&lt;/code&gt; copies
the new rows as &lt;code&gt;INSERT&lt;/code&gt; statements. Click a line to open its table filtered to that row. Writes
Seqora made itself, from the grid or the SQL editor, are marked &lt;code&gt;you&lt;/code&gt;.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/watch-tape.webp?v=e46aff28e9&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/watch-tape-800.webp?v=0cbf28e882&quot; srcset=&quot;/guide/shots/watch-tape-800.webp?v=0cbf28e882 800w, /guide/shots/watch-tape.webp?v=e46aff28e9 2000w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(1000px, 46rem)&quot; width=&quot;1000&quot; height=&quot;392&quot; alt=&quot;The Watch · commerce tab with stores, orders and order_items ticked on the left and a write tape on the right showing two bursts: three inserts into orders, then an update and a delete.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;stop-a-watch&quot;&gt;Stop a watch&lt;a class=&quot;guide-anchor&quot; href=&quot;#stop-a-watch&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Click &lt;code&gt;Watching · 1s&lt;/code&gt; for its menu: the interval, &lt;code&gt;Pause&lt;/code&gt;, &lt;code&gt;Since now&lt;/code&gt;, &lt;code&gt;Pin…&lt;/code&gt; and
&lt;code&gt;Stop watching&lt;/code&gt;. &lt;code&gt;Since now&lt;/code&gt; clears the marks and counts and starts again from the current page.
&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;⌥&lt;/kbd&gt;&lt;kbd&gt;W&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Alt&lt;/kbd&gt;&lt;kbd&gt;W&lt;/kbd&gt;&lt;/kbd&gt; stops it too, and so does closing the tab.&lt;/p&gt;
&lt;h2 id=&quot;pin-a-watch&quot;&gt;Pin a watch&lt;a class=&quot;guide-anchor&quot; href=&quot;#pin-a-watch&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Pinned watches are Pro. Choose &lt;code&gt;Pin…&lt;/code&gt; in the watch menu or on the tape. The dialog sets which
&lt;code&gt;Changes&lt;/code&gt; count (&lt;code&gt;inserted&lt;/code&gt;, &lt;code&gt;updated&lt;/code&gt;, &lt;code&gt;deleted&lt;/code&gt;), an optional &lt;code&gt;Column becomes&lt;/code&gt; value such as
&lt;code&gt;status&lt;/code&gt; → &lt;code&gt;refunded&lt;/code&gt;, a &lt;code&gt;Filter&lt;/code&gt; the database applies, such as &lt;code&gt;total_cents &amp;gt; 10000&lt;/code&gt;, and
&lt;code&gt;Every&lt;/code&gt; &lt;code&gt;30 s&lt;/code&gt;, &lt;code&gt;1 min&lt;/code&gt;, &lt;code&gt;5 min&lt;/code&gt; or &lt;code&gt;15 min&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;A pinned watch keeps checking while Seqora is open, with its tab closed. A check that finds a
match sends one notification and logs the matches, kept for 7 days and at most 10,000 entries.
&lt;code&gt;Pinned watches: &amp;lt;connection&amp;gt;&lt;/code&gt; in the command palette opens a &lt;code&gt;Watches · &amp;lt;connection&amp;gt;&lt;/code&gt; tab with
each watch, its rule, its last hit and its log. They live on your machine, not on the server,
and stay readable if the license ends.&lt;/p&gt;
&lt;h2 id=&quot;how-it-finds-changes&quot;&gt;How it finds changes&lt;a class=&quot;guide-anchor&quot; href=&quot;#how-it-finds-changes&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Watching polls. Each check sends one probe per connection, asking whether anything was written
since the last one. Only when the answer moves does Seqora fetch the grid&amp;#39;s first page again,
the same &lt;code&gt;SELECT&lt;/code&gt; the grid runs, and compare it with the last one by primary key. On PostgreSQL
the probe is:&lt;/p&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-key&quot;&gt;SELECT&lt;/span&gt; txid_current_snapshot()&lt;span class=&quot;tok-literal&quot;&gt;::text&lt;/span&gt;;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Engine&lt;/th&gt;
&lt;th&gt;The probe&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;PostgreSQL&lt;/td&gt;
&lt;td&gt;&lt;code&gt;txid_current_snapshot()&lt;/code&gt;, which moves when any transaction on the server writes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MySQL, MariaDB&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SHOW GLOBAL STATUS&lt;/code&gt; for the &lt;code&gt;Innodb_rows_inserted&lt;/code&gt;, &lt;code&gt;_updated&lt;/code&gt; and &lt;code&gt;_deleted&lt;/code&gt; counters&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SQLite&lt;/td&gt;
&lt;td&gt;the size and modified time of the database file and its &lt;code&gt;-wal&lt;/code&gt; file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SQL Server&lt;/td&gt;
&lt;td&gt;none, so every check fetches the page&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;A quiet table costs one probe per check, plus one fetch every 15 s in case the probe missed
something. The interval never drops below ten times the last fetch time: a page that takes
400 ms is checked every 4 s at most. A connection named like production (&lt;code&gt;Prod&lt;/code&gt;, &lt;code&gt;prod-eu&lt;/code&gt;) is
checked every 10 s at most. One check runs at a time per connection.&lt;/p&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;I made Watch install nothing on the server: no triggers, no replication slots, no DDL. A
forgotten replication slot keeps WAL on disk and holds back vacuum, and a trigger is a change to
a schema that may not be yours. A probe first means ten quiet tables cost one tiny query per
check, and a page is fetched only when something was written.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;A table needs a primary key or a unique key. Without one, the toolbar&amp;#39;s &lt;code&gt;Watch&lt;/code&gt; is disabled
and says &amp;quot;This table has no primary key or unique key, so changes can’t be matched to rows.&amp;quot;&lt;/li&gt;
&lt;li&gt;Only the first page is compared. Inserts show because new rows sort to the top. On a large
table, updates and deletes are seen only for rows on that page. The tape compares 100 rows per
table, a pinned watch 200.&lt;/li&gt;
&lt;li&gt;A filter limits the watch to the rows it keeps. Changing the filter or the sort starts a new
comparison without marking anything. Sorted by another column, a new row is marked only if it
lands on the first page.&lt;/li&gt;
&lt;li&gt;The watch holds while you have unsaved edits and while more than one page is loaded. The dot
turns hollow and its tooltip says why. A pane that is out of sight doesn&amp;#39;t check either.&lt;/li&gt;
&lt;li&gt;If the connection drops, the watch holds with &lt;code&gt;Not connected&lt;/code&gt; and checks nothing until it is
back. After a failed check, it waits four times its interval before the next one.&lt;/li&gt;
&lt;li&gt;A row inserted and deleted between two checks never appears. On MySQL and MariaDB the counters
can move before the commit, so a row committed late can wait for the 15 s fetch.&lt;/li&gt;
&lt;li&gt;Grid and tape watches stop while Seqora&amp;#39;s window is hidden. Pinned watches keep going. Nothing
runs while Seqora is closed.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry>
    <title>Design a schema change</title>
    <link href="https://seqora.dev/guide/design-a-schema-change/" />
    <id>https://seqora.dev/guide/design-a-schema-change/</id>
    <published>2026-11-13T00:00:00Z</published>
    <updated>2026-11-13T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Draw a new table, column or foreign key on the ER diagram, read the SQL and its locks as you go, then check, dry-run and apply it.</summary>
    <content type="html">&lt;p&gt;Read this when you need a new table, column or foreign key and want to see the SQL, and the
locks it takes, before anything touches the database. Design mode is Pro, works on every
engine, and runs nothing until the change has passed its checks and a dry run.&lt;/p&gt;
&lt;h2 id=&quot;start-a-design&quot;&gt;Start a design&lt;a class=&quot;guide-anchor&quot; href=&quot;#start-a-design&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Press &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;E&lt;/kbd&gt;&lt;/kbd&gt; on macOS or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;E&lt;/kbd&gt;&lt;/kbd&gt; on Windows, and pick &lt;code&gt;commerce&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Design changes&lt;/code&gt; in the diagram&amp;#39;s toolbar.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;New design for commerce&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Earlier designs are listed under &lt;code&gt;Saved designs&lt;/code&gt;, each with &lt;code&gt;Delete design&lt;/code&gt;, which asks first
and changes nothing in the database. The workbench shows the canvas, an inspector and the &lt;code&gt;SQL&lt;/code&gt;
pane, and saves as you work: the toolbar says &lt;code&gt;Saved&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;On Free, saved designs open read-only: &amp;quot;Saved designs open read-only on Free. Upgrade to keep
designing.&amp;quot;&lt;/p&gt;
&lt;div class=&quot;guide-island frame&quot; data-island=&quot;design&quot; data-demo-stage&gt;
&lt;div class=&quot;app-surface&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The ER diagram of the commerce schema stepping into design mode: a new table is added under orders, named, and linked to it by dragging a column.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The figure adds a &lt;code&gt;reviews&lt;/code&gt; table and links it to &lt;code&gt;orders&lt;/code&gt;, as the next sections do.&lt;/p&gt;
&lt;h2 id=&quot;add-a-table&quot;&gt;Add a table&lt;a class=&quot;guide-anchor&quot; href=&quot;#add-a-table&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Press &lt;code&gt;T&lt;/code&gt;. The toolbar&amp;#39;s &lt;code&gt;Table&lt;/code&gt; button does the same, and so does double-clicking empty
canvas.&lt;/li&gt;
&lt;li&gt;Type &lt;code&gt;reviews&lt;/code&gt; and press &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The new table gets a primary key in the style the &lt;code&gt;New table key&lt;/code&gt; menu beside the button names:
&lt;code&gt;bigint identity key&lt;/code&gt; or &lt;code&gt;uuid key&lt;/code&gt; on PostgreSQL.&lt;/p&gt;
&lt;h2 id=&quot;add-a-column&quot;&gt;Add a column&lt;a class=&quot;guide-anchor&quot; href=&quot;#add-a-column&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Right-click the &lt;code&gt;reviews&lt;/code&gt; table and click &lt;code&gt;Add column&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Name it &lt;code&gt;rating&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Set its &lt;code&gt;Type&lt;/code&gt; in the inspector, for example &lt;code&gt;smallint&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Tick &lt;code&gt;Required (NOT NULL)&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The inspector also holds &lt;code&gt;Default&lt;/code&gt; and &lt;code&gt;Identity&lt;/code&gt;, and the toggles &lt;code&gt;Primary key&lt;/code&gt; and &lt;code&gt;Unique&lt;/code&gt;.
A &lt;code&gt;Default&lt;/code&gt; is one expression. &lt;code&gt;0, 1&lt;/code&gt;, a &lt;code&gt;NOT NULL&lt;/code&gt; outside brackets, an unclosed quote or an
unbalanced bracket is reported as a blocker, so a default can never smuggle a second clause
into the &lt;code&gt;ALTER TABLE&lt;/code&gt;. Defaults read from the live database are left as they are.&lt;/p&gt;
&lt;h2 id=&quot;link-two-tables&quot;&gt;Link two tables&lt;a class=&quot;guide-anchor&quot; href=&quot;#link-two-tables&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Drag the dot at the end of the &lt;code&gt;id&lt;/code&gt; row in &lt;code&gt;orders&lt;/code&gt; onto &lt;code&gt;reviews&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;code&gt;New link&lt;/code&gt; popover, choose &lt;code&gt;Many-to-one&lt;/code&gt;. &lt;code&gt;One-to-one&lt;/code&gt; and &lt;code&gt;Many-to-many&lt;/code&gt; are the
other choices.&lt;/li&gt;
&lt;li&gt;Set &lt;code&gt;On delete&lt;/code&gt; to &lt;code&gt;Cascade&lt;/code&gt;, so a deleted order takes its reviews with it.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Done&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The other &lt;code&gt;On delete&lt;/code&gt; choices are &lt;code&gt;No action&lt;/code&gt;, &lt;code&gt;Restrict&lt;/code&gt;, &lt;code&gt;Set null&lt;/code&gt; and &lt;code&gt;Set default&lt;/code&gt;.
&lt;code&gt;Undo link&lt;/code&gt; takes the link back.&lt;/p&gt;
&lt;h2 id=&quot;read-the-inspector&quot;&gt;Read the inspector&lt;a class=&quot;guide-anchor&quot; href=&quot;#read-the-inspector&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;With nothing selected, the inspector describes the whole design. &lt;code&gt;Changes&lt;/code&gt;, &lt;code&gt;Blockers&lt;/code&gt; and
&lt;code&gt;Warnings&lt;/code&gt; count what you&amp;#39;ve done and what&amp;#39;s wrong with it. A blocker stops the apply. A warning
asks you to confirm it during review. &lt;code&gt;Issues&lt;/code&gt; lists both, or says &amp;quot;No problems in the design.&amp;quot;
&lt;code&gt;Suggestions&lt;/code&gt; holds what Seqora noticed but won&amp;#39;t insist on. A column named &lt;code&gt;customer_id&lt;/code&gt; with no
foreign key, in a schema where &lt;code&gt;customers&lt;/code&gt; has a key of the same type, is suggested as a link.
A &lt;code&gt;Link&lt;/code&gt; button draws it.&lt;/p&gt;
&lt;p&gt;Select a link to change its &lt;code&gt;On delete&lt;/code&gt; and &lt;code&gt;On update&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;read-the-sql-pane&quot;&gt;Read the SQL pane&lt;a class=&quot;guide-anchor&quot; href=&quot;#read-the-sql-pane&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;SQL&lt;/code&gt; pane updates with every edit and tags each statement that will hurt. On PostgreSQL:&lt;/p&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tag&lt;/th&gt;
&lt;th&gt;What the statement does&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Deletes data&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Drops a table or a column.&lt;/td&gt;
&lt;td&gt;Dropping &lt;code&gt;orders.channel&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Rewrites table&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Rewrites every row.&lt;/td&gt;
&lt;td&gt;A new column with a volatile default or an identity&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Scans table&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Reads every row to check it.&lt;/td&gt;
&lt;td&gt;A &lt;code&gt;NOT NULL&lt;/code&gt; column, an index, a foreign key on an existing table&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Blocks reads and writes&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Takes an &lt;code&gt;ACCESS EXCLUSIVE&lt;/code&gt; lock.&lt;/td&gt;
&lt;td&gt;Most &lt;code&gt;ALTER TABLE&lt;/code&gt; statements&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Blocks writes&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Takes a &lt;code&gt;SHARE&lt;/code&gt; or &lt;code&gt;SHARE ROW EXCLUSIVE&lt;/code&gt; lock.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;CREATE INDEX&lt;/code&gt;, a new foreign key to an existing table&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;Read the tags together. A statement on &lt;code&gt;commerce.orders&lt;/code&gt; tagged both &lt;code&gt;Scans table&lt;/code&gt; and
&lt;code&gt;Blocks reads and writes&lt;/code&gt; holds its lock for as long as reading 12,000,000 rows takes, and every
query on &lt;code&gt;orders&lt;/code&gt; waits behind it.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Selection only&lt;/code&gt; narrows the pane to the selected table. &lt;code&gt;Copy SQL&lt;/code&gt; copies the script.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/design-sql-pane.webp?v=9775276466&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/design-sql-pane.webp?v=9775276466&quot; width=&quot;399&quot; height=&quot;243&quot; alt=&quot;The SQL pane with CREATE TABLE commerce.reviews and CREATE INDEX on orders, the second carrying two risk icons.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;Tags are icons that name themselves on hover: here &lt;code&gt;Scans table&lt;/code&gt; and &lt;code&gt;Blocks writes&lt;/code&gt;.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;review-and-apply&quot;&gt;Review and apply&lt;a class=&quot;guide-anchor&quot; href=&quot;#review-and-apply&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Click &lt;code&gt;Review and apply&lt;/code&gt; at the bottom of the workbench, beside the counts of statements,
blockers and warnings. The review opens on &lt;code&gt;Checks&lt;/code&gt;, the first of
&lt;code&gt;Checks → Dry run → Apply&lt;/code&gt;, under the eyebrow &lt;code&gt;Review changes&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Read the checks: read-only queries for empty values, duplicates, orphan rows and dependent
objects, under &lt;code&gt;Blockers&lt;/code&gt; and &lt;code&gt;Check before applying&lt;/code&gt;, with the ones that passed folded
under a count such as &lt;code&gt;4 passed&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Tick &lt;code&gt;I understand&lt;/code&gt; on each warning you accept.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Dry run&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click the apply button. It names the count, as in &lt;code&gt;Apply 2 statements&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/design-review.webp?v=e362896325&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/design-review-800.webp?v=af4f250a0d&quot; srcset=&quot;/guide/shots/design-review-800.webp?v=af4f250a0d 800w, /guide/shots/design-review.webp?v=e362896325 2000w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(1000px, 46rem)&quot; width=&quot;1000&quot; height=&quot;691&quot; alt=&quot;The Review changes panel: Checks, Dry run and Apply, one check passed, the SQL beside it, and Writes locked with an Unlock button.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;The review on a locked connection, stopped before &lt;code&gt;Dry run&lt;/code&gt;.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;If the schema changed after you started, the checks say &amp;quot;The live schema changed since this
design started&amp;quot;. Click &lt;code&gt;Rebase onto the live schema&lt;/code&gt; to replay your edits on the current one.&lt;/p&gt;
&lt;p&gt;Data checks skip tables over 5,000,000 rows, and say which: &lt;code&gt;Data checks skipped on commerce.orders&lt;/code&gt;. The dry run still tests every statement. &lt;code&gt;Check them anyway&lt;/code&gt; includes them.&lt;/p&gt;
&lt;p&gt;On PostgreSQL, a &lt;code&gt;CREATE INDEX&lt;/code&gt; on a live table over 100,000 rows, or on a production
connection, gets a warning that it blocks writes while the index builds. The warning carries
the &lt;code&gt;CREATE INDEX CONCURRENTLY&lt;/code&gt; version to run outside the transaction instead.&lt;/p&gt;
&lt;p&gt;What the dry run and the apply do depends on the engine:&lt;/p&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Engine&lt;/th&gt;
&lt;th&gt;Dry run&lt;/th&gt;
&lt;th&gt;Apply&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;PostgreSQL&lt;/td&gt;
&lt;td&gt;Runs every statement in a transaction and rolls it back, with &lt;code&gt;lock_timeout&lt;/code&gt; at 5 seconds and &lt;code&gt;statement_timeout&lt;/code&gt; at 120 seconds.&lt;/td&gt;
&lt;td&gt;One transaction, with &lt;code&gt;SET LOCAL lock_timeout&lt;/code&gt; at 10 seconds and no statement timeout.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SQLite&lt;/td&gt;
&lt;td&gt;Runs every statement in a transaction and rolls it back.&lt;/td&gt;
&lt;td&gt;One transaction, with foreign-key enforcement off until the end, then checked.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MySQL, MariaDB&lt;/td&gt;
&lt;td&gt;Replays every statement on empty copies of the tables in a scratch database, then drops it.&lt;/td&gt;
&lt;td&gt;Each statement commits on its own. Seqora stops at the first failure.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SQL Server&lt;/td&gt;
&lt;td&gt;Runs every statement in a transaction with &lt;code&gt;XACT_ABORT&lt;/code&gt; on, and rolls it back.&lt;/td&gt;
&lt;td&gt;One transaction, with &lt;code&gt;LOCK_TIMEOUT&lt;/code&gt; at 10 seconds.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;On a production connection, which &lt;a href=&quot;/guide/connect/&quot;&gt;Connect&lt;/a&gt; defines, the apply step asks you
to type the database name first: &lt;code&gt;Production · type commerce to apply&lt;/code&gt;. On a locked connection
the checks run read-only and the header shows &lt;code&gt;Writes locked&lt;/code&gt; with an &lt;code&gt;Unlock&lt;/code&gt; button. The dry
run waits until you unlock.&lt;/p&gt;
&lt;p&gt;When it&amp;#39;s done you see &lt;code&gt;Changes applied&lt;/code&gt;, and the catalog and diagram refresh. &lt;code&gt;Save as .sql&lt;/code&gt;
writes the script to your SQL folder, ready to commit as a migration. The design stays as a
record that can&amp;#39;t be edited.&lt;/p&gt;
&lt;p&gt;To run the same design against a second database, click &lt;code&gt;Compare with a database…&lt;/code&gt; beside
&lt;code&gt;Review and apply&lt;/code&gt;. It opens the compare setup with the design as one side, as
&lt;a href=&quot;/guide/compare-two-schemas/&quot;&gt;Compare two schemas&lt;/a&gt; describes.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;A PostgreSQL dry run executes the real statements before rolling back, so it takes the same
locks for as long as they run. Dry-run a change to a busy table when it is quiet.&lt;/li&gt;
&lt;li&gt;On MySQL and MariaDB, if a statement fails during apply, the ones before it stay applied.
Refresh the schema and rebase the design before trying again.&lt;/li&gt;
&lt;li&gt;The MySQL dry run needs &lt;code&gt;CREATE&lt;/code&gt; on &lt;code&gt;seqora_scratch_%&lt;/code&gt; databases. Without it Seqora checks only
the syntax, and says &amp;quot;Only the syntax was checked&amp;quot;.&lt;/li&gt;
&lt;li&gt;Seqora only applies statements the designer generated. There is no field for hand-written
DDL. Run that from &lt;a href=&quot;/guide/run-cancel-and-transactions/&quot;&gt;Run, cancel, and transactions&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Expression and partial indexes and generated columns are kept as they are.&lt;/li&gt;
&lt;li&gt;SQLite can&amp;#39;t make some changes in place. Seqora then creates the table again, copies the rows
across and swaps it in, keeping its keys, indexes, triggers, &lt;code&gt;CHECK&lt;/code&gt; constraints, collations
and &lt;code&gt;AUTOINCREMENT&lt;/code&gt; counter. The review lists what the rebuild keeps, and warns that it copies
every row while the table is locked.&lt;/li&gt;
&lt;li&gt;The tag examples above are PostgreSQL&amp;#39;s. Each engine&amp;#39;s DDL generator sets its own tags, so the
same drawing can carry different ones on MySQL, MariaDB, SQLite or SQL Server.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;A line between two boxes looks like nothing. On &lt;code&gt;orders&lt;/code&gt; it is an &lt;code&gt;ALTER TABLE&lt;/code&gt; that scans 12
million rows under a lock, and you find out when the checkout page stops answering. I wanted
the lock and the scan printed next to the line while you draw it. The checks exist because a
foreign key fails on its three orphan rows at minute four of a migration.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
</content>
  </entry>
  <entry>
    <title>Compare two schemas</title>
    <link href="https://seqora.dev/guide/compare-two-schemas/" />
    <id>https://seqora.dev/guide/compare-two-schemas/</id>
    <published>2026-11-13T00:00:00Z</published>
    <updated>2026-11-13T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Make one database match another, a saved design or a snapshot: read the differences and their data, then check, dry-run and apply the script.</summary>
    <content type="html">&lt;p&gt;Read this when production has drifted from your local database, or a design is ready for a
second environment, and you want the exact &lt;code&gt;ALTER&lt;/code&gt; script with its risks before anything runs.
Schema compare is Pro, works on every engine, and reads both sides fresh every time.&lt;/p&gt;
&lt;h2 id=&quot;start-a-compare&quot;&gt;Start a compare&lt;a class=&quot;guide-anchor&quot; href=&quot;#start-a-compare&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Right-click &lt;code&gt;commerce&lt;/code&gt; in the explorer and choose &lt;code&gt;Compare schema with…&lt;/code&gt;, or run &lt;code&gt;Compare schemas&lt;/code&gt; from the command palette.&lt;/li&gt;
&lt;li&gt;Under &lt;code&gt;Change this database&lt;/code&gt;, pick the connection and schema the script will run on.&lt;/li&gt;
&lt;li&gt;Under &lt;code&gt;to match&lt;/code&gt;, pick &lt;code&gt;Connection&lt;/code&gt;, &lt;code&gt;Saved design&lt;/code&gt; or &lt;code&gt;Snapshot&lt;/code&gt;, then which one.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Compare&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;code&gt;Ignore&lt;/code&gt; in the same dialog holds &lt;code&gt;Differences in constraint and index names&lt;/code&gt; and
&lt;code&gt;Differences in comments&lt;/code&gt;, both ticked to start. With two connections, &lt;code&gt;Swap the two databases&lt;/code&gt; trades the sides.&lt;/p&gt;
&lt;p&gt;A design has its own entry: &lt;code&gt;Compare with a database…&lt;/code&gt;, beside &lt;code&gt;Review and apply&lt;/code&gt; in the design
workbench, opens the dialog with that design as the source. The dialog only offers connections that are open and
of the same kind, and MySQL and MariaDB compare with each other.&lt;/p&gt;
&lt;h2 id=&quot;read-the-changes&quot;&gt;Read the changes&lt;a class=&quot;guide-anchor&quot; href=&quot;#read-the-changes&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The tab&amp;#39;s toolbar names the two sides with an arrow from the source to the target:
&lt;code&gt;orders-prod · commerce&lt;/code&gt;, then &lt;code&gt;orders-local&lt;/code&gt;. Its tooltip reads &amp;quot;orders-prod changes to match
orders-local&amp;quot;. &lt;code&gt;Change…&lt;/code&gt; reopens the dialog, and &lt;code&gt;Snapshots&lt;/code&gt; lists the target&amp;#39;s snapshots. Each
difference is one row, written as a sentence: &lt;code&gt;Add column shipped_at timestamp with time zone&lt;/code&gt;,
&lt;code&gt;Change status from character varying(20) to varchar(32)&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Seqora checks the target&amp;#39;s data as soon as both sides are read. A change that would fail on the
rows that are there, such as a &lt;code&gt;NOT NULL&lt;/code&gt; over 12 empty values, is shaded red with the reason
under it. A change that locks a large table is shaded amber. Everything else stays plain.
&lt;code&gt;By risk&lt;/code&gt; regroups the rows under &amp;quot;Fails on current data&amp;quot;, &amp;quot;Check before applying&amp;quot; and &amp;quot;Ready&amp;quot;.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/compare-changes.webp?v=d7d5e3665a&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/compare-changes-800.webp?v=938373c485&quot; srcset=&quot;/guide/shots/compare-changes-800.webp?v=938373c485 800w, /guide/shots/compare-changes.webp?v=d7d5e3665a 2000w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(1000px, 46rem)&quot; width=&quot;1000&quot; height=&quot;398&quot; alt=&quot;A schema compare of orders-prod and orders-local: add a column, make display_name NOT NULL marked 12 empty, a dropped table left out of the script, and the SQL, with Fix 1 failure to continue.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;From the app&amp;#39;s own fixture, on &lt;code&gt;public&lt;/code&gt;. &lt;code&gt;display_name&lt;/code&gt; can&amp;#39;t go &lt;code&gt;NOT NULL&lt;/code&gt; over 12 empty rows, and the drop stays out until you tick it.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Anything only the target has, a column or a table the source dropped, starts under &lt;code&gt;Left out of the script&lt;/code&gt; with what adding it would delete. Tick it to add it. &lt;code&gt;Structure&lt;/code&gt; on a table shows its
columns on both sides.&lt;/p&gt;
&lt;h2 id=&quot;confirm-renames&quot;&gt;Confirm renames&lt;a class=&quot;guide-anchor&quot; href=&quot;#confirm-renames&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Two connections can&amp;#39;t tell a rename from a drop and an add. When a dropped column and an added
one share a type, Seqora asks above the list, in the form &amp;quot;Rename column ... to ...?&amp;quot;.
&lt;code&gt;Rename&lt;/code&gt; keeps the values. &lt;code&gt;Not a rename&lt;/code&gt; leaves the pair as a drop and an add.
Tables are asked about the same way. A saved design knows its renames, so it never asks.&lt;/p&gt;
&lt;h2 id=&quot;apply&quot;&gt;Apply&lt;a class=&quot;guide-anchor&quot; href=&quot;#apply&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Under the script, a strip counts what is in the way, such as &lt;code&gt;1 failing&lt;/code&gt; and &lt;code&gt;2 to check&lt;/code&gt;, and
what passed, such as &lt;code&gt;No data lost&lt;/code&gt; and &lt;code&gt;No rewrites&lt;/code&gt;. Click a count to jump to its row. Point at
&lt;code&gt;No data lost&lt;/code&gt; for the whole line: &amp;quot;Deletes no data. 1 drop left out.&amp;quot; The button says why it is
waiting, for example &lt;code&gt;Fix 1 failure to continue&lt;/code&gt;. Leave the failing row out, or fix its data in
the SQL editor and compare again.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Review and apply · 3 statements&lt;/code&gt; opens &lt;a href=&quot;/guide/review-dialogs/&quot;&gt;Review changes&lt;/a&gt; with the same &lt;code&gt;Checks&lt;/code&gt;, &lt;code&gt;Dry run&lt;/code&gt; and apply steps a design uses, and the same typed database name on production. Before the
first statement runs, Seqora saves a snapshot of the target. When it&amp;#39;s done, the catalog
refreshes and the compare reads both sides again.&lt;/p&gt;
&lt;h2 id=&quot;snapshots-and-undo&quot;&gt;Snapshots and undo&lt;a class=&quot;guide-anchor&quot; href=&quot;#snapshots-and-undo&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;Schema snapshots…&lt;/code&gt; on a schema, or &lt;code&gt;Snapshots&lt;/code&gt; in the compare&amp;#39;s toolbar, lists the snapshots of
that schema, newest first, under &lt;code&gt;Live now&lt;/code&gt;. &lt;code&gt;Take snapshot&lt;/code&gt; saves one under a name you choose,
such as &lt;code&gt;Release 4.2&lt;/code&gt;. The ones Seqora takes before an apply are named &amp;quot;Before applying &lt;name&gt;&amp;quot;,
and the 20 newest of those are kept per schema. &lt;a href=&quot;/guide/schema-history/&quot;&gt;Schema history&lt;/a&gt; records
snapshots of its own, and they are listed here too.&lt;/p&gt;
&lt;p&gt;A snapshot Seqora took, before an apply or for history, has &lt;code&gt;Undo script&lt;/code&gt;. It compares the live schema with that
snapshot, so the script puts the schema back the way it was. Data a drop deleted does not come
back.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Compare covers tables, columns, keys, indexes, foreign keys and comments. Views and
materialized views are counted but never changed. On PostgreSQL, check constraints, enums,
domains, sequences, triggers, functions and policies are not compared yet, and the
&lt;code&gt;Not compared:&lt;/code&gt; line at the bottom of the tab names what was skipped on each engine.&lt;/li&gt;
&lt;li&gt;Partial and expression indexes and generated columns in the source can&amp;#39;t be created yet. They
are listed under &lt;code&gt;Left out of the script&lt;/code&gt; and never put in the script.&lt;/li&gt;
&lt;li&gt;Differences in constraint and index names and in comments are ignored unless you untick them
under &lt;code&gt;Ignore&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;If Seqora could only read part of either side, the compare is read-only: an unread table would
look like a drop.&lt;/li&gt;
&lt;li&gt;On MySQL and MariaDB, if a statement fails during apply, the ones before it stay applied. Compare
again to see what is left.&lt;/li&gt;
&lt;li&gt;Snapshots and their names stay on Free and can be listed and deleted there. Taking, renaming and
comparing them is Pro.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;Every migration I have watched go wrong was right about the schema and wrong about the data: a
&lt;code&gt;NOT NULL&lt;/code&gt; over rows nobody knew were empty, a drop of a column a report still read. A diff that
only lists &lt;code&gt;ALTER&lt;/code&gt; statements leaves that part to you. This one counts the rows first.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
</content>
  </entry>
  <entry>
    <title>History and SQL files</title>
    <link href="https://seqora.dev/guide/history-and-sql-files/" />
    <id>https://seqora.dev/guide/history-and-sql-files/</id>
    <published>2026-11-13T00:00:00Z</published>
    <updated>2026-11-13T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Find a query you ran last week, know what Seqora keeps about it, and keep the SQL you care about as .sql files.</summary>
    <content type="html">&lt;p&gt;Read this when you need a query you ran last Tuesday, or want to know what Seqora writes to disk
about the SQL you type. History is automatic and short-lived. Files are the SQL you chose to
keep.&lt;/p&gt;
&lt;h2 id=&quot;find-a-query-you-ran&quot;&gt;Find a query you ran&lt;a class=&quot;guide-anchor&quot; href=&quot;#find-a-query-you-ran&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Click &lt;code&gt;History&lt;/code&gt; at the top of the sidebar, or run &lt;code&gt;Show query history&lt;/code&gt; from the command
palette.&lt;/li&gt;
&lt;li&gt;Choose &lt;code&gt;All&lt;/code&gt; or &lt;code&gt;This connection&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Type part of the SQL or the connection&amp;#39;s name into the search box.&lt;/li&gt;
&lt;li&gt;Click the run you want.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The SQL opens in an editor. Seqora never re-runs it for you. Press &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;↩&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt; when
you&amp;#39;re ready.&lt;/p&gt;
&lt;p&gt;Runs are grouped by day. Each shows its status, the time, the connection in &lt;code&gt;All&lt;/code&gt;, how long it
took and the rows it affected. &lt;code&gt;Failed&lt;/code&gt; and &lt;code&gt;Rolled back&lt;/code&gt; narrow the list to those runs. Two
badges mark transactions: &lt;code&gt;Rolled back&lt;/code&gt;, &amp;quot;This run&amp;#39;s transaction was rolled back; its changes
did not persist.&amp;quot;, and &lt;code&gt;Uncommitted&lt;/code&gt;, for a run whose transaction was still open when it was
recorded.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/history-sidebar.webp?v=aff1c9ad03&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/history-sidebar.webp?v=aff1c9ad03&quot; width=&quot;264&quot; height=&quot;560&quot; alt=&quot;The History view of the sidebar with today&amp;#39;s runs, a failed one and one marked Rolled back, and the All, This connection, Failed and Rolled back filters.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;what-history-keeps&quot;&gt;What history keeps&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-history-keeps&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Settings › Privacy says it under Query history: &amp;quot;The SQL you run is kept encrypted on this
computer for 30 days. Results are never stored.&amp;quot; The same section has the switches:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Keep query history&lt;/code&gt;, on by default. Off records nothing new and keeps what is already there.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Keep history for&lt;/code&gt;: 7, 30 or 90 days, or &lt;code&gt;Forever&lt;/code&gt;. 30 is the default.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Keep failed and cancelled runs&lt;/code&gt;, on by default. Off keeps only runs that completed.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;What a kept run holds:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Each run&amp;#39;s SQL, up to 16,384 characters, with its status, duration and affected-row count.&lt;/li&gt;
&lt;li&gt;At most 500 runs across every connection, and none older than &lt;code&gt;Keep history for&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;No result rows, column names, notices or error messages.&lt;/li&gt;
&lt;li&gt;Changes applied from the grid (&lt;a href=&quot;/guide/edit-data/&quot;&gt;Edit data&lt;/a&gt;), one run per statement.&lt;/li&gt;
&lt;li&gt;No passwords. &lt;code&gt;ALTER ROLE … PASSWORD&lt;/code&gt;, &lt;code&gt;IDENTIFIED BY&lt;/code&gt;, &lt;code&gt;SET PASSWORD&lt;/code&gt;, a password inside a
connection string, a SQLCipher &lt;code&gt;PRAGMA key&lt;/code&gt;, and the same things inside a &lt;code&gt;DO&lt;/code&gt; body, an
&lt;code&gt;EXECUTE&lt;/code&gt; string or a &lt;code&gt;format()&lt;/code&gt; call are replaced with &lt;code&gt;&amp;lt;redacted&amp;gt;&lt;/code&gt; before the run is
written. The SQL that runs is untouched.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;History lives in Seqora&amp;#39;s encrypted app database on this computer. Deleting a connection deletes
its history too. Anything you want to keep for good belongs in a file.&lt;/p&gt;
&lt;p&gt;Opening a redacted run says so: &amp;quot;History kept this query with its passwords taken out. Replace
each &lt;redacted&gt; before you run it.&amp;quot; Inside a string literal &lt;code&gt;&amp;lt;redacted&amp;gt;&lt;/code&gt; is only text, so the
statement could run with it. Read it before you press &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;↩&lt;/kbd&gt;&lt;/kbd&gt;.&lt;/p&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;History is there so you can find a query again, so I take passwords out before a run is
written to disk, not when it is shown. The SQL that runs is never changed. Seqora redacts the
whole text before it cuts it to 16,384 characters, because what marks a secret can come after
the part history keeps: a &lt;code&gt;PASSWORD&lt;/code&gt; further down a &lt;code&gt;DO&lt;/code&gt; body that set the password earlier.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
&lt;h2 id=&quot;clear-a-connections-history&quot;&gt;Clear a connection&amp;#39;s history&lt;a class=&quot;guide-anchor&quot; href=&quot;#clear-a-connections-history&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Switch the view to &lt;code&gt;This connection&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Clear this connection’s history…&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Clear history&lt;/code&gt;. &lt;code&gt;Keep&lt;/code&gt; backs out.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;save-a-query-as-a-file&quot;&gt;Save a query as a file&lt;a class=&quot;guide-anchor&quot; href=&quot;#save-a-query-as-a-file&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Press &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;S&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;S&lt;/kbd&gt;&lt;/kbd&gt; in an editor.&lt;/li&gt;
&lt;li&gt;Type a &lt;code&gt;File name&lt;/code&gt; in the &lt;code&gt;Save SQL&lt;/code&gt; dialog, for example &lt;code&gt;refunds-last-30-days&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Press &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/save-sql.webp?v=57cab233cc&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/save-sql.webp?v=57cab233cc&quot; width=&quot;420&quot; height=&quot;202&quot; alt=&quot;The Save SQL dialog with the file name refunds-last-30-days, and Cancel and Save.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;p&gt;Seqora writes &lt;code&gt;refunds-last-30-days.sql&lt;/code&gt; into its SQL library, a folder named &lt;code&gt;sql&lt;/code&gt; in Seqora&amp;#39;s
app data folder. The sidebar&amp;#39;s &lt;code&gt;Queries&lt;/code&gt; view lists that folder: click &lt;code&gt;Queries&lt;/code&gt;, or run
&lt;code&gt;Show saved queries&lt;/code&gt; from the palette. From then on &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;S&lt;/kbd&gt;&lt;/kbd&gt; writes back to the same file without
asking. If the name is already taken, the first save asks &lt;code&gt;Replace refunds-last-30-days.sql?&lt;/code&gt;
and says that replacing can&amp;#39;t be undone. &lt;code&gt;Replace&lt;/code&gt; overwrites, &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Esc&lt;/kbd&gt;&lt;/kbd&gt; keeps both.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/queries-sidebar.webp?v=79eee96ce3&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/queries-sidebar.webp?v=79eee96ce3&quot; width=&quot;264&quot; height=&quot;240&quot; alt=&quot;The Queries view of the sidebar, listing refunds-last-30-days, with Filter saved queries and a New query button.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;p&gt;To put the file somewhere else, such as a &lt;code&gt;migrations&lt;/code&gt; folder in your repository, use
&lt;code&gt;Save SQL as…&lt;/code&gt;, &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;S&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;S&lt;/kbd&gt;&lt;/kbd&gt;. It asks for a folder.&lt;/p&gt;
&lt;h2 id=&quot;rename-copy-or-delete-a-saved-query&quot;&gt;Rename, copy or delete a saved query&lt;a class=&quot;guide-anchor&quot; href=&quot;#rename-copy-or-delete-a-saved-query&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Right-click a query in &lt;code&gt;Queries&lt;/code&gt; for &lt;code&gt;Open&lt;/code&gt;, &lt;code&gt;Rename&lt;/code&gt;, &lt;code&gt;Duplicate&lt;/code&gt; and &lt;code&gt;Delete…&lt;/code&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Rename&lt;/code&gt;, or &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;F2&lt;/kbd&gt;&lt;/kbd&gt; on the selected query, edits the name in place. A name another file already
has is refused.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Duplicate&lt;/code&gt; copies the file to &lt;code&gt;refunds-last-30-days copy.sql&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Delete…&lt;/code&gt; asks &lt;code&gt;Delete “refunds-last-30-days”?&lt;/code&gt; and moves the file to the Recycle Bin on
Windows or the Trash on macOS, so you can get it back. Its open tab closes.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Double-clicking an editor&amp;#39;s tab renames it the same way. A saved editor renames its file. An
unsaved one only changes the name &lt;code&gt;Save SQL&lt;/code&gt; will suggest.&lt;/p&gt;
&lt;h2 id=&quot;open-a-file-from-disk&quot;&gt;Open a file from disk&lt;a class=&quot;guide-anchor&quot; href=&quot;#open-a-file-from-disk&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Press &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;O&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;O&lt;/kbd&gt;&lt;/kbd&gt;, or run &lt;code&gt;Open file…&lt;/code&gt; from the palette.&lt;/li&gt;
&lt;li&gt;Pick a &lt;code&gt;.sql&lt;/code&gt; file.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The file opens in an editor that saves back to the same path. Double-clicking a &lt;code&gt;.sql&lt;/code&gt; file in
the OS or dropping one on the window does the same, up to 20 files at a time. A file that is
already open is focused, not opened twice.&lt;/p&gt;
&lt;p&gt;The editor keeps the file as it found it. A UTF-8 byte order mark is dropped on the way in and
written back on save, and a UTF-16 file stays UTF-16. A file over 2 MB is refused with
&amp;quot;…is larger than 2 MB, the most a SQL editor opens.&amp;quot;, and a file that isn&amp;#39;t UTF-8 or UTF-16
text with &amp;quot;Save it as UTF-8 and open it again.&amp;quot;&lt;/p&gt;
&lt;p&gt;A file remembers no connection, so it opens on the active one. If that connection is
production, Seqora asks first: &amp;quot;commerce-primary is a production connection, so Seqora asks
before opening refunds-last-30-days.sql on it.&amp;quot;&lt;/p&gt;
&lt;h2 id=&quot;drafts-and-restored-tabs&quot;&gt;Drafts and restored tabs&lt;a class=&quot;guide-anchor&quot; href=&quot;#drafts-and-restored-tabs&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;An editor you never saved isn&amp;#39;t lost. Seqora saves its text as a draft about a second after you
stop typing, in the encrypted app database. With &lt;code&gt;Restore open tabs and panel layout&lt;/code&gt; on, in
Settings › General, your editors come back when Seqora starts.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Recent scripts&lt;/code&gt; lists your SQL editors, saved or not, with the folder of each saved one. Open
it from the palette with &lt;code&gt;Open recent SQL script…&lt;/code&gt;, or with &lt;code&gt;Browse recent scripts&lt;/code&gt; on an empty
workspace.&lt;/p&gt;
&lt;h2 id=&quot;close-an-editor&quot;&gt;Close an editor&lt;a class=&quot;guide-anchor&quot; href=&quot;#close-an-editor&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Closing an editor with unsaved edits asks &lt;code&gt;Save changes to refunds-last-30-days?&lt;/code&gt;.&lt;/p&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Button&lt;/th&gt;
&lt;th&gt;Key&lt;/th&gt;
&lt;th&gt;What happens&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Save…&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;S&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;S&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;Saves to a file, then closes.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Don&amp;#39;t save&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;⌘⌫&lt;/code&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Alt&lt;/kbd&gt;&lt;kbd&gt;N&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;Closes without writing a file.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Esc&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Keeps the editor open.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;An editor that is still running a query asks &lt;code&gt;Query still running&lt;/code&gt; and offers
&lt;code&gt;Cancel query and close&lt;/code&gt;. One with an open transaction asks &lt;code&gt;Transaction still open&lt;/code&gt; and offers
&lt;code&gt;Roll back and close&lt;/code&gt;. Both offer &lt;code&gt;Keep editing&lt;/code&gt;, and both need &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;↩&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt;, so a
stray &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt; does neither. Closing an editor pane inside a split asks the same questions.
Turning off Settings › SQL editor › &lt;code&gt;Ask to save before closing&lt;/code&gt; drops the unsaved-edits question.
A running query or an open transaction still asks.&lt;/p&gt;
&lt;h2 id=&quot;custom-commands&quot;&gt;Custom commands&lt;a class=&quot;guide-anchor&quot; href=&quot;#custom-commands&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Custom commands are YAML files in &lt;code&gt;~/.seqora/commands/&lt;/code&gt;, &lt;code&gt;%USERPROFILE%\.seqora\commands&lt;/code&gt; on
Windows, that run SQL and shell steps from the command palette. Start one with
&lt;code&gt;New custom command…&lt;/code&gt; in the palette.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;History is per computer. It isn&amp;#39;t synced, and it isn&amp;#39;t an audit log: a run that fails to
record is skipped with a warning, and the query still runs.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Clear this connection’s history…&lt;/code&gt; appears only in &lt;code&gt;This connection&lt;/code&gt;. There is no button that
clears every connection at once.&lt;/li&gt;
&lt;li&gt;A run recorded without its SQL shows &lt;code&gt;SQL not recorded&lt;/code&gt; and can&amp;#39;t be opened.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Queries&lt;/code&gt; lists the library folder and nothing else. A file saved elsewhere with
&lt;code&gt;Save SQL as…&lt;/code&gt; is reached through &lt;code&gt;Recent scripts&lt;/code&gt; or &lt;code&gt;Open file…&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A history entry over 16,384 characters keeps the first 16,384. Save long migrations as files.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Keep history for&lt;/code&gt; applies the next time history is written or opened, so a shorter setting
removes older runs then.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry>
    <title>Connect an AI agent to Seqora</title>
    <link href="https://seqora.dev/guide/connect-an-agent/" />
    <id>https://seqora.dev/guide/connect-an-agent/</id>
    <published>2026-11-13T00:00:00Z</published>
    <updated>2026-11-13T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Install Seqora&#39;s MCP server into Claude Code, Cursor, Codex, Claude Desktop or VS Code, choose what each connection shares, and see every call.</summary>
    <content type="html">&lt;p&gt;Read this when the agent in your editor keeps guessing at your schema, or asks you to paste
table definitions into the chat. Seqora has an MCP server built in. Once an agent is connected
it can read &lt;code&gt;commerce.orders&lt;/code&gt; for itself, run a read-only query and ask whether an index is
worth building. It never gets a password and it can&amp;#39;t write. Seqora has no model of its own:
the agent you already use brings the AI.&lt;/p&gt;
&lt;h2 id=&quot;install-it-into-your-agent&quot;&gt;Install it into your agent&lt;a class=&quot;guide-anchor&quot; href=&quot;#install-it-into-your-agent&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Press &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;,&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;,&lt;/kbd&gt;&lt;/kbd&gt; and open &lt;code&gt;Agents&lt;/code&gt;, under System. The &lt;code&gt;Clients&lt;/code&gt; list has one row per
client: &lt;code&gt;Claude Code&lt;/code&gt;, &lt;code&gt;Cursor&lt;/code&gt;, &lt;code&gt;Codex&lt;/code&gt;, &lt;code&gt;Claude Desktop&lt;/code&gt;, &lt;code&gt;VS Code&lt;/code&gt; and &lt;code&gt;Other&lt;/code&gt;, each with
its maker&amp;#39;s mark.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Install&lt;/code&gt; on your client&amp;#39;s row. The dialog names the file Seqora will write, or for
Claude Code the command it will run. Click &lt;code&gt;Install&lt;/code&gt; again to confirm.&lt;/li&gt;
&lt;li&gt;In the agent, ask it to list your connections. Back in Seqora the row reads &lt;code&gt;Connected&lt;/code&gt;, with
the time the client was last seen. Before its first call it reads &lt;code&gt;Installed&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/agent-clients.webp?v=3fccaecb4f&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/agent-clients-800.webp?v=495bb4b1f2&quot; srcset=&quot;/guide/shots/agent-clients-800.webp?v=495bb4b1f2 800w, /guide/shots/agent-clients.webp?v=3fccaecb4f 1716w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(858px, 46rem)&quot; width=&quot;858&quot; height=&quot;308&quot; alt=&quot;The Clients list in Settings, Agents, before anything is installed: six clients with their maker marks, each row offering Install and Copy config.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;After an install the row&amp;#39;s state changes. &lt;code&gt;Connected&lt;/code&gt; means the client called within the last
10 minutes. &lt;code&gt;Old token&lt;/code&gt; means its config holds a token Seqora no longer accepts: click &lt;code&gt;Install&lt;/code&gt;
again.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;What &lt;code&gt;Install&lt;/code&gt; changes, per client:&lt;/p&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Client&lt;/th&gt;
&lt;th&gt;What Install writes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;Claude Code&lt;/td&gt;
&lt;td&gt;Runs &lt;code&gt;claude mcp add --scope user seqora&lt;/code&gt; when &lt;code&gt;claude&lt;/code&gt; is installed, otherwise writes &lt;code&gt;mcpServers&lt;/code&gt; in &lt;code&gt;~/.claude.json&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cursor&lt;/td&gt;
&lt;td&gt;&lt;code&gt;mcpServers&lt;/code&gt; in &lt;code&gt;~/.cursor/mcp.json&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Codex&lt;/td&gt;
&lt;td&gt;The &lt;code&gt;[mcp_servers.seqora]&lt;/code&gt; table in &lt;code&gt;~/.codex/config.toml&lt;/code&gt;, or under &lt;code&gt;$CODEX_HOME&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Claude Desktop&lt;/td&gt;
&lt;td&gt;&lt;code&gt;mcpServers&lt;/code&gt; in &lt;code&gt;claude_desktop_config.json&lt;/code&gt; in Claude&amp;#39;s config folder, or the Microsoft Store build&amp;#39;s own folder on Windows&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VS Code&lt;/td&gt;
&lt;td&gt;&lt;code&gt;servers&lt;/code&gt; in the user &lt;code&gt;mcp.json&lt;/code&gt; beside &lt;code&gt;settings.json&lt;/code&gt;, or VS Code Insiders&amp;#39; when only Insiders is installed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;Every entry is named &lt;code&gt;seqora&lt;/code&gt;. It runs Seqora&amp;#39;s own executable with the argument &lt;code&gt;mcp&lt;/code&gt;, and
carries a client token in &lt;code&gt;SEQORA_MCP_CLIENT&lt;/code&gt;. JSON files are edited in place, so comments,
other servers and indentation survive, and the old file is copied to
&lt;code&gt;&amp;lt;name&amp;gt;.seqora-backup-&amp;lt;seconds&amp;gt;&lt;/code&gt; first.&lt;/p&gt;
&lt;h2 id=&quot;add-it-to-another-client-by-hand&quot;&gt;Add it to another client by hand&lt;a class=&quot;guide-anchor&quot; href=&quot;#add-it-to-another-client-by-hand&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Click &lt;code&gt;Copy config&lt;/code&gt; on the &lt;code&gt;Other&lt;/code&gt; row. Seqora makes a token, puts the entry on the clipboard
and shows it under the row.&lt;/li&gt;
&lt;li&gt;Paste it into your client&amp;#39;s MCP config. For &lt;code&gt;Other&lt;/code&gt; it has this shape:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#code&quot; /&gt;&lt;/svg&gt;JSON&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;json&quot;&gt;&lt;code&gt;{
  &lt;span class=&quot;tok-key&quot;&gt;&amp;quot;mcpServers&amp;quot;&lt;/span&gt;: {
    &lt;span class=&quot;tok-key&quot;&gt;&amp;quot;seqora&amp;quot;&lt;/span&gt;: {
      &lt;span class=&quot;tok-key&quot;&gt;&amp;quot;command&amp;quot;&lt;/span&gt;: &lt;span class=&quot;tok-string&quot;&gt;&amp;quot;&amp;lt;path to Seqora&amp;gt;&amp;quot;&lt;/span&gt;,
      &lt;span class=&quot;tok-key&quot;&gt;&amp;quot;args&amp;quot;&lt;/span&gt;: [&lt;span class=&quot;tok-string&quot;&gt;&amp;quot;mcp&amp;quot;&lt;/span&gt;],
      &lt;span class=&quot;tok-key&quot;&gt;&amp;quot;env&amp;quot;&lt;/span&gt;: { &lt;span class=&quot;tok-key&quot;&gt;&amp;quot;SEQORA_MCP_CLIENT&amp;quot;&lt;/span&gt;: &lt;span class=&quot;tok-string&quot;&gt;&amp;quot;&amp;lt;token&amp;gt;&amp;quot;&lt;/span&gt; }
    }
  }
}&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;Copy config&lt;/code&gt; works on every row: Codex gets the TOML table, and Claude Code gets the
&lt;code&gt;claude mcp add&lt;/code&gt; line when &lt;code&gt;claude&lt;/code&gt; is installed. &lt;code&gt;Install&lt;/code&gt; and &lt;code&gt;Copy config&lt;/code&gt; both make a new
token, and the client&amp;#39;s previous token stops working. &lt;code&gt;Remove&lt;/code&gt; revokes the token. The entry
stays in the client&amp;#39;s file and is refused from then on.&lt;/p&gt;
&lt;p&gt;The client starts &lt;code&gt;seqora mcp&lt;/code&gt;, which relays the client&amp;#39;s messages to the running app over a
named pipe that only your Windows user can open, or a Unix socket with mode &lt;code&gt;0600&lt;/code&gt; on macOS and
Linux.&lt;/p&gt;
&lt;h2 id=&quot;choose-what-each-connection-shares&quot;&gt;Choose what each connection shares&lt;a class=&quot;guide-anchor&quot; href=&quot;#choose-what-each-connection-shares&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Under &lt;code&gt;Connections&lt;/code&gt;, each connection has &lt;code&gt;Off&lt;/code&gt;, &lt;code&gt;Read&lt;/code&gt; and &lt;code&gt;Propose&lt;/code&gt;. Every connection starts
&lt;code&gt;Off&lt;/code&gt;, and an agent that names it is told it &lt;code&gt;is not shared with agents&lt;/code&gt;. &lt;code&gt;Read&lt;/code&gt; opens the read
tools. &lt;code&gt;Propose&lt;/code&gt; adds the proposal tools. Setting &lt;code&gt;Propose&lt;/code&gt; on a connection whose environment is
production asks you to type the connection&amp;#39;s name.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt; switch beside it is off by default. In 0.6.1 the agent sees the setting in
&lt;code&gt;list_connections&lt;/code&gt;, and &lt;code&gt;run_query&lt;/code&gt; still refuses &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt; whatever it says.&lt;/p&gt;
&lt;h2 id=&quot;what-the-agent-can-call&quot;&gt;What the agent can call&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-the-agent-can-call&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Reads&lt;/th&gt;
&lt;th&gt;Tools&lt;/th&gt;
&lt;th&gt;Plan&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;Connections and schema&lt;/td&gt;
&lt;td&gt;&lt;code&gt;list_connections&lt;/code&gt;, &lt;code&gt;get_schema&lt;/code&gt;, &lt;code&gt;describe_object&lt;/code&gt;, &lt;code&gt;database_brief&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Free&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data&lt;/td&gt;
&lt;td&gt;&lt;code&gt;run_query&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Free&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Schema history&lt;/td&gt;
&lt;td&gt;&lt;code&gt;schema_history&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Free for the last 7 days, Pro before that&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Indexes&lt;/td&gt;
&lt;td&gt;&lt;code&gt;check_index&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Free&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Indexes, ranked&lt;/td&gt;
&lt;td&gt;&lt;code&gt;advise_indexes&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Pro&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Proposals&lt;/td&gt;
&lt;td&gt;&lt;code&gt;propose_change&lt;/code&gt;, &lt;code&gt;revise_proposal&lt;/code&gt;, &lt;code&gt;get_proposal&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Pro&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;run_query&lt;/code&gt; takes exactly one statement that Seqora classifies as read-only: &lt;code&gt;SELECT&lt;/code&gt;, &lt;code&gt;WITH&lt;/code&gt;,
&lt;code&gt;VALUES&lt;/code&gt;, &lt;code&gt;SHOW&lt;/code&gt;, or &lt;code&gt;EXPLAIN&lt;/code&gt; without &lt;code&gt;ANALYZE&lt;/code&gt;. It returns 100 rows by default and 500 at
most, cut at 256 KB, with a 15-second timeout. &lt;code&gt;database_brief&lt;/code&gt; is the
&lt;a href=&quot;/guide/what-is-in-this-database/&quot;&gt;brief&lt;/a&gt;, built from the catalog and statistics, never table
data. &lt;code&gt;check_index&lt;/code&gt; takes up to 5 &lt;code&gt;CREATE INDEX&lt;/code&gt; statements and tests each as a hypothetical
index against the statements in &lt;code&gt;pg_stat_statements&lt;/code&gt;. It answers &lt;code&gt;build&lt;/code&gt;, &lt;code&gt;skip&lt;/code&gt;, &lt;code&gt;exists&lt;/code&gt;,
&lt;code&gt;replace&lt;/code&gt; or &lt;code&gt;not_testable&lt;/code&gt; and creates nothing. &lt;code&gt;advise_indexes&lt;/code&gt; is the ranking the
&lt;a href=&quot;/guide/which-indexes-are-missing/&quot;&gt;index advisor&lt;/a&gt; draws.&lt;/p&gt;
&lt;p&gt;On Free the agent still sees every tool, and the paid ones start their description with
&lt;code&gt;[Pro]&lt;/code&gt;. &lt;code&gt;Propose&lt;/code&gt; can be set on Free as well. A &lt;code&gt;propose_change&lt;/code&gt; there is saved in Seqora,
locked, and the agent is told it will open when you start the trial. &lt;code&gt;revise_proposal&lt;/code&gt;,
&lt;code&gt;get_proposal&lt;/code&gt; and &lt;code&gt;advise_indexes&lt;/code&gt; are refused.&lt;/p&gt;
&lt;h2 id=&quot;what-the-agent-cant-do&quot;&gt;What the agent can&amp;#39;t do&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-the-agent-cant-do&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;No tool writes to a database. Each &lt;code&gt;run_query&lt;/code&gt; opens its own connection in the database&amp;#39;s
read-only mode, &lt;code&gt;default_transaction_read_only&lt;/code&gt; on PostgreSQL, runs the one statement and closes
it. That connection is separate from yours, so unlocking the connection in Seqora&amp;#39;s window gives
an agent nothing more. Writes, DDL and scripts are refused before anything runs.&lt;/p&gt;
&lt;p&gt;The proposal tools write only to Seqora&amp;#39;s own store. A change an agent proposes reaches the
database when you apply it in Seqora: see
&lt;a href=&quot;/guide/review-an-agent-proposal/&quot;&gt;Review an agent&amp;#39;s proposal&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;see-what-it-asked-for&quot;&gt;See what it asked for&lt;a class=&quot;guide-anchor&quot; href=&quot;#see-what-it-asked-for&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;Activity&lt;/code&gt;, at the bottom of the page, lists every call: the time, the client with its mark, the
tool, the connection and a short summary, then a mark for &lt;code&gt;Done&lt;/code&gt;, &lt;code&gt;Refused&lt;/code&gt; or &lt;code&gt;Failed&lt;/code&gt;. Switch between &lt;code&gt;Today&lt;/code&gt; and &lt;code&gt;7 days&lt;/code&gt;. A &lt;code&gt;run_query&lt;/code&gt; is logged as its row
count and its time in milliseconds, never its rows. Calls older than 30 days are deleted when
Seqora starts.&lt;/p&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;I put an MCP server in Seqora instead of a chat panel. The agent you already use has its own
model and your code open, so Seqora&amp;#39;s part is the database: named connections, read-only reads
and checks. The password stays in Seqora, and the agent&amp;#39;s config holds a token you can revoke
from this page.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;What an agent reads goes to the agent, and the agent sends it to the model it runs on. That
includes up to 500 rows of any &lt;code&gt;run_query&lt;/code&gt;, the DDL and comments of tables it describes, row
estimates, schema history, and the statement texts &lt;code&gt;check_index&lt;/code&gt; reads from
&lt;code&gt;pg_stat_statements&lt;/code&gt;. Seqora&amp;#39;s server is a local pipe and sends none of it anywhere else.
Seqora&amp;#39;s anonymous usage count records only that the feature was used, and &lt;code&gt;Count feature use&lt;/code&gt;
under Privacy turns it off.&lt;/li&gt;
&lt;li&gt;Values, comments and object names come back inside &lt;code&gt;&amp;lt;untrusted-data&amp;gt;&lt;/code&gt; blocks, and the server
tells the agent to treat them as data, never as instructions. That is a request to the model,
not a guarantee.&lt;/li&gt;
&lt;li&gt;Database passwords never appear in a result or in a client&amp;#39;s config. The token names the
client for &lt;code&gt;Activity&lt;/code&gt; and is not a database credential.&lt;/li&gt;
&lt;li&gt;When Seqora isn&amp;#39;t running, &lt;code&gt;seqora mcp&lt;/code&gt; starts it without a window and waits up to 20 seconds
for it. The window stays hidden until you open Seqora.&lt;/li&gt;
&lt;li&gt;The read tools work on PostgreSQL, MySQL, MariaDB, SQLite and SQL Server. &lt;code&gt;check_index&lt;/code&gt; is
PostgreSQL only. &lt;code&gt;advise_indexes&lt;/code&gt; tests adds on PostgreSQL only: on MySQL, MariaDB and SQL
Server it lists top statements and drops. Proposals take PostgreSQL and SQL Server.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry>
    <title>Review an agent&#39;s proposal</title>
    <link href="https://seqora.dev/guide/review-an-agent-proposal/" />
    <id>https://seqora.dev/guide/review-an-agent-proposal/</id>
    <published>2026-11-13T00:00:00Z</published>
    <updated>2026-11-13T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>An agent proposes a schema change over MCP. Read its rows, SQL and locks in Seqora, then apply it, approve it for a migration or send it back.</summary>
    <content type="html">&lt;p&gt;Read this when an agent connected to Seqora has proposed a schema change and a toast says so.
An agent never runs DDL. It sends ordinary SQL to &lt;code&gt;propose_change&lt;/code&gt;, and Seqora turns it into a
design on the live schema and checks it. The change reaches the database only when you apply it
here. Proposal review is Pro. Giving an agent &lt;code&gt;Propose&lt;/code&gt; access is on
&lt;a href=&quot;/guide/connect-an-agent/&quot;&gt;Connect an AI agent&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;what-a-proposal-is&quot;&gt;What a proposal is&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-a-proposal-is&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A proposal is a schema change, stored in Seqora as a design with numbered revisions. In 0.6.1
that is the only kind. On PostgreSQL the agent may send &lt;code&gt;CREATE TABLE&lt;/code&gt;, &lt;code&gt;ALTER TABLE&lt;/code&gt;,
&lt;code&gt;CREATE INDEX&lt;/code&gt;, &lt;code&gt;DROP INDEX&lt;/code&gt;, &lt;code&gt;RENAME&lt;/code&gt; and &lt;code&gt;COMMENT&lt;/code&gt;. Anything else is refused, by statement,
line and column, to the agent.&lt;/p&gt;
&lt;p&gt;Say an agent was asked to make the web orders report faster. It calls &lt;code&gt;propose_change&lt;/code&gt; with
&lt;code&gt;schema&lt;/code&gt; set to &lt;code&gt;commerce&lt;/code&gt;, the title &lt;code&gt;Index for web orders&lt;/code&gt;, and:&lt;/p&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-key&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;INDEX&lt;/span&gt; orders_channel_placed_idx &lt;span class=&quot;tok-key&quot;&gt;ON&lt;/span&gt; commerce.orders (channel, placed_at &lt;span class=&quot;tok-key&quot;&gt;DESC&lt;/span&gt;);&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Seqora applies that to &lt;code&gt;commerce.orders&lt;/code&gt; as it is now, runs the design and read-only data
checks, and tests the index with &lt;code&gt;check_index&lt;/code&gt;. The agent gets the change list as &lt;code&gt;c1&lt;/code&gt;, &lt;code&gt;c2&lt;/code&gt;,
the checks and a &lt;code&gt;seqora://proposal/&lt;/code&gt; link, and can fix its own blockers with
&lt;code&gt;revise_proposal&lt;/code&gt; before you look.&lt;/p&gt;
&lt;h2 id=&quot;open-it&quot;&gt;Open it&lt;a class=&quot;guide-anchor&quot; href=&quot;#open-it&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Click &lt;code&gt;Review&lt;/code&gt; on the toast. After &lt;code&gt;Later&lt;/code&gt;, the proposal waits under &lt;code&gt;Proposals&lt;/code&gt; in the
sidebar, which appears once a proposal exists. &lt;code&gt;Open proposal…&lt;/code&gt; in the command palette and the
agent&amp;#39;s &lt;code&gt;seqora://proposal/&lt;/code&gt; link open the same tab.&lt;/li&gt;
&lt;li&gt;Read the header: the client&amp;#39;s maker mark and name, the title, the counts, and a button per
revision, &lt;code&gt;r1&lt;/code&gt;, &lt;code&gt;r2&lt;/code&gt;. The trail under it lists each revision with its author, time and
blocker count, then what you did.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The toolbar shows the connection with a lock, because the tab never writes. When Seqora found a
migrations table, a chip names the tool and its newest migration.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/proposal-tab.webp?v=17af3002f1&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/proposal-tab-800.webp?v=0a8d8a5ced&quot; srcset=&quot;/guide/shots/proposal-tab-800.webp?v=0a8d8a5ced 800w, /guide/shots/proposal-tab.webp?v=17af3002f1 2000w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(1000px, 46rem)&quot; width=&quot;1000&quot; height=&quot;626&quot; alt=&quot;A proposal tab on Changes: the client&amp;#39;s mark and name, revision buttons r1 and r2, the trail, change rows grouped by table with a warning on one row, and the SQL with Before you apply on the right.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;A row a later revision fixed carries &lt;code&gt;fixed in r2&lt;/code&gt;. The SQL on the right is the script Seqora
compiled from the design, not the agent&amp;#39;s text.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;read-the-changes-the-sql-and-the-locks&quot;&gt;Read the changes, the SQL and the locks&lt;a class=&quot;guide-anchor&quot; href=&quot;#read-the-changes-the-sql-and-the-locks&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Read the rows. They are grouped by table, with the table&amp;#39;s row estimate, or &lt;code&gt;new&lt;/code&gt; for a
table the agent creates. A blocker or a warning sits at the end of its row with a short label.
Hover it for the whole sentence.&lt;/li&gt;
&lt;li&gt;Read the script. Click a statement to select its rows, or a row to light its statements.&lt;/li&gt;
&lt;li&gt;Read &lt;code&gt;Before you apply&lt;/code&gt;. Blockers come first, then each warning with a checkbox, then
&lt;code&gt;Snapshot ·&lt;/code&gt; and the connection&amp;#39;s name.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For the index above, the row for &lt;code&gt;orders&lt;/code&gt; carries
&lt;code&gt;Statement 1 blocks writes to commerce.orders while the index builds&lt;/code&gt;. The tooltip says how
many rows are read and gives the &lt;code&gt;CREATE INDEX CONCURRENTLY&lt;/code&gt; form to run outside the
transaction instead. Had &lt;code&gt;check_index&lt;/code&gt; found the index unneeded, the row would also warn
&lt;code&gt;index not needed&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;see-it-on-the-diagram&quot;&gt;See it on the diagram&lt;a class=&quot;guide-anchor&quot; href=&quot;#see-it-on-the-diagram&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Click &lt;code&gt;Diagram&lt;/code&gt; in the toolbar.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The canvas opens framed on the tables the proposal touches. What the agent proposes is dashed
and hatched in the agent color, and each new or changed table carries the client&amp;#39;s mark and
name. Click a table or a column to select its rows and statements. The ER diagram tab itself
does not show proposals.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/proposal-diagram.webp?v=1f5d1b4469&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/proposal-diagram-800.webp?v=2b28b1420a&quot; srcset=&quot;/guide/shots/proposal-diagram-800.webp?v=2b28b1420a 800w, /guide/shots/proposal-diagram.webp?v=1f5d1b4469 1450w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(725px, 46rem)&quot; width=&quot;725&quot; height=&quot;526&quot; alt=&quot;The proposal tab&amp;#39;s Diagram view: proposed tables dashed and tinted violet, a changed column hatched, each tagged with the Claude Code mark and name, joined to the live tables they reference.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;apply-it-approve-it-or-send-it-back&quot;&gt;Apply it, approve it or send it back&lt;a class=&quot;guide-anchor&quot; href=&quot;#apply-it-approve-it-or-send-it-back&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Untick a row to leave that change out. Its statements stay in the script, struck through.
Changes that depend on it, such as a new table&amp;#39;s indexes, are left out with it. Leaving out a
blocked change unblocks the rest.&lt;/li&gt;
&lt;li&gt;Pick one way out:&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Review and apply&lt;/code&gt; opens the review dialog design mode uses: the data checks, a snapshot,
a dry run, the typed database name on production, then the apply. The proposal becomes
&lt;code&gt;Applied&lt;/code&gt;. See &lt;a href=&quot;/guide/review-dialogs/&quot;&gt;the review dialogs&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Approve for migration&lt;/code&gt; stores the SQL for the agent to write as a migration file. It
waits until every warning in &lt;code&gt;Before you apply&lt;/code&gt; is ticked. The proposal becomes
&lt;code&gt;Approved&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Send back&lt;/code&gt; needs a &lt;code&gt;Note for the agent&lt;/code&gt; or a left-out change. The proposal becomes
&lt;code&gt;Sent back&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;code&gt;Approve for migration&lt;/code&gt; is the primary button when Seqora found a migrations table, and
&lt;code&gt;Review and apply&lt;/code&gt; when it didn&amp;#39;t. Both wait while there are blockers, and their tooltip says
&lt;code&gt;Fix 1 blocker&lt;/code&gt;. &lt;code&gt;Proposal actions&lt;/code&gt; holds &lt;code&gt;Discard&lt;/code&gt;, and &lt;code&gt;Edit in designer&lt;/code&gt;, which opens the
&lt;a href=&quot;/guide/design-workbench/&quot;&gt;design workbench&lt;/a&gt;. Saving there makes a revision authored by you.&lt;/p&gt;
&lt;h2 id=&quot;what-the-agent-sees-afterwards&quot;&gt;What the agent sees afterwards&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-the-agent-sees-afterwards&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Seqora sends nothing to the agent. It learns what you did the next time it calls
&lt;code&gt;get_proposal&lt;/code&gt;: the status, your note, the changes you left out as &lt;code&gt;c1&lt;/code&gt;, &lt;code&gt;c2&lt;/code&gt;, the checks, the
DDL it sent last, and the approved SQL once you approve. A revision replaces the whole DDL.
Seqora applies it to the schema as it is then, and says so when the live schema changed in
between. A revision that arrives while the tab is open adds its button with a dot, and the view
stays on the revision you are reading. Applied and discarded proposals can&amp;#39;t be revised.&lt;/p&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;Agents propose and never apply because the failures I designed against all needed a tool that
writes or a credential in the agent&amp;#39;s config. Seqora&amp;#39;s server has neither. Applying is a click
in Seqora, behind the same checks, snapshot and dry run as a change you drew yourself.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The agent receives the change list, the checks with their messages, including what the
read-only data checks found, and the SQL. It sends them on to the model it runs on. Seqora&amp;#39;s
server is a local pipe and sends nothing elsewhere.&lt;/li&gt;
&lt;li&gt;On Free a proposal is saved locked, and the agent is told &amp;quot;Seqora Pro is needed to create
proposals.&amp;quot; Opening it shows the upgrade panel.&lt;/li&gt;
&lt;li&gt;The proposal tools build each revision in Seqora&amp;#39;s window. When Seqora isn&amp;#39;t running,
&lt;code&gt;seqora mcp&lt;/code&gt; starts it with the window hidden.&lt;/li&gt;
&lt;li&gt;Proposals take PostgreSQL and SQL Server. &lt;code&gt;check_index&lt;/code&gt; verdicts are PostgreSQL only. Data
checks skip tables of more than 5,000,000 estimated rows and say &lt;code&gt;not scanned&lt;/code&gt;. The review
dialog can still run them.&lt;/li&gt;
&lt;li&gt;An approved proposal stays &lt;code&gt;Approved&lt;/code&gt; after its migration runs. Seqora 0.6.1 does not match
the migration back to it.&lt;/li&gt;
&lt;li&gt;Older revisions are read-only. Proposal tabs are not reopened after a restart.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry>
    <title>Result pane</title>
    <link href="https://seqora.dev/guide/result-pane/" />
    <id>https://seqora.dev/guide/result-pane/</id>
    <published>2026-11-13T00:00:00Z</published>
    <updated>2026-11-13T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>The pane under the SQL editor: the Result, Chart and Plan switch, result sets, the error card, notices, the row cap, exports and Copy as.</summary>
    <content type="html">&lt;p&gt;The result pane opens under the editor after a run. Its header is the &lt;code&gt;Result&lt;/code&gt;, &lt;code&gt;Chart&lt;/code&gt; and &lt;code&gt;Plan&lt;/code&gt; switch, or &lt;code&gt;Query result&lt;/code&gt; when none of them applies, then &lt;code&gt;N rows · M columns&lt;/code&gt;. &lt;code&gt;Maximize results&lt;/code&gt; gives the pane the whole tab, and &lt;code&gt;Restore editor&lt;/code&gt; brings the SQL back.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/result-pane.webp?v=02018ce3f0&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/result-pane-800.webp?v=bb79ba17c2&quot; srcset=&quot;/guide/shots/result-pane-800.webp?v=bb79ba17c2 800w, /guide/shots/result-pane.webp?v=02018ce3f0 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;370&quot; alt=&quot;A result pane with the Result, Chart and Plan switch, 20 rows and 4 columns, a filter box, Export, and rows of status, channel, orders and revenue_cents.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;result-sets-errors-and-notices&quot;&gt;Result sets, errors and notices&lt;a class=&quot;guide-anchor&quot; href=&quot;#result-sets-errors-and-notices&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;A script with several result sets shows a &lt;code&gt;Result set&lt;/code&gt; button group, numbered &lt;code&gt;1&lt;/code&gt;, &lt;code&gt;2&lt;/code&gt;, &lt;code&gt;3&lt;/code&gt;. Pick one to see its rows. &lt;code&gt;When a run returns results&lt;/code&gt; in Settings › SQL editor chooses &lt;code&gt;Replace earlier&lt;/code&gt; or &lt;code&gt;Keep earlier&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A failed run shows an error card instead of rows: the message, &lt;code&gt;SQLSTATE&lt;/code&gt;, where it failed, the failed line with a caret, and the server&amp;#39;s &lt;code&gt;Detail&lt;/code&gt;, &lt;code&gt;Hint&lt;/code&gt; and &lt;code&gt;Context&lt;/code&gt;. Its buttons are a quick fix when one applies, &lt;code&gt;Go to line N&lt;/code&gt;, &lt;code&gt;Copy error&lt;/code&gt;, &lt;code&gt;Reconnect and retry&lt;/code&gt; after a dropped connection, and &lt;code&gt;Show earlier results&lt;/code&gt; when earlier statements returned rows. Those rows come back under a red banner with &lt;code&gt;Show error&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Run details&lt;/code&gt; holds &lt;code&gt;N notices&lt;/code&gt;, each prefixed &lt;code&gt;Statement N&lt;/code&gt;, open when there are three or fewer.&lt;/li&gt;
&lt;li&gt;A statement without columns says &lt;code&gt;Statement completed&lt;/code&gt; or &lt;code&gt;N rows affected&lt;/code&gt;. One with columns but no rows says &lt;code&gt;The query returned no rows&lt;/code&gt; under its headers. A cancelled run says &lt;code&gt;Run cancelled&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/result-sets.webp?v=0decc49715&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/result-sets-800.webp?v=295991a050&quot; srcset=&quot;/guide/shots/result-sets-800.webp?v=295991a050 800w, /guide/shots/result-sets.webp?v=0decc49715 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;388&quot; alt=&quot;A result pane for a script with three results, with the Result set group numbered 1, 2 and 3, and the first set&amp;#39;s five rows.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;A script of three &lt;code&gt;SELECT&lt;/code&gt;s, on &lt;code&gt;Result set&lt;/code&gt; &lt;code&gt;1&lt;/code&gt;.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;result-chart-and-plan&quot;&gt;Result, Chart and Plan&lt;a class=&quot;guide-anchor&quot; href=&quot;#result-chart-and-plan&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;Result&lt;/code&gt; shows the rows in the &lt;a href=&quot;/guide/data-grid/&quot;&gt;data grid&lt;/a&gt;, read-only. &lt;code&gt;Chart&lt;/code&gt; draws them, and reads &lt;code&gt;Nothing to chart&lt;/code&gt; when the result has nothing it can plot: &lt;a href=&quot;/guide/chart-a-query-result/&quot;&gt;Chart a query result&lt;/a&gt;. &lt;code&gt;Plan&lt;/code&gt; opens the &lt;a href=&quot;/guide/plan-tab/&quot;&gt;Plan tab&lt;/a&gt; for the same statement. After a failed run it reads &lt;code&gt;No plan captured&lt;/code&gt;, after a cancelled one &lt;code&gt;Run cancelled&lt;/code&gt;, each with &lt;code&gt;Capture estimate&lt;/code&gt;. On Free, &lt;code&gt;Plan&lt;/code&gt; carries a Pro badge and opens the upgrade panel.&lt;/p&gt;
&lt;h2 id=&quot;the-row-cap&quot;&gt;The row cap&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-row-cap&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A result keeps at most &lt;code&gt;Rows kept per result&lt;/code&gt; rows, 10,000 by default. The choices are 1,000, 10,000, 50,000 and 100,000. Past the cap the editor&amp;#39;s footer reads &lt;code&gt;Row limit reached · N more not kept&lt;/code&gt;, and &lt;code&gt;Change limit&lt;/code&gt; opens the setting. A result that grows too large in bytes stops with &lt;code&gt;Size limit reached&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;On a locked connection, a plain read outside a transaction is stopped on the server at the cap, so the total is unknown and the footer reads &lt;code&gt;Row limit reached · stopped on the server after N rows&lt;/code&gt;. Everywhere else the rest is read and dropped.&lt;/p&gt;
&lt;h2 id=&quot;export-and-copy&quot;&gt;Export and copy&lt;a class=&quot;guide-anchor&quot; href=&quot;#export-and-copy&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Export&lt;/code&gt; in the toolbar (&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;X&lt;/kbd&gt;&lt;/kbd&gt;) opens the export panel. &lt;code&gt;Loaded&lt;/code&gt; writes the rows in the grid. &lt;code&gt;Full result&lt;/code&gt; (Pro) runs the SQL again and streams every row. The formats are &lt;code&gt;CSV&lt;/code&gt;, &lt;code&gt;TSV&lt;/code&gt;, &lt;code&gt;JSON&lt;/code&gt;, &lt;code&gt;JSONL&lt;/code&gt;, &lt;code&gt;SQL&lt;/code&gt;, &lt;code&gt;XLSX&lt;/code&gt;, &lt;code&gt;Parquet&lt;/code&gt; and &lt;code&gt;Markdown&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;With cells selected, &lt;code&gt;Copy as…&lt;/code&gt; in &lt;code&gt;More actions&lt;/code&gt; copies them as &lt;code&gt;TSV&lt;/code&gt;, &lt;code&gt;CSV&lt;/code&gt;, &lt;code&gt;JSON&lt;/code&gt;, &lt;code&gt;Markdown&lt;/code&gt;, &lt;code&gt;SQL values&lt;/code&gt; or &lt;code&gt;INSERT statements&lt;/code&gt;. &lt;code&gt;Headers&lt;/code&gt; adds column names, and NULL copies as &lt;code&gt;NULL&lt;/code&gt; or &lt;code&gt;Empty&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Sorting, filtering and copying never re-run the query.&lt;/p&gt;
&lt;p&gt;Read: &lt;a href=&quot;/guide/export/&quot;&gt;Export&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>ER diagram</title>
    <link href="https://seqora.dev/guide/er-diagram/" />
    <id>https://seqora.dev/guide/er-diagram/</id>
    <published>2026-11-13T00:00:00Z</published>
    <updated>2026-11-13T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Open a schema&#39;s ER diagram, read its tables and foreign keys, inspect one table, and export the diagram as PNG, SVG or Mermaid.</summary>
    <content type="html">&lt;p&gt;The ER diagram draws one schema&amp;#39;s tables and the foreign keys between them, on every engine.&lt;/p&gt;
&lt;h2 id=&quot;opening-it&quot;&gt;Opening it&lt;a class=&quot;guide-anchor&quot; href=&quot;#opening-it&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Open ER diagram…&lt;/code&gt; (&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;E&lt;/kbd&gt;&lt;/kbd&gt;) and pick a schema.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Show in ER diagram&lt;/code&gt; on a table&amp;#39;s toolbar, or in the explorer&amp;#39;s table menu.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Open ER diagram&lt;/code&gt; on a schema in the explorer.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;what-it-draws&quot;&gt;What it draws&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-it-draws&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Each table shows its key columns with &lt;code&gt;PK&lt;/code&gt;, &lt;code&gt;FK&lt;/code&gt; and &lt;code&gt;UQ&lt;/code&gt; badges, and &lt;code&gt;?&lt;/code&gt; on a nullable one. A table in another schema that a foreign key reaches is drawn too, marked &lt;code&gt;boundary&lt;/code&gt;. Edges carry crow&amp;#39;s-foot cardinality. A partitioned table is one node with a footer: its strategy and key, the partition count, and a strip of what the partitions cover.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/er-diagram.webp?v=63c7a10e5d&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/er-diagram-800.webp?v=1a580d1dcb&quot; srcset=&quot;/guide/shots/er-diagram-800.webp?v=1a580d1dcb 800w, /guide/shots/er-diagram.webp?v=63c7a10e5d 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;722&quot; alt=&quot;The ER diagram of the commerce schema with orders selected and its inspector open: columns, what references it, and tables from other schemas marked boundary.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;&lt;code&gt;commerce&lt;/code&gt; with &lt;code&gt;orders&lt;/code&gt; selected. &lt;code&gt;products&lt;/code&gt;, &lt;code&gt;customers&lt;/code&gt; and &lt;code&gt;invoices&lt;/code&gt; live in other schemas.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;toolbar&quot;&gt;Toolbar&lt;a class=&quot;guide-anchor&quot; href=&quot;#toolbar&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Design changes&lt;/code&gt;: &lt;code&gt;New design for &amp;lt;schema&amp;gt;&lt;/code&gt;, Pro, and &lt;code&gt;Saved designs&lt;/code&gt;. Each opens in the &lt;a href=&quot;/guide/design-workbench/&quot;&gt;Design workbench&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Find table…&lt;/code&gt;: dims the tables that don&amp;#39;t match, and &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt; jumps to the first that does.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Columns&lt;/code&gt;: &lt;code&gt;Keys only&lt;/code&gt;, &lt;code&gt;Selected table&lt;/code&gt;, or &lt;code&gt;All columns&lt;/code&gt;. After you dragged tables it asks &lt;code&gt;Reset table positions?&lt;/code&gt; first.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Export&lt;/code&gt;: opens &lt;code&gt;Export diagram&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Reset canvas&lt;/code&gt;: drops the positions you dragged.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Zoom sits in the canvas corner: &lt;code&gt;Zoom out&lt;/code&gt; (&lt;code&gt;-&lt;/code&gt;), &lt;code&gt;Zoom in&lt;/code&gt; (&lt;code&gt;+&lt;/code&gt;), &lt;code&gt;Actual size&lt;/code&gt; (&lt;code&gt;1&lt;/code&gt;), &lt;code&gt;Fit diagram&lt;/code&gt; (&lt;code&gt;0&lt;/code&gt;) and &lt;code&gt;Fit selection&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Space&lt;/kbd&gt;&lt;/kbd&gt; on a selected table shows only its relationships: what it references on the left, what references it on the right. &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Space&lt;/kbd&gt;&lt;/kbd&gt; on a neighbour hops there. &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Space&lt;/kbd&gt;&lt;/kbd&gt; again or &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Esc&lt;/kbd&gt;&lt;/kbd&gt; leaves.&lt;/p&gt;
&lt;h2 id=&quot;inspector&quot;&gt;Inspector&lt;a class=&quot;guide-anchor&quot; href=&quot;#inspector&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Select a table. Its left edge drags to resize.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The name, the estimated rows, &lt;code&gt;Copy qualified table name&lt;/code&gt; and &lt;code&gt;Open table&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Columns&lt;/code&gt;: badges and types. A foreign key is a chip that jumps to its table. A mark flags a delete that cascades or sets &lt;code&gt;NULL&lt;/code&gt;, and a dot flags a foreign key no index covers.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Referenced by&lt;/code&gt;: the tables pointing here, with their columns.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Indexes&lt;/code&gt; and &lt;code&gt;DDL&lt;/code&gt;, folded.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Dragged positions are kept per diagram on this computer. A diagram tab comes back after a restart. If its connection or schema is gone it offers &lt;code&gt;Close tab&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;export-diagram&quot;&gt;Export diagram&lt;a class=&quot;guide-anchor&quot; href=&quot;#export-diagram&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Format: PNG, SVG or &lt;code&gt;Mermaid&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A frame on the preview sets what the image shows: drag its handles, or Shift-drag a new one.&lt;/li&gt;
&lt;li&gt;Toolbar: &lt;code&gt;Fit frame&lt;/code&gt;, &lt;code&gt;Everything&lt;/code&gt;, &lt;code&gt;Canvas view&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Tables&lt;/code&gt;: &lt;code&gt;All tables&lt;/code&gt; or &lt;code&gt;Selection&lt;/code&gt;. A click on a table in the preview leaves it out.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Columns&lt;/code&gt;: &lt;code&gt;As on canvas&lt;/code&gt;, &lt;code&gt;Keys only&lt;/code&gt; or &lt;code&gt;All columns&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Theme&lt;/code&gt;, &lt;code&gt;Aspect&lt;/code&gt;, &lt;code&gt;Size&lt;/code&gt; (PNG), &lt;code&gt;Padding&lt;/code&gt;, and &lt;code&gt;Include&lt;/code&gt;: &lt;code&gt;Transparent&lt;/code&gt;, &lt;code&gt;Legend&lt;/code&gt;,
&lt;code&gt;Name &amp;amp; date&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Mermaid&lt;/code&gt; adds &lt;code&gt;Markdown fence&lt;/code&gt;, and from a design &lt;code&gt;Content&lt;/code&gt;: &lt;code&gt;Diagram&lt;/code&gt; or &lt;code&gt;PR summary&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;C&lt;/kbd&gt;&lt;/kbd&gt; copies an image of the canvas instead of saving one.&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/er-diagram-export.webp?v=3fd86a88a0&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/er-diagram-export-800.webp?v=7dd9d92bc9&quot; srcset=&quot;/guide/shots/er-diagram-export-800.webp?v=7dd9d92bc9 800w, /guide/shots/er-diagram-export.webp?v=3fd86a88a0 2000w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(1000px, 46rem)&quot; width=&quot;1000&quot; height=&quot;606&quot; alt=&quot;The Export diagram dialog: a frame around six tables on the preview, and format, tables, columns, theme, aspect, size and padding controls beside it.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;p&gt;Read: &lt;a href=&quot;/guide/a-schema-you-did-not-write/&quot;&gt;A schema you did not write&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Design workbench</title>
    <link href="https://seqora.dev/guide/design-workbench/" />
    <id>https://seqora.dev/guide/design-workbench/</id>
    <published>2026-11-13T00:00:00Z</published>
    <updated>2026-11-13T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>The schema design canvas: its toolbar and menus, column toggles, drawing links, the inspector, the SQL pane with risk tags, and saved designs.</summary>
    <content type="html">&lt;p&gt;The design workbench is the ER diagram made editable, and is Pro on every engine. Open it from &lt;code&gt;Design changes&lt;/code&gt; on a diagram, &lt;code&gt;New schema design&lt;/code&gt; or &lt;code&gt;Edit in schema design&lt;/code&gt; in the explorer, or &lt;code&gt;Design changes to &amp;lt;schema&amp;gt;&lt;/code&gt; in the palette.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/design-workbench.webp?v=6577dfa25f&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/design-workbench-800.webp?v=84537a66df&quot; srcset=&quot;/guide/shots/design-workbench-800.webp?v=84537a66df 800w, /guide/shots/design-workbench.webp?v=6577dfa25f 2000w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(1000px, 46rem)&quot; width=&quot;1000&quot; height=&quot;699&quot; alt=&quot;The design workbench: the canvas with a new reviews table marked new and orders marked changed, the inspector on reviews, and two statements in the SQL pane.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;A design with one new table and one new index. Nothing has run.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;toolbar&quot;&gt;Toolbar&lt;a class=&quot;guide-anchor&quot; href=&quot;#toolbar&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Table&lt;/code&gt; (&lt;code&gt;T&lt;/code&gt;), with &lt;code&gt;New table key&lt;/code&gt; beside it choosing the key a new table gets: &lt;code&gt;bigint identity key&lt;/code&gt; or &lt;code&gt;uuid key&lt;/code&gt; on PostgreSQL, &lt;code&gt;bigint auto-increment key&lt;/code&gt; or &lt;code&gt;char(36) uuid key&lt;/code&gt; on MySQL and MariaDB, &lt;code&gt;INTEGER rowid key&lt;/code&gt; or &lt;code&gt;TEXT uuid key&lt;/code&gt; on SQLite, &lt;code&gt;bigint IDENTITY key&lt;/code&gt; or &lt;code&gt;uniqueidentifier key&lt;/code&gt; on SQL Server.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Undo&lt;/code&gt; (&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;Z&lt;/kbd&gt;&lt;/kbd&gt;), &lt;code&gt;Redo&lt;/code&gt; (&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;Z&lt;/kbd&gt;&lt;/kbd&gt;), &lt;code&gt;Arrange&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Export&lt;/code&gt;: the diagram export, plus &lt;code&gt;Tables&lt;/code&gt; as &lt;code&gt;Changes&lt;/code&gt; and &lt;code&gt;Show&lt;/code&gt; as &lt;code&gt;Changes&lt;/code&gt;, &lt;code&gt;After&lt;/code&gt; or &lt;code&gt;Before&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Beside the name: &lt;code&gt;Saved&lt;/code&gt;, &lt;code&gt;Saving…&lt;/code&gt;, &lt;code&gt;Not saved&lt;/code&gt;, or &lt;code&gt;Read-only&lt;/code&gt; on Free.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;footer&quot;&gt;Footer&lt;a class=&quot;guide-anchor&quot; href=&quot;#footer&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The counts: statements, blockers, warnings.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Compare with a database…&lt;/code&gt;: opens &lt;a href=&quot;/guide/compare-two-schemas/&quot;&gt;schema compare&lt;/a&gt; with the design as one side.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Review and apply&lt;/code&gt;: opens the review under the eyebrow &lt;code&gt;Review changes&lt;/code&gt; (&lt;a href=&quot;/guide/review-dialogs/&quot;&gt;Review dialogs&lt;/a&gt;). Pro badge on Free.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;canvas-menus&quot;&gt;Canvas menus&lt;a class=&quot;guide-anchor&quot; href=&quot;#canvas-menus&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Empty canvas: &lt;code&gt;New table here&lt;/code&gt;, &lt;code&gt;Arrange automatically&lt;/code&gt;, &lt;code&gt;Fit view&lt;/code&gt;, and &lt;code&gt;Fit selection&lt;/code&gt; with a table selected.&lt;/li&gt;
&lt;li&gt;A table: &lt;code&gt;Add column&lt;/code&gt;, &lt;code&gt;Rename&lt;/code&gt;, &lt;code&gt;Open table data&lt;/code&gt;, and &lt;code&gt;Drop table&lt;/code&gt; for a live table or &lt;code&gt;Remove table&lt;/code&gt; for a new one. A dropped table offers &lt;code&gt;Keep table&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A column: the toggles &lt;code&gt;Primary key&lt;/code&gt;, &lt;code&gt;Unique&lt;/code&gt; and &lt;code&gt;Required&lt;/code&gt;, then &lt;code&gt;Add index&lt;/code&gt; and &lt;code&gt;Drop column&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;links&quot;&gt;Links&lt;a class=&quot;guide-anchor&quot; href=&quot;#links&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Drag a column&amp;#39;s dot onto another table. &lt;code&gt;New link&lt;/code&gt; asks for &lt;code&gt;Many-to-one&lt;/code&gt;, &lt;code&gt;One-to-one&lt;/code&gt; or &lt;code&gt;Many-to-many&lt;/code&gt;, &lt;code&gt;Required&lt;/code&gt;, and &lt;code&gt;On delete&lt;/code&gt;. &lt;code&gt;Undo link&lt;/code&gt; takes it back, &lt;code&gt;Done&lt;/code&gt; keeps it.&lt;/p&gt;
&lt;h2 id=&quot;inspector&quot;&gt;Inspector&lt;a class=&quot;guide-anchor&quot; href=&quot;#inspector&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Nothing selected: the design name, &lt;code&gt;Changes&lt;/code&gt;, &lt;code&gt;Blockers&lt;/code&gt; and &lt;code&gt;Warnings&lt;/code&gt; counts, &lt;code&gt;Issues&lt;/code&gt;, &lt;code&gt;Suggestions&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A table: name, columns with &lt;code&gt;Type&lt;/code&gt; and &lt;code&gt;Required&lt;/code&gt;, &lt;code&gt;Keys&lt;/code&gt;, &lt;code&gt;Indexes&lt;/code&gt;, &lt;code&gt;Links&lt;/code&gt;, &lt;code&gt;Comment&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A column: &lt;code&gt;Default&lt;/code&gt;, &lt;code&gt;Identity&lt;/code&gt;, &lt;code&gt;Required (NOT NULL)&lt;/code&gt;, &lt;code&gt;Unique&lt;/code&gt;, &lt;code&gt;Indexed&lt;/code&gt;. A &lt;code&gt;Default&lt;/code&gt; must be one expression; a comma or &lt;code&gt;NOT NULL&lt;/code&gt; outside brackets, an unclosed quote or unbalanced brackets is a blocker.&lt;/li&gt;
&lt;li&gt;A link: &lt;code&gt;Cardinality&lt;/code&gt;, &lt;code&gt;Deferrable&lt;/code&gt;, &lt;code&gt;On delete&lt;/code&gt; and &lt;code&gt;On update&lt;/code&gt; (&lt;code&gt;No action&lt;/code&gt;, &lt;code&gt;Restrict&lt;/code&gt;, &lt;code&gt;Cascade&lt;/code&gt;, &lt;code&gt;Set null&lt;/code&gt;, &lt;code&gt;Set default&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;sql&quot;&gt;SQL&lt;a class=&quot;guide-anchor&quot; href=&quot;#sql&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;SQL&lt;/code&gt; pane rewrites itself after every edit. Each statement carries risk tags, drawn as icons that name themselves on hover: &lt;code&gt;Deletes data&lt;/code&gt;, &lt;code&gt;Rewrites table&lt;/code&gt;, &lt;code&gt;Scans table&lt;/code&gt;, &lt;code&gt;Blocks reads and writes&lt;/code&gt;, &lt;code&gt;Blocks writes&lt;/code&gt;. &lt;code&gt;Selection only&lt;/code&gt; narrows it to the selected object. &lt;code&gt;Copy SQL&lt;/code&gt; copies it.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/design-sql-pane.webp?v=9775276466&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/design-sql-pane.webp?v=9775276466&quot; width=&quot;399&quot; height=&quot;243&quot; alt=&quot;The SQL pane with two statements, CREATE TABLE commerce.reviews and CREATE INDEX on orders, the second carrying two risk icons.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;The magnifier on the &lt;code&gt;CREATE INDEX&lt;/code&gt; is &lt;code&gt;Scans table&lt;/code&gt;, and the lock is &lt;code&gt;Blocks writes&lt;/code&gt;.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;saved-designs&quot;&gt;Saved designs&lt;a class=&quot;guide-anchor&quot; href=&quot;#saved-designs&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Designs are stored, as drafts or applied, in Seqora&amp;#39;s encrypted app database. &lt;code&gt;Design changes&lt;/code&gt; lists them under &lt;code&gt;Saved designs&lt;/code&gt;, each with &lt;code&gt;Delete design…&lt;/code&gt;, which asks &lt;code&gt;Delete design &amp;#39;&amp;lt;name&amp;gt;&amp;#39;?&lt;/code&gt; and changes nothing in the database. On Free they open read-only. A design tab comes back after a restart and keeps its undo history while you are on another tab. A deleted design&amp;#39;s tab offers &lt;code&gt;Close tab&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Read: &lt;a href=&quot;/guide/design-a-schema-change/&quot;&gt;Design a schema change&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Settings</title>
    <link href="https://seqora.dev/guide/settings/" />
    <id>https://seqora.dev/guide/settings/</id>
    <published>2026-11-13T00:00:00Z</published>
    <updated>2026-11-13T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Find any Seqora setting: the fourteen settings pages in three groups, and what each one holds.</summary>
    <content type="html">&lt;p&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;,&lt;/kbd&gt;&lt;/kbd&gt; opens Settings. &lt;code&gt;Search settings…&lt;/code&gt; finds any setting by name, and so does the command palette. A number beside a page counts the settings changed from their default there.&lt;/p&gt;
&lt;h2 id=&quot;personal&quot;&gt;Personal&lt;a class=&quot;guide-anchor&quot; href=&quot;#personal&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;General&lt;/code&gt;: &lt;code&gt;Startup&lt;/code&gt;, including &lt;code&gt;Open the brief of a new database&lt;/code&gt; and &lt;code&gt;Show the Welcome screen at launch&lt;/code&gt;, then &lt;code&gt;Tabs and windows&lt;/code&gt;, &lt;code&gt;Notifications&lt;/code&gt; for long runs, &lt;code&gt;Updates&lt;/code&gt;, and &lt;code&gt;Reset all settings&lt;/code&gt;, which asks first and leaves connections, files and workspaces alone.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Appearance&lt;/code&gt;: &lt;code&gt;Theme&lt;/code&gt;, &lt;code&gt;Accent color&lt;/code&gt;, &lt;code&gt;Colored environment indicators&lt;/code&gt;, &lt;code&gt;Interface zoom&lt;/code&gt;, &lt;code&gt;Text size&lt;/code&gt; and &lt;code&gt;Motion&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;workbench&quot;&gt;Workbench&lt;a class=&quot;guide-anchor&quot; href=&quot;#workbench&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;SQL editor&lt;/code&gt;: &lt;code&gt;Text&lt;/code&gt;, &lt;code&gt;Layout&lt;/code&gt;, &lt;code&gt;Assistance&lt;/code&gt;, &lt;code&gt;Running&lt;/code&gt;, &lt;code&gt;Formatting&lt;/code&gt;, &lt;code&gt;New tabs&lt;/code&gt; and &lt;code&gt;Closing tabs&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Data grid&lt;/code&gt;: &lt;code&gt;Layout&lt;/code&gt;, &lt;code&gt;Values&lt;/code&gt;, &lt;code&gt;Loading&lt;/code&gt;, &lt;code&gt;Query plans&lt;/code&gt; (&lt;code&gt;Plan band width&lt;/code&gt;), &lt;code&gt;Copying&lt;/code&gt; and &lt;code&gt;Exporting&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Explorer&lt;/code&gt;: &lt;code&gt;Show system objects&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Terminal&lt;/code&gt;: &lt;code&gt;Shell&lt;/code&gt; with &lt;code&gt;Start directory&lt;/code&gt; and &lt;code&gt;Shell arguments&lt;/code&gt;, &lt;code&gt;Text&lt;/code&gt;, &lt;code&gt;Cursor&lt;/code&gt;, &lt;code&gt;History&lt;/code&gt; and &lt;code&gt;Copy on select&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;system&quot;&gt;System&lt;a class=&quot;guide-anchor&quot; href=&quot;#system&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Connections and safety&lt;/code&gt;: &lt;code&gt;New connections&lt;/code&gt; (timeout, &lt;code&gt;Lock writes by default&lt;/code&gt;, &lt;code&gt;Default SSL mode&lt;/code&gt;, &lt;code&gt;Application name&lt;/code&gt;), &lt;code&gt;Running queries&lt;/code&gt;, &lt;code&gt;Write lock&lt;/code&gt; (&lt;code&gt;Re-lock after unlocking&lt;/code&gt;), &lt;code&gt;Staying connected&lt;/code&gt; and &lt;code&gt;Slow servers&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Keyboard&lt;/code&gt;: every remappable shortcut, and &lt;code&gt;Reset all shortcuts&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Privacy&lt;/code&gt;: &lt;code&gt;Send crash reports&lt;/code&gt;, &lt;code&gt;Count feature use&lt;/code&gt; with &lt;code&gt;Show report&lt;/code&gt;, &lt;code&gt;License checks&lt;/code&gt;, &lt;code&gt;Query history&lt;/code&gt; and &lt;code&gt;Questions about your data&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Schema history&lt;/code&gt;: &lt;code&gt;Record schema history&lt;/code&gt;, &lt;code&gt;Keep check-ins&lt;/code&gt;, and what each connection has stored.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Agents&lt;/code&gt;: the MCP &lt;code&gt;Clients&lt;/code&gt; with &lt;code&gt;Install&lt;/code&gt; and &lt;code&gt;Copy config&lt;/code&gt;, each connection&amp;#39;s agent access (&lt;code&gt;Off&lt;/code&gt;, &lt;code&gt;Read&lt;/code&gt;, &lt;code&gt;Propose&lt;/code&gt;), and &lt;code&gt;Activity&lt;/code&gt;. &lt;a href=&quot;/guide/connect-an-agent/&quot;&gt;Connect an AI agent&lt;/a&gt; walks through it.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Upgrade to Pro&lt;/code&gt;, &lt;code&gt;License&lt;/code&gt; once a key is stored: the trial, the key, the subscription and &lt;code&gt;Deactivate this computer&lt;/code&gt;. Prices are before tax.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Advanced&lt;/code&gt;: open the data and logs folders, copy the settings file path, &lt;code&gt;Clear the catalog cache&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;About&lt;/code&gt;: the version with &lt;code&gt;Check for updates&lt;/code&gt;, the plan, &lt;code&gt;What’s new&lt;/code&gt; with the installed release marked, &lt;code&gt;Help&lt;/code&gt; and &lt;code&gt;Third-party notices&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/settings-safety.webp?v=3a3a9bba6c&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/settings-safety-800.webp?v=a7fdf6ec8a&quot; srcset=&quot;/guide/shots/settings-safety-800.webp?v=a7fdf6ec8a 800w, /guide/shots/settings-safety.webp?v=3a3a9bba6c 2000w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(1000px, 46rem)&quot; width=&quot;1000&quot; height=&quot;621&quot; alt=&quot;Settings open on Connections and safety: New connections, Running queries, Write lock, Staying connected and Slow servers.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;p&gt;Read: &lt;a href=&quot;/guide/keyboard-and-the-command-palette/&quot;&gt;Keyboard and the command palette&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>MySQL, MariaDB, SQLite and SQL Server</title>
    <link href="https://seqora.dev/guide/other-engines/" />
    <id>https://seqora.dev/guide/other-engines/</id>
    <published>2026-11-13T00:00:00Z</published>
    <updated>2026-11-13T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Know what works the same on every engine, what differs on MySQL, MariaDB, SQLite and SQL Server, and the quirks of each.</summary>
    <content type="html">&lt;p&gt;Seqora connects to PostgreSQL, MySQL, MariaDB, SQLite and SQL Server. Most of the app does not care which. This page is about the parts that do. Each engine also has a page of its own, on connecting to it and what it makes hard: &lt;a href=&quot;/guide/postgresql-gui-client/&quot;&gt;PostgreSQL&lt;/a&gt;, &lt;a href=&quot;/guide/mysql-gui-client/&quot;&gt;MySQL&lt;/a&gt;, &lt;a href=&quot;/guide/mariadb-gui-client/&quot;&gt;MariaDB&lt;/a&gt;, &lt;a href=&quot;/guide/sqlite-browser/&quot;&gt;SQLite&lt;/a&gt; and &lt;a href=&quot;/guide/sql-server-client/&quot;&gt;SQL Server&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;the-same-on-every-engine&quot;&gt;The same on every engine&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-same-on-every-engine&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You connect from the same dialog, browse the same explorer, and filter, sort and page the same grid. Cell edits, new rows and deletes are staged and reviewed the same way, and applied in one transaction. The SQL editor runs, cancels and formats on every engine, completes table and column names from the catalog, and has &lt;code&gt;Begin&lt;/code&gt;, &lt;code&gt;Commit&lt;/code&gt; and &lt;code&gt;Rollback&lt;/code&gt;. History, saved queries, exports and &lt;code&gt;Copy as…&lt;/code&gt; work everywhere. So do the ER diagram and its export, the &lt;a href=&quot;/guide/what-is-in-this-database/&quot;&gt;database brief&lt;/a&gt; and &lt;a href=&quot;/guide/watch-a-table/&quot;&gt;watching a table&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The Pro tools are on all five too: schema design, compare, history and drift, import and full export, the brief&amp;#39;s fixes and pinned watches.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/other-engines-picker.webp?v=b59bdfd867&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/other-engines-picker-800.webp?v=d85c9ee744&quot; srcset=&quot;/guide/shots/other-engines-picker-800.webp?v=d85c9ee744 800w, /guide/shots/other-engines-picker.webp?v=b59bdfd867 1132w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(566px, 46rem)&quot; width=&quot;566&quot; height=&quot;59&quot; alt=&quot;The engine picker in the Connect a database dialog: PostgreSQL, MySQL, MariaDB, SQLite and SQL Server.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;p&gt;Every engine opens the same object pages, filled from its own catalog.&lt;/p&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;I built the object pages for PostgreSQL first. The first MySQL and SQLite pages beside them were a flat list of indexes, constraints and triggers, so I replaced them by having each engine&amp;#39;s catalog fill the PostgreSQL pages, and an index page on SQLite now reads like one on PostgreSQL, section for section. Where an engine doesn&amp;#39;t keep a fact, the page leaves it out or says it is unavailable.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
&lt;h2 id=&quot;where-they-differ&quot;&gt;Where they differ&lt;a class=&quot;guide-anchor&quot; href=&quot;#where-they-differ&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;PostgreSQL&lt;/th&gt;
&lt;th&gt;MySQL and MariaDB&lt;/th&gt;
&lt;th&gt;SQLite&lt;/th&gt;
&lt;th&gt;SQL Server&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;Plan tab&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes, MySQL 8.0.18 or later&lt;/td&gt;
&lt;td&gt;&lt;code&gt;EXPLAIN QUERY PLAN&lt;/code&gt;, estimates only&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Analyze, with timings&lt;/td&gt;
&lt;td&gt;Reads automatically, writes by &lt;code&gt;Analyze in rollback&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Reads only&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Reads only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Test index&lt;/code&gt; and the &lt;code&gt;work_mem&lt;/code&gt; retry&lt;/td&gt;
&lt;td&gt;Yes, &lt;code&gt;Test index&lt;/code&gt; uses &lt;code&gt;hypopg&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Index advisor&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Drops, no adds&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Drops, untested adds&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;With and without this index&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Yes, with &lt;code&gt;hypopg&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Partial&lt;/td&gt;
&lt;td&gt;Partial&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Column statistics in the inspector&lt;/td&gt;
&lt;td&gt;&lt;code&gt;pg_stats&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;MySQL 8 histograms, none on MariaDB&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;JSON-path filters in the grid&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;A read that calls a function that may change data is never analyzed on its own, on any engine. The tab stops at the estimate, and &lt;code&gt;Analyze&lt;/code&gt; asks first: &lt;code&gt;Run this statement to analyze it?&lt;/code&gt; On PostgreSQL the run is rolled back, and the dialog lists what a rollback doesn&amp;#39;t undo: &lt;code&gt;Sequence values, trigger and function side effects&lt;/code&gt;. The other engines can&amp;#39;t roll it back, so everything the statement changes stays.&lt;/p&gt;
&lt;p&gt;Plans from MySQL, MariaDB and SQLite are translated into PostgreSQL&amp;#39;s node names, so a full scan reads &lt;a class=&quot;guide-term&quot; href=&quot;/guide/seq-scan/&quot; data-term-icon=&quot;list-dashes&quot; data-term-description=&quot;What a Seq Scan reads, the kept-to-read ratio that tells you it is the problem, and the index that replaces it.&quot;&gt;&lt;code&gt;Seq Scan&lt;/code&gt;&lt;/a&gt; on all four. SQL Server&amp;#39;s operators keep the names SQL Server gives them. &lt;code&gt;Raw plan JSON&lt;/code&gt; keeps each engine&amp;#39;s own output, labelled with what produced it, such as &lt;code&gt;EXPLAIN ANALYZE tree&lt;/code&gt; on MySQL, &lt;code&gt;ANALYZE FORMAT=JSON&lt;/code&gt; on MariaDB or &lt;code&gt;STATISTICS XML&lt;/code&gt; on SQL Server.&lt;/p&gt;
&lt;p&gt;The &lt;a href=&quot;/guide/which-indexes-are-missing/&quot;&gt;index advisor&lt;/a&gt; can rehearse a new index only through &lt;code&gt;hypopg&lt;/code&gt;, so off PostgreSQL it ranks the indexes to drop. On SQL Server it also lists SQL Server&amp;#39;s own missing-index suggestions, marked untested, because SQL Server cannot cost an index without building it. SQLite counts no index usage, so it has no advisor.&lt;/p&gt;
&lt;h2 id=&quot;object-pages-by-engine&quot;&gt;Object pages by engine&lt;a class=&quot;guide-anchor&quot; href=&quot;#object-pages-by-engine&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Page&lt;/th&gt;
&lt;th&gt;PostgreSQL&lt;/th&gt;
&lt;th&gt;MySQL and MariaDB&lt;/th&gt;
&lt;th&gt;SQLite&lt;/th&gt;
&lt;th&gt;SQL Server&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;Indexes, constraints, triggers, schema columns&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Views&lt;/td&gt;
&lt;td&gt;Yes, and materialized&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes, and indexed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sequences&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;&lt;code&gt;AUTO_INCREMENT&lt;/code&gt;, and sequences on MariaDB&lt;/td&gt;
&lt;td&gt;&lt;code&gt;AUTOINCREMENT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Yes, and &lt;code&gt;IDENTITY&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Functions and procedures, partitions, &lt;code&gt;Access&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Types&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Alias and table types&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Extensions&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;Access&lt;/code&gt; on PostgreSQL includes row-level security. &lt;a href=&quot;/guide/object-pages/&quot;&gt;Object pages&lt;/a&gt; has what each page holds.&lt;/p&gt;
&lt;h2 id=&quot;mysql-and-mariadb&quot;&gt;MySQL and MariaDB&lt;a class=&quot;guide-anchor&quot; href=&quot;#mysql-and-mariadb&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The editor refuses &lt;code&gt;SET NAMES&lt;/code&gt;, other character set changes and &lt;code&gt;RESET&lt;/code&gt;, because they would change how Seqora reads the connection: &amp;quot;Reconnect to start a fresh session.&amp;quot; It also refuses executable comments such as &lt;code&gt;/*! … */&lt;/code&gt;, a bare &lt;code&gt;DELIMITER&lt;/code&gt;, and a stored program with a &lt;code&gt;BEGIN … END&lt;/code&gt; body that isn&amp;#39;t wrapped in &lt;code&gt;DELIMITER $$ … $$&lt;/code&gt;. A &lt;code&gt;SET sql_mode&lt;/code&gt; has to be the last statement of its script, because the statements after it would be read with the new mode. &lt;code&gt;SET SESSION&lt;/code&gt;, &lt;code&gt;SET @var&lt;/code&gt;, &lt;code&gt;PREPARE&lt;/code&gt; and &lt;code&gt;EXECUTE&lt;/code&gt; run, after the high-risk review.&lt;/p&gt;
&lt;p&gt;After an error inside a transaction, the badge reads &lt;code&gt;State unknown&lt;/code&gt; and &lt;code&gt;Run&lt;/code&gt;, &lt;code&gt;Begin&lt;/code&gt; and &lt;code&gt;Commit&lt;/code&gt; stay disabled until &lt;code&gt;Rollback&lt;/code&gt; or &lt;code&gt;Refresh transaction&lt;/code&gt; settles it. MySQL&amp;#39;s errors do not report the state of the transaction, and Seqora does not guess. A plain statement that fails in autocommit leaves the editor at &lt;code&gt;Autocommit&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Statement timeout&lt;/code&gt; in Settings stops a statement at the deadline the way &lt;code&gt;Cancel run&lt;/code&gt; does, with &lt;code&gt;KILL QUERY&lt;/code&gt;, rather than through a session variable.&lt;/p&gt;
&lt;p&gt;The Plan tab on MySQL needs 8.0.18 or later, the release that added &lt;code&gt;EXPLAIN FORMAT=TREE&lt;/code&gt; and &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt;. Writes are never analyzed on MySQL or MariaDB.&lt;/p&gt;
&lt;p&gt;Design mode works, but MySQL commits every DDL statement on its own, and the review says so: &amp;quot;MySQL commits each schema statement on its own. If one fails while applying, the statements before it stay applied.&amp;quot; The dry run cannot use a transaction either. It replays every statement on empty copies of the tables in a scratch database, then drops it. If the user cannot create that database, the review falls back to &lt;code&gt;Only the syntax was checked&lt;/code&gt; and suggests granting &lt;code&gt;CREATE&lt;/code&gt; on &lt;code&gt;seqora_scratch_%&lt;/code&gt; databases.&lt;/p&gt;
&lt;p&gt;Column facts on MySQL come from histograms, and a column without one says so, with the &lt;code&gt;ANALYZE TABLE … UPDATE HISTOGRAM&lt;/code&gt; that builds it. MariaDB shows no column statistics. &lt;code&gt;Run exact&lt;/code&gt; counts the column instead.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;AUTO_INCREMENT&lt;/code&gt; counters appear in the explorer under &lt;code&gt;Auto-increment&lt;/code&gt;. MariaDB&amp;#39;s real sequences keep the &lt;code&gt;Sequences&lt;/code&gt; folder.&lt;/p&gt;
&lt;h2 id=&quot;sql-server&quot;&gt;SQL Server&lt;a class=&quot;guide-anchor&quot; href=&quot;#sql-server&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Seqora connects to SQL Server 2016 or later and to Azure SQL Database. &lt;a href=&quot;/guide/connect/&quot;&gt;Connect&lt;/a&gt; walks the dialog. It signs in with a &lt;code&gt;SQL login&lt;/code&gt; and password, or with an &lt;code&gt;Entra token&lt;/code&gt;, a Microsoft Entra access token that is stored encrypted like a password and sent only over &lt;code&gt;Verify&lt;/code&gt; or &lt;code&gt;Strict&lt;/code&gt; TLS.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Windows&lt;/code&gt; signs in as the Windows account you&amp;#39;re logged in with and saves no password. It works only in Seqora on Windows, and it goes through NTLM, so a server or network that allows only Kerberos refuses it, and Azure SQL doesn&amp;#39;t accept it.&lt;/p&gt;
&lt;p&gt;For a named instance, type it in &lt;code&gt;Instance&lt;/code&gt; or as &lt;code&gt;host\SQLEXPRESS&lt;/code&gt;. Seqora asks the SQL Server Browser on UDP port 1434 for its port. Through an SSH tunnel the Browser cannot be reached, so give the instance&amp;#39;s TCP port instead. The four TLS modes and SSH tunnels work as on the other engines, and &lt;code&gt;Strict&lt;/code&gt; adds TDS 8.0 strict encryption for SQL Server 2022 and Azure SQL.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Connection URL&lt;/code&gt; takes &lt;code&gt;sqlserver://&lt;/code&gt; and &lt;code&gt;mssql://&lt;/code&gt; URLs, ADO.NET connection strings and JDBC URLs. The same ones are offered from the clipboard and accepted in &lt;code&gt;seqora://connect&lt;/code&gt; links, and &lt;code&gt;Import connections…&lt;/code&gt; reads SQL Server connections saved in Azure Data Studio, SQL Server Management Studio&amp;#39;s registered servers on Windows, TablePlus, DBeaver, DataGrip and &lt;code&gt;.env&lt;/code&gt; files. Passwords saved in Azure Data Studio and SSMS stay behind, so each connection asks for its password once. &lt;a href=&quot;/guide/coming-from-azure-data-studio/&quot;&gt;Coming from Azure Data Studio&lt;/a&gt; walks the move field by field.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The explorer lists each schema&amp;#39;s tables, views, routines, sequences, synonyms and types.&lt;/li&gt;
&lt;li&gt;The grid&amp;#39;s edits are reviewed as T-SQL, and the apply stops if a row changed since it loaded. Identity, computed, &lt;code&gt;rowversion&lt;/code&gt;, period and graph id columns are read-only, and the grid says why when you try one.&lt;/li&gt;
&lt;li&gt;The SQL editor splits a script into batches at &lt;code&gt;GO&lt;/code&gt;, shows &lt;code&gt;PRINT&lt;/code&gt; output and returns every result set. It asks before high-risk statements such as &lt;code&gt;EXEC&lt;/code&gt;, and runs only reads on a locked connection. Each editor tab has a database of its own: pick it in the tab or run &lt;code&gt;USE&lt;/code&gt;, and the tab follows.&lt;/li&gt;
&lt;li&gt;The value inspector draws &lt;code&gt;geometry&lt;/code&gt; and &lt;code&gt;geography&lt;/code&gt; values as shapes, with a polygon&amp;#39;s area and perimeter, and copies them as WKT or GeoJSON.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Not on SQL Server yet: Microsoft Entra sign-in without a pasted access token.&lt;/p&gt;
&lt;h2 id=&quot;sqlite&quot;&gt;SQLite&lt;a class=&quot;guide-anchor&quot; href=&quot;#sqlite&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The connection is a &lt;code&gt;Database file&lt;/code&gt;, not a host. Seqora stores only its path. There is no TLS and no SSH, because there is no server.&lt;/p&gt;
&lt;p&gt;The editor runs against the &lt;code&gt;main&lt;/code&gt; schema of that file. &lt;code&gt;ATTACH&lt;/code&gt; and &lt;code&gt;DETACH&lt;/code&gt; are refused, so one connection is one file. Parameters must be bound: &lt;code&gt;Unbound SQL parameters are not supported. Supply explicit values.&lt;/code&gt; &lt;code&gt;PRAGMA&lt;/code&gt; runs from an allow-list. The schema-reading ones such as &lt;code&gt;table_info&lt;/code&gt;, &lt;code&gt;index_list&lt;/code&gt; and &lt;code&gt;foreign_key_check&lt;/code&gt; are allowed, settings that change the file are not, and &lt;code&gt;foreign_keys&lt;/code&gt; can be set only while the connection is unlocked.&lt;/p&gt;
&lt;p&gt;The Plan tab shows &lt;code&gt;EXPLAIN QUERY PLAN&lt;/code&gt;, which has no row counts or timings.&lt;/p&gt;
&lt;p&gt;Design mode on SQLite is a rebuild. Most &lt;code&gt;ALTER TABLE&lt;/code&gt; changes in SQLite mean creating a new table, copying the rows and swapping the names. Seqora does that inside one transaction, with foreign key enforcement off during the copy and checked before the commit. The dry run runs the same transaction and rolls it back. The new table is written from the old one&amp;#39;s &lt;code&gt;CREATE&lt;/code&gt; text, so what the design doesn&amp;#39;t change comes across as it was: &lt;code&gt;CHECK&lt;/code&gt; constraints, collations, &lt;code&gt;AUTOINCREMENT&lt;/code&gt; and its counter, generated columns, &lt;code&gt;ON CONFLICT&lt;/code&gt; clauses, table options, triggers, and partial or expression indexes. The review says what the rebuild keeps, and blocks a change it can&amp;#39;t make safely, such as one to a table whose &lt;code&gt;CREATE&lt;/code&gt; text it can&amp;#39;t read.&lt;/p&gt;
&lt;p&gt;SQLite has no users, routines or partitions, so it has no &lt;code&gt;Access&lt;/code&gt;, routine or partition pages, and no type or extension pages. Every install includes one SQLite database to try things on, &lt;code&gt;Sample coffee shop&lt;/code&gt;.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;With and without this index&lt;/code&gt; is partial on MySQL, MariaDB and SQLite because it compares estimates, not runs. MySQL and MariaDB plan the query again with &lt;code&gt;IGNORE INDEX&lt;/code&gt; on every reference to the table and show &lt;code&gt;The statement planned without it&lt;/code&gt;. SQLite plans on an in-memory copy of the schema and statistics with the index dropped, and the headline counts rows visited from &lt;code&gt;sqlite_stat1&lt;/code&gt;: &lt;code&gt;About N× fewer rows visited with it&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Hiding an existing index on PostgreSQL needs &lt;code&gt;hypopg&lt;/code&gt; 1.4 or later. An older install gets &lt;code&gt;Open ALTER EXTENSION in a SQL editor&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;No database version is certified yet. The targets are PostgreSQL 16, MySQL 8.4, MariaDB 11.4, SQLite 3.51.3 and SQL Server 2022.&lt;/li&gt;
&lt;li&gt;On SQL Server a script stops at its first error, even where SQL Server would carry on with the rest of the batch. With &lt;code&gt;SET XACT_ABORT ON&lt;/code&gt;, an error also rolls back the open transaction, and the badge goes back to &lt;code&gt;Autocommit&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry>
    <title>Export</title>
    <link href="https://seqora.dev/guide/export/" />
    <id>https://seqora.dev/guide/export/</id>
    <published>2026-10-28T00:00:00Z</published>
    <updated>2026-10-28T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Export rows as CSV, JSON, SQL, XLSX, Parquet and more, stream a full query result to a file, copy rows, and export the ER diagram.</summary>
    <content type="html">&lt;p&gt;Read this when rows need to leave Seqora: for a spreadsheet, a data pipeline, a fixture file, a
pull request or a message to a colleague. It lists what exists, and near the end what doesn&amp;#39;t,
so you don&amp;#39;t go looking for it.&lt;/p&gt;
&lt;h2 id=&quot;the-export-sheet&quot;&gt;The Export sheet&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-export-sheet&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;Export&lt;/code&gt; sits in the toolbar of every result and table tab. &lt;code&gt;Export rows…&lt;/code&gt; in the more menu,
the command palette and &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;X&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;X&lt;/kbd&gt;&lt;/kbd&gt; open the same sheet. It has four parts.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Two cards for the rows. &lt;code&gt;Loaded&lt;/code&gt; is what the grid holds, with its count. A table tab&amp;#39;s second
card is &lt;code&gt;All rows&lt;/code&gt;, a query result&amp;#39;s is &lt;code&gt;Full result&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The formats: &lt;code&gt;CSV&lt;/code&gt;, &lt;code&gt;TSV&lt;/code&gt;, &lt;code&gt;JSON&lt;/code&gt;, &lt;code&gt;JSONL&lt;/code&gt;, &lt;code&gt;SQL&lt;/code&gt;, &lt;code&gt;XLSX&lt;/code&gt;, &lt;code&gt;Parquet&lt;/code&gt; and &lt;code&gt;Markdown&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The chosen format&amp;#39;s options. CSV has &lt;code&gt;Header row&lt;/code&gt;, &lt;code&gt;Delimiter&lt;/code&gt;, &lt;code&gt;Quote&lt;/code&gt;, &lt;code&gt;NULL&lt;/code&gt;,
&lt;code&gt;Line ending&lt;/code&gt;, &lt;code&gt;Encoding&lt;/code&gt; and &lt;code&gt;BOM for Excel&lt;/code&gt;. JSON has &lt;code&gt;Objects&lt;/code&gt; and &lt;code&gt;Indented&lt;/code&gt;. SQL has the
&lt;code&gt;Table&lt;/code&gt; its &lt;code&gt;INSERT&lt;/code&gt;s name.&lt;/li&gt;
&lt;li&gt;The file. Seqora proposes one in Downloads, named after the tab and the date, such as
&lt;code&gt;orders-by-region-2026-10-28.xlsx&lt;/code&gt;. &lt;code&gt;Change&lt;/code&gt; opens the save dialog.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;Export&lt;/code&gt; starts the job and closes the sheet. &lt;code&gt;Copy&lt;/code&gt; puts the loaded rows on the clipboard in
the chosen text format instead. XLSX and Parquet are files only.&lt;/p&gt;
&lt;p&gt;The file always holds the visible columns, in grid order. Hide a column and it stays out, and
the card says so, as in &lt;code&gt;in grid · 1 hidden column left out&lt;/code&gt;.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/export-sheet.webp?v=b6e3fe36e1&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/export-sheet.webp?v=b6e3fe36e1&quot; width=&quot;440&quot; height=&quot;526&quot; alt=&quot;The Export sheet on a filtered table: the Loaded and All rows cards, the eight formats, the CSV options, the file name in Downloads, and Copy and Export all rows.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;A table tab with a filter, so &lt;code&gt;All rows&lt;/code&gt; reads &lt;code&gt;paged · filtered&lt;/code&gt;.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;from-a-query-result&quot;&gt;From a query result&lt;a class=&quot;guide-anchor&quot; href=&quot;#from-a-query-result&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Run the query. With several result sets, pick one in the &lt;code&gt;Result set&lt;/code&gt; group.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Export&lt;/code&gt;. The &lt;code&gt;Loaded&lt;/code&gt; card shows &lt;code&gt;10,000&lt;/code&gt;, &lt;code&gt;in grid&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Pick a format and click &lt;code&gt;Export 10,000 rows&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;code&gt;Loaded&lt;/code&gt; writes the rows Seqora holds, at most &lt;code&gt;Rows kept per result&lt;/code&gt;. Nothing is re-run.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Full result&lt;/code&gt; is Pro. It runs the statement again on a read-only connection of its own and
streams every row into the file, past the row cap, with flat memory. Your editor&amp;#39;s connection
and transaction are not touched. On PostgreSQL it runs in the schema the editor ran it in, so
&lt;code&gt;select * from orders&lt;/code&gt; exports the same &lt;code&gt;orders&lt;/code&gt; the grid showed. On PostgreSQL the card shows the planner&amp;#39;s estimate, such as
&lt;code&gt;≈ 2.41M&lt;/code&gt;. On the other engines it shows &lt;code&gt;&amp;gt; 10,000&lt;/code&gt; when the grid hit the cap. The sheet marks
the run &lt;code&gt;read only&lt;/code&gt; and &lt;code&gt;own connection&lt;/code&gt;, and &lt;code&gt;▲ PROD&lt;/code&gt; on a production connection. A full export
runs exactly one read-only statement, so a script or an &lt;code&gt;UPDATE ... RETURNING&lt;/code&gt; is refused before
a row is written. On PostgreSQL the card marks that with a warning sign as the sheet opens.&lt;/p&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;The complaint about database clients I found most often is that their export writes only the
page the grid loaded. So the sheet opens on two cards that say which rows you are about to
write, with their count: &lt;code&gt;Loaded&lt;/code&gt; for what the grid holds, &lt;code&gt;Full result&lt;/code&gt; for what the query
returns. A full export runs on a read-only connection of its own and streams straight to the
file, so your editor&amp;#39;s transaction is never part of it.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
&lt;h2 id=&quot;from-a-table-tab&quot;&gt;From a table tab&lt;a class=&quot;guide-anchor&quot; href=&quot;#from-a-table-tab&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Open &lt;code&gt;commerce.orders&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Type a filter into &lt;code&gt;Filter rows&lt;/code&gt;, for example &lt;code&gt;total_cents &amp;gt;= 100000&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Export&lt;/code&gt;. &lt;code&gt;All rows&lt;/code&gt; is picked, with the planner&amp;#39;s estimate and &lt;code&gt;paged · filtered&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Pick a format and click &lt;code&gt;Export all rows&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;code&gt;All rows&lt;/code&gt; reads the whole table page by page, with your filter and sort applied. It is Free.
&lt;code&gt;SQL&lt;/code&gt; writes &lt;code&gt;INSERT INTO commerce.orders ...&lt;/code&gt;, one per row.&lt;/p&gt;
&lt;h2 id=&quot;activity&quot;&gt;Activity&lt;a class=&quot;guide-anchor&quot; href=&quot;#activity&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A running export shows in the status bar as a chip with its percent, or a spinner and the row
count when there is no estimate. Click it for &lt;code&gt;Activity&lt;/code&gt;: each job with its rows, size, rows per
second and time left, and &lt;code&gt;Cancel&lt;/code&gt;. A finished job has &lt;code&gt;Reveal&lt;/code&gt;, which shows the file in Finder
or Explorer, and a full export has &lt;code&gt;Run again&lt;/code&gt;. A failed job shows the database&amp;#39;s or the disk&amp;#39;s
message, and its partial file is removed. When an export finishes while Seqora is in the
background, it sends the long-run notification, if that is on in Settings › General.&lt;/p&gt;
&lt;p&gt;Seqora writes every export to a hidden file beside the destination and renames it when the
last row is written. A cancelled or failed export leaves the destination as it was.&lt;/p&gt;
&lt;h2 id=&quot;what-each-format-writes&quot;&gt;What each format writes&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-each-format-writes&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;CSV&lt;/code&gt; and &lt;code&gt;TSV&lt;/code&gt; write &lt;code&gt;NULL&lt;/code&gt; as the &lt;code&gt;NULL&lt;/code&gt; option says (&lt;code&gt;NULL&lt;/code&gt; by default) and quote text that
reads like it. &lt;code&gt;BOM for Excel&lt;/code&gt; adds the UTF-8 byte order mark Excel needs to read accents.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;JSON&lt;/code&gt; keeps numbers exactly as the server sent them, so a &lt;code&gt;numeric&lt;/code&gt; or &lt;code&gt;bigint&lt;/code&gt; doesn&amp;#39;t lose
digits. Duplicate column names get numbered suffixes. &lt;code&gt;JSONL&lt;/code&gt; is one object per line.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;XLSX&lt;/code&gt; writes numbers, booleans, dates and timestamps as typed cells, and a &lt;code&gt;NULL&lt;/code&gt; as an empty
cell. An integer past 2⁵³ stays text, because a spreadsheet number would change its last
digits. A timestamp with a time zone is written in UTC. Past 1,048,576 rows the workbook starts
another sheet, with the header again.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Parquet&lt;/code&gt; is compressed with zstd. Integers, floats, booleans, dates and timestamps keep their
types, &lt;code&gt;NULL&lt;/code&gt; stays null, and &lt;code&gt;numeric(12,2)&lt;/code&gt; becomes &lt;code&gt;decimal(38,2)&lt;/code&gt;. A &lt;code&gt;numeric&lt;/code&gt; without a
declared scale, &lt;code&gt;jsonb&lt;/code&gt; and arrays are strings.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;to-the-clipboard&quot;&gt;To the clipboard&lt;a class=&quot;guide-anchor&quot; href=&quot;#to-the-clipboard&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Select the rows or cells.&lt;/li&gt;
&lt;li&gt;Open &lt;code&gt;Copy as…&lt;/code&gt; from the grid&amp;#39;s more menu or the row&amp;#39;s right-click menu.&lt;/li&gt;
&lt;li&gt;Pick &lt;code&gt;TSV&lt;/code&gt;, &lt;code&gt;CSV&lt;/code&gt;, &lt;code&gt;JSON&lt;/code&gt;, &lt;code&gt;Markdown&lt;/code&gt;, &lt;code&gt;SQL values&lt;/code&gt; or &lt;code&gt;INSERT statements&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;code&gt;Headers&lt;/code&gt; adds the column names. &lt;code&gt;NULL&lt;/code&gt; chooses whether a null is copied as &lt;code&gt;NULL&lt;/code&gt; or &lt;code&gt;Empty&lt;/code&gt;.
Plain &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;C&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;C&lt;/kbd&gt;&lt;/kbd&gt; copies in the format set in Settings › Data grid › &lt;code&gt;Copy rows as&lt;/code&gt;, with
&lt;code&gt;Include column headers&lt;/code&gt; and &lt;code&gt;Copy NULL as&lt;/code&gt; beside it. A single cell is copied as it is. In
&lt;code&gt;Tab-separated&lt;/code&gt;, a value holding a tab or a line break is quoted, so it lands in one spreadsheet
cell. &lt;code&gt;Markdown&lt;/code&gt; is the one to paste into a pull request.&lt;/p&gt;
&lt;h2 id=&quot;the-er-diagram&quot;&gt;The ER diagram&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-er-diagram&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Open the diagram with &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;E&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;E&lt;/kbd&gt;&lt;/kbd&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Export&lt;/code&gt; in its toolbar. &lt;code&gt;Export diagram&lt;/code&gt; opens on what the canvas showed, with a
frame around it.&lt;/li&gt;
&lt;li&gt;Choose a &lt;code&gt;Format&lt;/code&gt;: &lt;code&gt;PNG&lt;/code&gt;, &lt;code&gt;SVG&lt;/code&gt; or &lt;code&gt;Mermaid&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Drag the frame&amp;#39;s handles until it holds the tables you want. Its tab shows the image size.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Save…&lt;/code&gt;, or &lt;code&gt;Copy&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/er-diagram-export.webp?v=3fd86a88a0&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/er-diagram-export-800.webp?v=7dd9d92bc9&quot; srcset=&quot;/guide/shots/er-diagram-export-800.webp?v=7dd9d92bc9 800w, /guide/shots/er-diagram-export.webp?v=3fd86a88a0 2000w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(1000px, 46rem)&quot; width=&quot;1000&quot; height=&quot;606&quot; alt=&quot;The Export diagram dialog with a frame around six tables, and format, tables, columns, theme, aspect, size and padding controls beside the preview.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;p&gt;The preview pans and zooms like the canvas. Zooming it doesn&amp;#39;t change the image. Drag the
frame&amp;#39;s tab to move it, or Shift-drag anywhere to draw a new one. &lt;code&gt;Fit frame&lt;/code&gt;, &lt;code&gt;Everything&lt;/code&gt;
and &lt;code&gt;Canvas view&lt;/code&gt; in the toolbar under the preview reset the view or the frame. A table that
only partly fits is cut at the frame&amp;#39;s edge, and its lines run to the edge.&lt;/p&gt;
&lt;p&gt;Click a table in the preview to leave it out of the image. &lt;code&gt;Show all&lt;/code&gt; brings them back.
&lt;code&gt;Tables&lt;/code&gt; narrows the export to &lt;code&gt;Selection&lt;/code&gt;, the selected table and the tables it links to.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Columns&lt;/code&gt; is &lt;code&gt;As on canvas&lt;/code&gt; by default: the image has the same columns and positions as the
canvas, moved tables included. &lt;code&gt;Keys only&lt;/code&gt; and &lt;code&gt;All columns&lt;/code&gt; lay the tables out afresh. For PNG
and SVG you also get &lt;code&gt;Theme&lt;/code&gt;, &lt;code&gt;Aspect&lt;/code&gt; from &lt;code&gt;Free&lt;/code&gt; to &lt;code&gt;A4 portrait&lt;/code&gt;, &lt;code&gt;Padding&lt;/code&gt;, and &lt;code&gt;Include&lt;/code&gt;
with &lt;code&gt;Transparent&lt;/code&gt;, &lt;code&gt;Legend&lt;/code&gt; and &lt;code&gt;Name &amp;amp; date&lt;/code&gt;. PNG adds &lt;code&gt;Size&lt;/code&gt;: &lt;code&gt;1×&lt;/code&gt; to &lt;code&gt;4×&lt;/code&gt; scale, or a
width such as 1,920 px. Mermaid lists the tables inside the frame, has a &lt;code&gt;Markdown fence&lt;/code&gt;
toggle, and pasted into a GitHub or GitLab pull request it renders as a diagram. &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;C&lt;/kbd&gt;&lt;/kbd&gt; or
&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;C&lt;/kbd&gt;&lt;/kbd&gt; copies what the canvas shows as an image without opening the dialog.&lt;/p&gt;
&lt;p&gt;Diagram export is Free on every engine.&lt;/p&gt;
&lt;h2 id=&quot;a-schema-design&quot;&gt;A schema design&lt;a class=&quot;guide-anchor&quot; href=&quot;#a-schema-design&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In &lt;a href=&quot;/guide/design-a-schema-change/&quot;&gt;Design a schema change&lt;/a&gt;, &lt;code&gt;Copy SQL&lt;/code&gt; in the &lt;code&gt;SQL&lt;/code&gt; pane
copies the script at any point. After an apply, &lt;code&gt;Save as .sql&lt;/code&gt; writes it to your SQL folder. The
design&amp;#39;s &lt;code&gt;Export&lt;/code&gt; adds a &lt;code&gt;Show&lt;/code&gt; choice of &lt;code&gt;Changes&lt;/code&gt;, &lt;code&gt;After&lt;/code&gt; or &lt;code&gt;Before&lt;/code&gt;, &lt;code&gt;Changes&lt;/code&gt; under &lt;code&gt;Tables&lt;/code&gt;, and
for Mermaid a &lt;code&gt;PR summary&lt;/code&gt;: &amp;quot;The diagram, the list of changes, and the SQL&amp;quot;.&lt;/p&gt;
&lt;h2 id=&quot;what-is-not-there&quot;&gt;What is not there&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-is-not-there&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;No full export of a table beyond &lt;code&gt;All rows&lt;/code&gt;, and no export of several result sets at once.&lt;/li&gt;
&lt;li&gt;No scheduled exports and no cloud destinations.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For a result bigger than the cap on Free, raise &lt;code&gt;Rows kept per result&lt;/code&gt; to 100,000 in Settings ›
Connections and safety, and run it again. Past that, let the server write the file. From
&lt;a href=&quot;/guide/terminal/&quot;&gt;the terminal&lt;/a&gt;, which &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;`&lt;/kbd&gt;&lt;/kbd&gt; opens:&lt;/p&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#text-align-left&quot; /&gt;&lt;/svg&gt;Text&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;text&quot;&gt;&lt;code&gt;psql &amp;quot;$DATABASE_URL&amp;quot; -c &amp;quot;\copy (SELECT * FROM commerce.orders WHERE placed_at &amp;gt;= now() - interval &amp;#39;30 days&amp;#39;) TO &amp;#39;orders.csv&amp;#39; WITH (FORMAT csv, HEADER)&amp;quot;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;\copy&lt;/code&gt; runs on your machine and needs no server file privileges. &lt;code&gt;COPY ... TO &amp;#39;/path&amp;#39;&lt;/code&gt; in the
editor writes on the database server&amp;#39;s disk instead, and Seqora asks before it runs.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;PostgreSQL&amp;#39;s &lt;code&gt;COPY ... WITH (FORMAT csv)&lt;/code&gt; reads an empty field as &lt;code&gt;NULL&lt;/code&gt;. Load a Seqora CSV
with &lt;code&gt;NULL &amp;#39;NULL&amp;#39;&lt;/code&gt;, or clear the sheet&amp;#39;s &lt;code&gt;NULL&lt;/code&gt; option before you export. MySQL&amp;#39;s &lt;code&gt;LOAD DATA&lt;/code&gt;
reads &lt;code&gt;\N&lt;/code&gt; as &lt;code&gt;NULL&lt;/code&gt;, so type &lt;code&gt;\N&lt;/code&gt; there for MySQL.&lt;/li&gt;
&lt;li&gt;A spreadsheet shows &lt;code&gt;NULL&lt;/code&gt; as text. Clear &lt;code&gt;NULL&lt;/code&gt; in the sheet, or export XLSX, which leaves
the cell empty.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;All rows&lt;/code&gt; fetches page after page as separate queries. A table with a key, or a keyless one
up to 100,000 rows, is paged in a stable order. A larger keyless table is read in the
server&amp;#39;s scan order, which the card marks with a warning sign, so the file can repeat or miss
rows if that order changes during the export.&lt;/li&gt;
&lt;li&gt;The grid holds a binary value only as its size, such as &lt;code&gt;&amp;lt;binary · 12 bytes&amp;gt;&lt;/code&gt;, so &lt;code&gt;Loaded&lt;/code&gt; and
&lt;code&gt;All rows&lt;/code&gt; refuse a binary column rather than write that label. &lt;code&gt;Leave out binary column&lt;/code&gt; drops
it and the rest exports. &lt;code&gt;Full result&lt;/code&gt; reads the values again, so it writes them.&lt;/li&gt;
&lt;li&gt;A result with values the run could not read refuses to export: &amp;quot;3 values could not be read,
so the export would write placeholders instead of data. Hide that column or re-run the
query.&amp;quot; Hide the column and the rest exports. On MySQL, MariaDB and SQLite a full export
stops at a value over 256 KiB for the same reason, and names its row and column.&lt;/li&gt;
&lt;li&gt;A full export to Parquet stops at a value that doesn&amp;#39;t fit its column&amp;#39;s type, such as text
in an SQLite &lt;code&gt;INTEGER&lt;/code&gt; column, and names the row. Export that result as CSV or XLSX.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Full result&lt;/code&gt; re-runs the statement, so rows written since the grid loaded are in the file.
The grid&amp;#39;s local filter and sort don&amp;#39;t apply to it.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry>
    <title>Import</title>
    <link href="https://seqora.dev/guide/import/" />
    <id>https://seqora.dev/guide/import/</id>
    <published>2026-10-28T00:00:00Z</published>
    <updated>2026-10-28T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Load a CSV, TSV or Excel file into a table. Map its columns, check every row before anything is written, fix the rejects and import them, or undo the import.</summary>
    <content type="html">&lt;p&gt;Read this when rows arrive as a file: an export from another system, a spreadsheet from a
colleague, a fixture you keep in the repository. Import is Pro. On Free, &lt;code&gt;Import data…&lt;/code&gt; carries
the &lt;code&gt;Pro&lt;/code&gt; badge and opens the upgrade panel.&lt;/p&gt;
&lt;h2 id=&quot;open-an-import&quot;&gt;Open an import&lt;a class=&quot;guide-anchor&quot; href=&quot;#open-an-import&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;An import goes into one table, and opens in a tab of its own named after the file and the
table, such as &lt;code&gt;customers_oct.xlsx → customers&lt;/code&gt;. There are four ways in.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Right-click a table in the explorer and choose &lt;code&gt;Import data…&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;In a table tab, open the more menu and choose &lt;code&gt;Import data…&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Drag a &lt;code&gt;.csv&lt;/code&gt;, &lt;code&gt;.tsv&lt;/code&gt;, &lt;code&gt;.txt&lt;/code&gt;, &lt;code&gt;.xlsx&lt;/code&gt; or &lt;code&gt;.xls&lt;/code&gt; file onto a table in the explorer. The row
lights up while the file is over it.&lt;/li&gt;
&lt;li&gt;Open the command palette and run &lt;code&gt;Import data…&lt;/code&gt;. It imports into the table tab in front, or the
table selected in the explorer.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The footer of the tab is the step strip: &lt;code&gt;File&lt;/code&gt;, &lt;code&gt;Map&lt;/code&gt;, &lt;code&gt;Check&lt;/code&gt;, &lt;code&gt;Import&lt;/code&gt;. Each segment shows
what its step settled, such as &lt;code&gt;customers_oct.xlsx · Sheet1 · 48,213&lt;/code&gt; or &lt;code&gt;✓ 48,101 · ✕ 112&lt;/code&gt;.
Click a segment to go back to it. The last segment is the next action. Changing the file or the
mapping drops the check, so the strip sends you through &lt;code&gt;Check&lt;/code&gt; again.&lt;/p&gt;
&lt;h2 id=&quot;read-the-file&quot;&gt;Read the file&lt;a class=&quot;guide-anchor&quot; href=&quot;#read-the-file&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Click &lt;code&gt;Choose file…&lt;/code&gt;, unless you dropped one.&lt;/li&gt;
&lt;li&gt;For a workbook, pick the sheet. Each one shows its rows and columns.&lt;/li&gt;
&lt;li&gt;Check the header. &lt;code&gt;Header&lt;/code&gt; is &lt;code&gt;Row 1&lt;/code&gt; by default. Click a row number in the preview to make
that row the header, or choose &lt;code&gt;None&lt;/code&gt; and the columns are named &lt;code&gt;A&lt;/code&gt;, &lt;code&gt;B&lt;/code&gt;, &lt;code&gt;C&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Set how values read. &lt;code&gt;NULL&lt;/code&gt; is the text that means NULL besides an empty cell, such as &lt;code&gt;\N&lt;/code&gt;.
&lt;code&gt;Empty text&lt;/code&gt; decides whether an empty cell in a text column is NULL or &lt;code&gt;&amp;#39;&amp;#39;&lt;/code&gt;. &lt;code&gt;Dates&lt;/code&gt; is the
day and month order of dates written with slashes.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Seqora detects a text file&amp;#39;s delimiter and encoding: UTF-8, UTF-8 with a BOM, UTF-16 or
Windows-1252. &lt;code&gt;Delimiter&lt;/code&gt; and &lt;code&gt;Encoding&lt;/code&gt; override both. Dates are read from the first rows: a
value like &lt;code&gt;14/09/2026&lt;/code&gt; settles &lt;code&gt;DD/MM/YYYY&lt;/code&gt;. When every date fits both orders, Seqora follows
your system&amp;#39;s locale and marks &lt;code&gt;Dates&lt;/code&gt; with &lt;code&gt;▲&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;map-the-columns&quot;&gt;Map the columns&lt;a class=&quot;guide-anchor&quot; href=&quot;#map-the-columns&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;Map&lt;/code&gt; lists the file&amp;#39;s columns, three sample values each, and the table column each one fills.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Match&lt;/code&gt; is &lt;code&gt;Name&lt;/code&gt; at first. Names match without case, spaces or punctuation, so &lt;code&gt;Customer ID&lt;/code&gt;
finds &lt;code&gt;customer_id&lt;/code&gt;, and a name that starts or ends with the other finds it when nothing else
does. &lt;code&gt;Order&lt;/code&gt; maps the first column to the first column. Changing any row makes it &lt;code&gt;Manual&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Choose &lt;code&gt;skip&lt;/code&gt; to leave a file column out.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Convert&lt;/code&gt; changes a value on the way in: &lt;code&gt;no change&lt;/code&gt;, &lt;code&gt;trim&lt;/code&gt;, &lt;code&gt;× factor&lt;/code&gt; (cents from dollars
is &lt;code&gt;× 100&lt;/code&gt;), or &lt;code&gt;empty →&lt;/code&gt; a value for empty cells. With a conversion set, the sample shows what
it becomes after a &lt;code&gt;→&lt;/code&gt;. Date and enum columns show what they will read, such as
&lt;code&gt;DD/MM/YYYY&lt;/code&gt; or &lt;code&gt;enum · 6 of 6&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;When the names disagree about a unit, as &lt;code&gt;Lifetime $&lt;/code&gt; into &lt;code&gt;lifetime_cents&lt;/code&gt; does, the row
offers &lt;code&gt;dollars → cents? Apply × 100&lt;/code&gt;. Seqora reads only the names here, so it suggests and
never applies it for you.&lt;/li&gt;
&lt;li&gt;Table columns no file column fills are listed under the file&amp;#39;s columns with &lt;code&gt;←&lt;/code&gt;. Type a value
there and every row gets it. A NOT NULL column without a default shows &lt;code&gt;✕ required&lt;/code&gt; until it
has one.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;Rows&lt;/code&gt; decides what happens to rows already in the table.&lt;/p&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Rows&lt;/th&gt;
&lt;th&gt;Does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Append&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Inserts every row. A duplicate key is a reject.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Upsert on id&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Inserts new keys and updates existing rows. The key is the primary key, or a unique key you pick.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Replace all&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Deletes the table&amp;#39;s rows, then inserts the file, in one transaction.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/import-map.webp?v=58b083bcda&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/import-map-800.webp?v=6c41c531a6&quot; srcset=&quot;/guide/shots/import-map-800.webp?v=6c41c531a6 800w, /guide/shots/import-map.webp?v=58b083bcda 2000w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(1000px, 46rem)&quot; width=&quot;1000&quot; height=&quot;641&quot; alt=&quot;The Map step of an import: each file column with samples, the table column it fills, its type and how it reads, and marketing_opt_in filled by a table default.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;From the app&amp;#39;s own fixture, importing &lt;code&gt;customers_oct.xlsx&lt;/code&gt; into &lt;code&gt;customers&lt;/code&gt;.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;check-every-row&quot;&gt;Check every row&lt;a class=&quot;guide-anchor&quot; href=&quot;#check-every-row&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;Check&lt;/code&gt; reads the whole file and converts every value to its column&amp;#39;s type before anything is
written. The grid shows the first 200 rows as they will be stored, under the table&amp;#39;s columns.
Each column header has a bar of valid, empty and bad values and a count, &lt;code&gt;✕ 61&lt;/code&gt; or &lt;code&gt;✓&lt;/code&gt;. Bad
cells are hatched. &lt;code&gt;✕ 112 bad rows&lt;/code&gt; shows only the rows with a problem, as the file holds them.&lt;/p&gt;
&lt;p&gt;The right side holds the rest of the decisions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Bad rows&lt;/code&gt;: &lt;code&gt;Stop&lt;/code&gt; writes nothing if one row is bad. &lt;code&gt;Skip&lt;/code&gt; leaves bad rows out and keeps them
as rejects. &lt;code&gt;→ NULL&lt;/code&gt; loads a bad value as NULL where the column allows it.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Commit&lt;/code&gt;: &lt;code&gt;All at once&lt;/code&gt; is one transaction. &lt;code&gt;Every 5,000&lt;/code&gt; commits as it goes, so a failure
keeps the rows committed before it. &lt;code&gt;Replace all&lt;/code&gt; is always one transaction.&lt;/li&gt;
&lt;li&gt;The counts: &lt;code&gt;+ insert&lt;/code&gt;, &lt;code&gt;~ update&lt;/code&gt; for an upsert, &lt;code&gt;✕ skip&lt;/code&gt;, and how long the check took.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Bad by reason&lt;/code&gt;: &lt;code&gt;date not DD/MM/YYYY&lt;/code&gt;, &lt;code&gt;not in region_t&lt;/code&gt;, &lt;code&gt;repeats in file&lt;/code&gt;, with the column.
Click one to see its cells in the grid, one at a time, with &lt;code&gt;Previous&lt;/code&gt;, &lt;code&gt;Next&lt;/code&gt; and &lt;code&gt;Done&lt;/code&gt;.
When the bad dates read in the other order, &lt;code&gt;Read as MM/DD/YYYY&lt;/code&gt; switches and checks again.&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/import-check.webp?v=61dd51f75a&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/import-check-800.webp?v=64d5c2d793&quot; srcset=&quot;/guide/shots/import-check-800.webp?v=64d5c2d793 800w, /guide/shots/import-check.webp?v=61dd51f75a 2000w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(1000px, 46rem)&quot; width=&quot;1000&quot; height=&quot;641&quot; alt=&quot;The Check step of an import: the first rows under the table&amp;#39;s columns with bad cells hatched, a bar on each header, and Rows, Bad rows, Commit and the counts on the right.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;&lt;code&gt;✕ 112 bad rows&lt;/code&gt;, and &lt;code&gt;Import 48,101 rows&lt;/code&gt; waiting in the strip.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Changing &lt;code&gt;Rows&lt;/code&gt; or &lt;code&gt;Bad rows&lt;/code&gt; checks again.&lt;/p&gt;
&lt;h2 id=&quot;import&quot;&gt;Import&lt;a class=&quot;guide-anchor&quot; href=&quot;#import&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Click &lt;code&gt;Import 48,101 rows&lt;/code&gt; in the strip. On a production connection the tab shows &lt;code&gt;Production&lt;/code&gt;,
the button turns red and Seqora asks before writing. &lt;code&gt;Replace all&lt;/code&gt; always asks. A
locked connection shows &lt;code&gt;Writes locked&lt;/code&gt; and &lt;code&gt;Unlock&lt;/code&gt;: the check runs, the import doesn&amp;#39;t.&lt;/p&gt;
&lt;p&gt;PostgreSQL loads with &lt;code&gt;COPY&lt;/code&gt; into a staging table and inserts or upserts from there. MySQL and
MariaDB use batched multi-row &lt;code&gt;INSERT&lt;/code&gt;, and SQLite prepared statements in a transaction. A batch
the database refuses is split until the refused rows are found. With &lt;code&gt;Skip&lt;/code&gt; they become rejects
carrying the database&amp;#39;s message. SQL Server loads with batched multi-row &lt;code&gt;INSERT&lt;/code&gt; too, and upserts
with &lt;code&gt;MERGE&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The result is a flow from the file to the table: a band for the rows inserted, one for the rows
updated, and a thin band for the rejects that drops into the list below. The table shows its
rows now and what it had before. Hover a band for its exact count.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/import-result.webp?v=343f3615d1&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/import-result-800.webp?v=cd4ca15b58&quot; srcset=&quot;/guide/shots/import-result-800.webp?v=cd4ca15b58 800w, /guide/shots/import-result.webp?v=343f3615d1 2000w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(1000px, 46rem)&quot; width=&quot;1000&quot; height=&quot;641&quot; alt=&quot;The result of an import: a flow from the file to the table with bands for inserted and updated rows, a thin band for 112 rejected rows, and the rejects listed below.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Undo import&lt;/code&gt;, at the top of the tab, asks first, then deletes the rows the import inserted
and puts back the old values of rows it updated. After &lt;code&gt;Replace all&lt;/code&gt; it reads &lt;code&gt;no undo&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Open customers&lt;/code&gt;, now the last segment of the strip, opens the table.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;fix-the-rejects&quot;&gt;Fix the rejects&lt;a class=&quot;guide-anchor&quot; href=&quot;#fix-the-rejects&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;Rejects&lt;/code&gt; lists one row per bad value: &lt;code&gt;Line&lt;/code&gt;, &lt;code&gt;Column&lt;/code&gt;, &lt;code&gt;Value&lt;/code&gt;, &lt;code&gt;Reason&lt;/code&gt; and &lt;code&gt;Fix&lt;/code&gt;. The chips
above filter by column.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Type the right value in &lt;code&gt;Fix&lt;/code&gt;. Type &lt;code&gt;NULL&lt;/code&gt; for NULL. &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Esc&lt;/kbd&gt;&lt;/kbd&gt; clears a fix.&lt;/li&gt;
&lt;li&gt;Or apply a fix to many rows from the buttons below. &lt;code&gt;Fix 24 · read as MM/DD/YYYY&lt;/code&gt; rewrites
dates written in the other order. &lt;code&gt;Map Europe → EU-West · 24&lt;/code&gt; gives every &lt;code&gt;Europe&lt;/code&gt; an enum
label. With a column chosen, &lt;code&gt;region → NULL · 6&lt;/code&gt; empties its bad values.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Import 2 fixed&lt;/code&gt;. The rows that load leave the list. The ones that fail again stay,
with their new reason.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;code&gt;Save 112 as rejects.csv&lt;/code&gt; writes every reject with its line and reason, for whoever sent the
file. Closing the tab forgets the rejects and the undo.&lt;/p&gt;
&lt;h2 id=&quot;caveats&quot;&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Import reads CSV, TSV and Excel. JSON and Parquet don&amp;#39;t import.&lt;/li&gt;
&lt;li&gt;An import fills an existing table. It doesn&amp;#39;t create one from the file.&lt;/li&gt;
&lt;li&gt;Upsert needs a primary or a unique key.&lt;/li&gt;
&lt;li&gt;The rejects list holds the first 10,000. &lt;code&gt;Save as rejects.csv&lt;/code&gt; writes them all.&lt;/li&gt;
&lt;li&gt;An import tab isn&amp;#39;t restored after a restart.&lt;/li&gt;
&lt;/ul&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;Most import tools stop at the first bad row, or write &lt;code&gt;null&lt;/code&gt; as the text &lt;code&gt;null&lt;/code&gt;. I wanted the
whole file checked before anything is written, and the bad rows kept where you can fix them,
because the 112 bad rows are the ones somebody will ask about.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
</content>
  </entry>
  <entry>
    <title>See what changed in a schema</title>
    <link href="https://seqora.dev/guide/schema-history/" />
    <id>https://seqora.dev/guide/schema-history/</id>
    <published>2026-10-27T00:00:00Z</published>
    <updated>2026-10-27T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Seqora records a schema&#39;s history on its own. Read what changed since you last connected, where it came from, and get the script that puts it back.</summary>
    <content type="html">&lt;p&gt;Read this when &lt;code&gt;orders-prod&lt;/code&gt; has a column you don&amp;#39;t remember adding, or a migration ran overnight
and you want to see what it did. Seqora has been recording since the first time you connected,
so there is nothing to set up. History works on every engine.&lt;/p&gt;
&lt;h2 id=&quot;what-seqora-records&quot;&gt;What Seqora records&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-seqora-records&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Seqora checks the watched schemas when a connection opens, every 30 minutes while it stays open,
when you refresh the explorer, and around every change Seqora makes itself. A check that finds
nothing new writes a few bytes. A check that finds a change stores a snapshot of the schema and
records the change.&lt;/p&gt;
&lt;p&gt;The watched schemas are &lt;code&gt;public&lt;/code&gt; on PostgreSQL and &lt;code&gt;dbo&lt;/code&gt; on SQL Server, plus every schema you
open in Seqora, up to 20. On MySQL and MariaDB it is the connection&amp;#39;s database, and on SQLite it
is &lt;code&gt;main&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Everything stays on your machine, in the same encrypted store that holds your connections and
designs. Nothing is uploaded. The checks read the catalog only and never write to your
database, so they are safe on production.&lt;/p&gt;
&lt;p&gt;Every change carries one of four sources:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;You&lt;/code&gt;: Seqora made it, from a design, a compare or the SQL editor. The time is exact.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Migration&lt;/code&gt;: a migrations table such as &lt;code&gt;_prisma_migrations&lt;/code&gt;, &lt;code&gt;flyway_schema_history&lt;/code&gt; or
&lt;code&gt;schema_migrations&lt;/code&gt; gained rows in the same window. The change names the versions, for example
&lt;code&gt;0046_discounts&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;No migration&lt;/code&gt;: neither of the above. Someone changed the schema by hand, or with a tool
Seqora doesn&amp;#39;t know.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;First snapshot&lt;/code&gt;: where the history starts.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Seqora reads no DDL times from the database, so an outside change shows as a window: &lt;code&gt;11:00–16:40&lt;/code&gt;
means the last check that saw the old schema was at 11:00 and the first that saw the new one was
at 16:40. When the migrations table records when it ran, the window narrows to that.&lt;/p&gt;
&lt;h2 id=&quot;open-the-history-tab&quot;&gt;Open the History tab&lt;a class=&quot;guide-anchor&quot; href=&quot;#open-the-history-tab&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Right-click &lt;code&gt;orders-prod&lt;/code&gt; in the explorer and choose &lt;code&gt;Schema history&lt;/code&gt;. A schema&amp;#39;s own menu has
&lt;code&gt;History&lt;/code&gt; too.&lt;/li&gt;
&lt;li&gt;The tab opens on &lt;code&gt;public&lt;/code&gt; with &lt;code&gt;Since&lt;/code&gt; set to &lt;code&gt;Last connect&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Pick another day, &lt;code&gt;First snapshot&lt;/code&gt; or &lt;code&gt;Custom&lt;/code&gt; under &lt;code&gt;Since&lt;/code&gt; to change the range.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;When a change arrives that you didn&amp;#39;t make in Seqora, a toast lists it, for example
&lt;code&gt;+ orders.discount_code&lt;/code&gt; with &lt;code&gt;0046_discounts&lt;/code&gt;. Its &lt;code&gt;History&lt;/code&gt; button opens the tab. If you close
the toast, the connection&amp;#39;s row in the explorer shows &amp;quot;3 new&amp;quot; until you open History.&lt;/p&gt;
&lt;p&gt;The command palette knows time words. Type &lt;code&gt;since tue&lt;/code&gt;, &lt;code&gt;yesterday&lt;/code&gt; or &lt;code&gt;last week&lt;/code&gt; to list every
connection that changed in that range, or run &lt;code&gt;Schema history&lt;/code&gt; and pick a schema.&lt;/p&gt;
&lt;h2 id=&quot;read-a-range&quot;&gt;Read a range&lt;a class=&quot;guide-anchor&quot; href=&quot;#read-a-range&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The feed on the left lists the changes, newest first, grouped by day. Checks that found nothing
fold into one quiet line, such as &amp;quot;18 check-ins&amp;quot;. Each change shows its time or window, its
counts (&lt;code&gt;+2 ~1 −1&lt;/code&gt;), its source and the tables it touched.&lt;/p&gt;
&lt;p&gt;Click one change to see it alone. Click a second to make a range. The middle lists what changed
in the range, grouped by table, and the right pane shows the selected table&amp;#39;s DDL before and
after, with the added and removed lines marked. Rows with &lt;code&gt;No migration&lt;/code&gt; take the warning colour
and icon.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Take snapshot&lt;/code&gt; checks the schema now instead of waiting for the next check.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/schema-history.webp?v=14c2a764a1&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/schema-history-800.webp?v=2362150b4c&quot; srcset=&quot;/guide/shots/schema-history-800.webp?v=2362150b4c 800w, /guide/shots/schema-history.webp?v=14c2a764a1 2000w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(1000px, 46rem)&quot; width=&quot;1000&quot; height=&quot;516&quot; alt=&quot;The schema history of orders-prod: a feed of changes by day, one change selected from migration 0046_discounts, the tables it touched, and the DDL removed.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;From the app&amp;#39;s own fixture. The change from &lt;code&gt;0046_discounts&lt;/code&gt; is selected, and the feed folds the checks that found nothing.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;put-it-back&quot;&gt;Put it back&lt;a class=&quot;guide-anchor&quot; href=&quot;#put-it-back&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;Undo script&lt;/code&gt; opens &lt;a href=&quot;/guide/compare-two-schemas/&quot;&gt;a compare&lt;/a&gt; that makes the live schema match the
start of the range. You review, check and apply it like any other compare. Data a drop deleted
does not come back.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Diagram at …&lt;/code&gt; opens the ER diagram of the schema as it was at the start of the range. It is
read-only.&lt;/p&gt;
&lt;h2 id=&quot;settings&quot;&gt;Settings&lt;a class=&quot;guide-anchor&quot; href=&quot;#settings&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;Settings&lt;/code&gt; → &lt;code&gt;Schema history&lt;/code&gt; turns &lt;code&gt;Record schema history&lt;/code&gt; off for every connection or for
one, and sets &lt;code&gt;Keep check-ins&lt;/code&gt;: 30, 90 or 365 days, 90 by default. Changes and their snapshots are kept
until you delete them. The page shows how much space each connection uses, its watched schemas,
and &lt;code&gt;Delete history&lt;/code&gt;.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Free shows the last 7 days in full. Older changes, &lt;code&gt;Custom&lt;/code&gt;, &lt;code&gt;Undo script&lt;/code&gt;, &lt;code&gt;Diagram at …&lt;/code&gt; and
the &lt;code&gt;Since&lt;/code&gt; column on the Columns overview and in the column inspector are Pro. Recording is
free, so history from before you upgrade is there when you do.&lt;/li&gt;
&lt;li&gt;Time words in the palette reach back 7 days on Free.&lt;/li&gt;
&lt;li&gt;A hand-made change in the same window as a migration is listed under that migration. Seqora
can&amp;#39;t tell them apart and doesn&amp;#39;t guess.&lt;/li&gt;
&lt;li&gt;Seqora never knows who made an outside change. It knows when it noticed.&lt;/li&gt;
&lt;li&gt;A rename shows as a drop and an add.&lt;/li&gt;
&lt;li&gt;History only covers time when Seqora was open and connected. A change made while it was closed
shows up at the next connect, with a window that spans the gap.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;The question after an incident is nearly always &amp;quot;what changed, and when&amp;quot;. The database doesn&amp;#39;t
keep that, and the migrations table only knows about migrations. Checking the catalog every half
hour costs one read, and it means the answer is already on your machine the day you need it.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
</content>
  </entry>
  <entry>
    <title>Find drift between environments</title>
    <link href="https://seqora.dev/guide/schema-drift/" />
    <id>https://seqora.dev/guide/schema-drift/</id>
    <published>2026-10-27T00:00:00Z</published>
    <updated>2026-10-27T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Compare local, staging and production from the snapshots Seqora already has, see which differences no migration explains, and accept the ones you meant.</summary>
    <content type="html">&lt;p&gt;Read this when the same database lives in several environments and you want to know whether
production still matches what staging tested. The drift board reads the snapshots that
&lt;a href=&quot;/guide/schema-history/&quot;&gt;schema history&lt;/a&gt; already took. It doesn&amp;#39;t connect to anything to draw a
row, so it never waits on a database and never touches production.&lt;/p&gt;
&lt;h2 id=&quot;app-groups&quot;&gt;App groups&lt;a class=&quot;guide-anchor&quot; href=&quot;#app-groups&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Drift compares connections that hold the same app. Seqora groups them for you inside a
workspace: &lt;code&gt;orders-local&lt;/code&gt; in Development, &lt;code&gt;orders-staging&lt;/code&gt; in Staging and &lt;code&gt;orders-prod&lt;/code&gt; in
Production share the database name &lt;code&gt;orders&lt;/code&gt;, so they form the app &lt;strong&gt;orders&lt;/strong&gt;. When the names
differ, as with &lt;code&gt;orders_dev&lt;/code&gt; and &lt;code&gt;orders&lt;/code&gt;, Seqora pairs them when their newest snapshots share at
least 80% of their table names.&lt;/p&gt;
&lt;p&gt;A group holds at most one connection per environment, and a workspace with one environment has no
groups. To change a group:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Right-click the workspace in the explorer and choose &lt;code&gt;App groups…&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Rename a group, move a connection to another group, or pick &lt;code&gt;Left out&lt;/code&gt; to keep a connection
out of every group. &lt;code&gt;Automatic&lt;/code&gt; puts it back.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Save&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Renaming a group keeps the differences you accepted under it.&lt;/p&gt;
&lt;h2 id=&quot;open-the-board&quot;&gt;Open the board&lt;a class=&quot;guide-anchor&quot; href=&quot;#open-the-board&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;The workspace row in the explorer shows a warning icon and the number of drift rows across
its groups.&lt;/li&gt;
&lt;li&gt;Right-click the workspace and choose &lt;code&gt;Drift · orders&lt;/code&gt;, or run &lt;code&gt;Schema drift&lt;/code&gt; from the command
palette.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The board has one column per environment, in the order Development, Testing, Staging,
Production. Each column shows the connection, its environment, the newest migration version and
how old its snapshot is. An age over 7 days takes the warning colour. A connection Seqora has
never captured reads &lt;code&gt;Never captured&lt;/code&gt;, with &lt;code&gt;Connect&lt;/code&gt; beside it. The header also says how many
tables are identical everywhere, for example &amp;quot;26 tables identical&amp;quot;.&lt;/p&gt;
&lt;h2 id=&quot;read-the-rows&quot;&gt;Read the rows&lt;a class=&quot;guide-anchor&quot; href=&quot;#read-the-rows&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Each row is one object that differs somewhere: &lt;code&gt;customers.phone&lt;/code&gt;, &lt;code&gt;payments_created_at_idx&lt;/code&gt;.
Every cell holds that environment&amp;#39;s value, or is hatched when the object is absent there. The
cell that disagrees with the rest takes the warning colour, with the date it changed and its
source from history. Index and constraint names that differ between environments don&amp;#39;t count as
differences.&lt;/p&gt;
&lt;p&gt;The rows sit in three sections:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Drift&lt;/code&gt;: differences nothing explains. These are the ones to look at.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Expected&lt;/code&gt;: a migration staging has run and production hasn&amp;#39;t yet, such as &lt;code&gt;0047_refunds&lt;/code&gt;,
which the cell names, or a change only Development has that no migration made.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Accepted&lt;/code&gt;: differences you accepted. Collapsed.&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/schema-drift.webp?v=f7267d011e&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/schema-drift-800.webp?v=d85cce8f3e&quot; srcset=&quot;/guide/shots/schema-drift-800.webp?v=d85cce8f3e 800w, /guide/shots/schema-drift.webp?v=f7267d011e 2000w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(1000px, 46rem)&quot; width=&quot;1000&quot; height=&quot;415&quot; alt=&quot;The drift board for orders across local, staging and prod: three Drift rows with prod&amp;#39;s cell in the warning colour, two Expected rows, and Compare staging to prod.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;From the app&amp;#39;s own fixture. Under &lt;code&gt;Drift&lt;/code&gt; the odd cell is always &lt;code&gt;prod&lt;/code&gt;&amp;#39;s, and &lt;code&gt;refunds&lt;/code&gt; is &lt;code&gt;Expected&lt;/code&gt; because &lt;code&gt;0047_refunds&lt;/code&gt; hasn&amp;#39;t reached it.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;When every environment matches, the board says so: &amp;quot;orders matches across local, staging and
prod&amp;quot;.&lt;/p&gt;
&lt;h2 id=&quot;act-on-a-row&quot;&gt;Act on a row&lt;a class=&quot;guide-anchor&quot; href=&quot;#act-on-a-row&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Select a drift row.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Compare staging → prod&lt;/code&gt; opens &lt;a href=&quot;/guide/compare-two-schemas/&quot;&gt;a compare&lt;/a&gt; between the two live
connections, reading both fresh, so you get the script that makes the odd one match.&lt;/li&gt;
&lt;li&gt;Or click &lt;code&gt;Accept&lt;/code&gt; when the difference is on purpose. The row moves to &lt;code&gt;Accepted&lt;/code&gt; and stays
there while every environment keeps the same value. If any of them changes, it comes back
under &lt;code&gt;Drift&lt;/code&gt;. &lt;code&gt;Remove&lt;/code&gt; on an accepted row brings it back now.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;code&gt;Copy report&lt;/code&gt; copies the board as Markdown, for a ticket or a release note. &lt;code&gt;Refresh&lt;/code&gt; connects
to each environment in turn and checks it, so the board shows the schema as it is now. One that
can&amp;#39;t connect keeps its last snapshot and its age.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The drift board is Pro. App groups, &lt;code&gt;App groups…&lt;/code&gt; and the count on the workspace row are free.&lt;/li&gt;
&lt;li&gt;The board is only as fresh as the snapshots. Use &lt;code&gt;Refresh&lt;/code&gt;, or open a connection, before you
trust an old column.&lt;/li&gt;
&lt;li&gt;Drift compares one engine family. A group can&amp;#39;t mix PostgreSQL with MySQL.&lt;/li&gt;
&lt;li&gt;With no Production environment, the last environment in the order above is the reference.&lt;/li&gt;
&lt;li&gt;On MySQL and MariaDB each connection&amp;#39;s own database is compared, whatever its name.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;Staging was green, production failed, and the difference was an index somebody added by hand two
months ago. Every team I have worked with has that story. The snapshots were already on my
machine, so comparing them costs nothing. And a migration that isn&amp;#39;t deployed yet shouldn&amp;#39;t look
like the same problem.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
</content>
  </entry>
  <entry>
    <title>Start here</title>
    <link href="https://seqora.dev/guide/start-here/" />
    <id>https://seqora.dev/guide/start-here/</id>
    <published>2026-10-18T00:00:00Z</published>
    <updated>2026-10-18T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>What Seqora is for, the first ten minutes with the bundled sample, and which page answers the problem you came with.</summary>
    <content type="html">&lt;p&gt;Seqora is a desktop app for looking at a database and understanding what you see. It draws the plan the planner chose, puts a page behind every table, index, sequence and function, and shows the schema as a diagram you can change. It opens every connection read-only, so looking is safe and writing is a decision.&lt;/p&gt;
&lt;p&gt;To install it, &lt;a href=&quot;/guide/database-client-for-mac/&quot;&gt;A database client for Mac&lt;/a&gt; has the .dmg and Homebrew, &lt;a href=&quot;/guide/database-client-for-windows/&quot;&gt;A database client for Windows&lt;/a&gt; the PowerShell line and the installer, and &lt;a href=&quot;/guide/postgresql-gui-for-linux/&quot;&gt;A PostgreSQL GUI for Linux&lt;/a&gt; the .deb and the AppImage.&lt;/p&gt;
&lt;h2 id=&quot;the-first-ten-minutes&quot;&gt;The first ten minutes&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-first-ten-minutes&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Open the app. The first screen is &lt;code&gt;Start with the sample database&lt;/code&gt;, with &lt;code&gt;Explore the sample&lt;/code&gt; and &lt;code&gt;Add connection&lt;/code&gt;.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/start-here-welcome.webp?v=afb954d50e&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/start-here-welcome-800.webp?v=a106801fcd&quot; srcset=&quot;/guide/shots/start-here-welcome-800.webp?v=a106801fcd 800w, /guide/shots/start-here-welcome.webp?v=afb954d50e 1220w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(610px, 46rem)&quot; width=&quot;610&quot; height=&quot;704&quot; alt=&quot;The first screen: Start with the sample database, with Explore the sample, Add connection, servers suggested from local ports, and New SQL editor.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;The first screen. &lt;code&gt;Suggested&lt;/code&gt; lists the servers Seqora found on local ports that no saved connection covers.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;Explore the sample&lt;/code&gt; opens a bundled SQLite database called &lt;code&gt;Sample coffee shop&lt;/code&gt;. It needs no server and nothing to install. It opens three tabs, the &lt;code&gt;orders&lt;/code&gt; grid, the database brief and the ER diagram, and lands on the diagram. The first SQL editor you open there starts with a query already written. Because it is SQLite, the Plan tab there shows estimates without timings, and the pages are the SQLite set. The commerce sample in this Guide is a PostgreSQL database, which is where everything is visible.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Add connection&lt;/code&gt; opens &lt;code&gt;Connect a database&lt;/code&gt;, which takes a connection URL or a host, port, user and password. A PostgreSQL, MySQL, MariaDB or SQL Server URL already on your clipboard shows up on this screen as &lt;code&gt;Connect to … from your clipboard&lt;/code&gt;, and a server listening on a local port that no saved connection covers is listed under &lt;code&gt;Suggested&lt;/code&gt;, such as &lt;code&gt;PostgreSQL on localhost:5432&lt;/code&gt;. The connection opens locked, and &lt;a href=&quot;/guide/connect/&quot;&gt;Connect&lt;/a&gt; explains the lock and how to lift it. The first time you connect to a database its brief opens, a one-page summary that &lt;a href=&quot;/guide/what-is-in-this-database/&quot;&gt;What is in this database?&lt;/a&gt; reads. &lt;a href=&quot;/guide/why-is-this-query-slow/&quot;&gt;Why is this query slow?&lt;/a&gt; is the first page to open once you are in.&lt;/p&gt;
&lt;p&gt;Once you have saved a connection the screen reads &lt;code&gt;Nothing open&lt;/code&gt; and lists &lt;code&gt;Recent connections&lt;/code&gt; instead, with the sample gone from the lead row. With &lt;code&gt;Show the Welcome screen at launch&lt;/code&gt; off, in Settings › General, the empty window shows only &lt;code&gt;Add connection&lt;/code&gt; and &lt;code&gt;New SQL editor&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Once, a &lt;code&gt;Usage counts&lt;/code&gt; notice asks whether Seqora may count which features you use and send one anonymous report a day. Nothing is counted until you pick &lt;code&gt;OK&lt;/code&gt; or &lt;code&gt;Turn off&lt;/code&gt;, and Settings › Privacy changes the answer later.&lt;/p&gt;
&lt;h2 id=&quot;the-sample-every-page-uses&quot;&gt;The sample every page uses&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-sample-every-page-uses&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Every page of this Guide uses one database, the commerce sample the home page&amp;#39;s demos show, so you never have to re-learn the tables. Its schemas are &lt;code&gt;crm&lt;/code&gt; (customers), &lt;code&gt;identity&lt;/code&gt; (login accounts), &lt;code&gt;commerce&lt;/code&gt; (stores, orders, order items), &lt;code&gt;catalog&lt;/code&gt; (categories, products), &lt;code&gt;billing&lt;/code&gt; (invoices, payments, events) and &lt;code&gt;audit&lt;/code&gt; (the change log).&lt;/p&gt;
&lt;p&gt;The plan numbers come from a 12-million-row copy of that sample. When a page says the planner expected 612 rows and found 206,880, that is the copy talking. A smaller copy gives the same plan shape with smaller numbers.&lt;/p&gt;
&lt;h2 id=&quot;if-you-came-here-because&quot;&gt;If you came here because&lt;a class=&quot;guide-anchor&quot; href=&quot;#if-you-came-here-because&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;A query takes seconds and you have a plan you cannot read: &lt;a href=&quot;/guide/why-is-this-query-slow/&quot;&gt;Why is this query slow?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;You inherited a database and nobody left a diagram: &lt;a href=&quot;/guide/a-schema-you-did-not-write/&quot;&gt;A schema you did not write&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;You need to change a few rows by hand without breaking anything: &lt;a href=&quot;/guide/edit-data/&quot;&gt;Edit data&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;You have a migration to make and want to see it before it runs: &lt;a href=&quot;/guide/design-a-schema-change/&quot;&gt;Design a schema change&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;You are about to add an index to a big table: &lt;a href=&quot;/guide/will-this-index-help/&quot;&gt;Will this index help?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Your database is MySQL, MariaDB, SQLite or SQL Server: &lt;a href=&quot;/guide/other-engines/&quot;&gt;MySQL, MariaDB, SQLite and SQL Server&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;The buttons are the easy part. What I never had was someone to read the plan with me, or to tell me what &lt;code&gt;pg_stats&lt;/code&gt; was saying, so the Guide teaches the database first and the app second.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
</content>
  </entry>
  <entry>
    <title>What a view page tells you</title>
    <link href="https://seqora.dev/guide/what-a-view-page-tells-you/" />
    <id>https://seqora.dev/guide/what-a-view-page-tells-you/</id>
    <published>2026-10-18T00:00:00Z</published>
    <updated>2026-10-18T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Read a view page: where every column comes from, what breaks if you change it, whose permissions it runs with, and how old a snapshot is.</summary>
    <content type="html">&lt;div class=&quot;guide-gate&quot;&gt;
&lt;p&gt;Open a view page before you change a view or a table it reads, or when a materialized view shows numbers that are plainly old and nobody knows when it was last refreshed. If you only want the rows, &lt;code&gt;Open rows&lt;/code&gt; in the explorer&amp;#39;s menu opens the view in the grid, read-only, and on Free a plain click does the same. &lt;code&gt;Query it&lt;/code&gt; in the Pro page&amp;#39;s header opens an editor on it.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;the-symptom&quot;&gt;The symptom&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-symptom&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The finance dashboard reads &lt;code&gt;billing.monthly_revenue&lt;/code&gt;, and your ticket is to rename a column in &lt;code&gt;billing.invoices&lt;/code&gt;. Nobody knows what else reads the view, and the materialized copy the monthly report uses shows September&amp;#39;s numbers in the third week of October.&lt;/p&gt;
&lt;div class=&quot;guide-island objects-stage&quot; data-island=&quot;object-view&quot;&gt;
&lt;div class=&quot;app-window&quot; data-platform=&quot;macos&quot;&gt;
&lt;div class=&quot;app-window-bar&quot; aria-hidden=&quot;true&quot;&gt;
&lt;span class=&quot;app-window-lights&quot;&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span class=&quot;app-window-title&quot;&gt;Seqora&lt;/span&gt;
&lt;span class=&quot;app-window-controls&quot;&gt;
&lt;svg viewBox=&quot;0 0 10 10&quot;&gt;&lt;path d=&quot;M0 5h10&quot; /&gt;&lt;/svg&gt;
&lt;svg viewBox=&quot;0 0 10 10&quot;&gt;&lt;path d=&quot;M.5.5h9v9h-9z&quot; /&gt;&lt;/svg&gt;
&lt;svg viewBox=&quot;0 0 10 10&quot;&gt;&lt;path d=&quot;M0 0l10 10M10 0L0 10&quot; /&gt;&lt;/svg&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div class=&quot;app-surface&quot; data-page=&quot;view&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The view page of &lt;code&gt;billing.monthly_revenue&lt;/code&gt;: the tables it reads, the five columns it returns, the objects that depend on it, and the shape of its query.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&quot;a-view-is-a-saved-query&quot;&gt;A view is a saved query&lt;a class=&quot;guide-anchor&quot; href=&quot;#a-view-is-a-saved-query&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A view is a query with a name. It holds no rows. &lt;code&gt;SELECT * FROM billing.monthly_revenue&lt;/code&gt; runs the query inside it every time, against today&amp;#39;s &lt;code&gt;invoices&lt;/code&gt; and &lt;code&gt;payments&lt;/code&gt;. A materialized view is the opposite: the result written to disk once, at a time you chose, which you can index like a table. It is data with a date, fast and exactly as old as its last refresh.&lt;/p&gt;
&lt;p&gt;The sentence under the header is the summary: &lt;code&gt;Reads 3 tables and returns 5 columns: revenue per month and plan, in USD only. Runs with the owner&amp;#39;s permissions. 2 objects depend on it.&lt;/code&gt; The summary and the sections below are Pro. On Free the page shows the header and &lt;code&gt;Definition&lt;/code&gt;, then a panel, &lt;code&gt;View details are part of Seqora Pro.&lt;/code&gt;, with the names of the Pro sections (&lt;a href=&quot;/guide/object-pages/&quot;&gt;Object pages&lt;/a&gt; shows the gate). A materialized view created or last refreshed &lt;code&gt;WITH NO DATA&lt;/code&gt; gets a red verdict under the summary, &lt;code&gt;Never refreshed: reading it raises an error&lt;/code&gt;, with &lt;code&gt;Open REFRESH in a SQL editor&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;On Pro, &lt;code&gt;Definition&lt;/code&gt; comes next: the &lt;code&gt;CREATE VIEW&lt;/code&gt; with &lt;code&gt;Copy&lt;/code&gt;, beside the facts you would look up. &lt;code&gt;On this page&lt;/code&gt; jumps to the sections, and each one folds to its heading and a line.&lt;/p&gt;
&lt;h2 id=&quot;snapshot&quot;&gt;Snapshot&lt;a class=&quot;guide-anchor&quot; href=&quot;#snapshot&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Materialized views only, so not in the figure.&lt;/p&gt;
&lt;p&gt;The headline is the snapshot&amp;#39;s age, or &lt;code&gt;Age unknown&lt;/code&gt; when Seqora has seen no refresh, or &lt;code&gt;Empty: never refreshed&lt;/code&gt;. A timeline of refreshes follows, with &lt;code&gt;Refreshes in 7d&lt;/code&gt;, &lt;code&gt;Typical time&lt;/code&gt;, &lt;code&gt;Slowest&lt;/code&gt; and &lt;code&gt;Readers blocked&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;One button opens the refresh statement in a SQL editor, where you run it and Seqora records the run. It reads &lt;code&gt;Refresh now&lt;/code&gt; for &lt;code&gt;REFRESH MATERIALIZED VIEW&lt;/code&gt;, which blocks readers until the new snapshot is written, or &lt;code&gt;Refresh concurrently&lt;/code&gt; when the view can take &lt;code&gt;CONCURRENTLY&lt;/code&gt;, which builds the new snapshot beside the old one and swaps the rows that changed, so readers keep reading meanwhile. That needs a unique index on the view with no &lt;code&gt;WHERE&lt;/code&gt; clause and no expression, and one plain refresh first. The chip says &lt;code&gt;Can refresh without blocking readers (unique index on month, plan)&lt;/code&gt; or &lt;code&gt;Refreshing blocks readers: it has no unique index&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Is it still current?&lt;/code&gt; has one button, &lt;code&gt;Compare with live data&lt;/code&gt;. It runs the view&amp;#39;s query now and compares the result with the snapshot row by row, in a read-only transaction that stops after 12 seconds: &lt;code&gt;4 rows in the snapshot no longer match the query, and 1 new row is missing.&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Postgres doesn&amp;#39;t record when a materialized view was refreshed. The timeline combines the refreshes Seqora ran from its SQL editor, &lt;code&gt;pg_cron&lt;/code&gt;&amp;#39;s run log, and changes Seqora noticed between visits. With &lt;code&gt;pg_stat_statements&lt;/code&gt; installed, one more line counts refreshes from every client: &lt;code&gt;All clients: 961 refreshes since 40 days ago, mean 1.9 s, slowest 4.3 s&lt;/code&gt;. Without it, &lt;code&gt;Typical time&lt;/code&gt; and &lt;code&gt;Slowest&lt;/code&gt; come only from the timeline, and the footnote says &lt;code&gt;pg_stat_statements isn&amp;#39;t installed&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;lineage&quot;&gt;Lineage&lt;a class=&quot;guide-anchor&quot; href=&quot;#lineage&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Three columns. &lt;code&gt;Reads from&lt;/code&gt; is a card per source table with the columns the query touches, each tagged with its job: a filter such as &lt;code&gt;= &amp;#39;USD&amp;#39;&lt;/code&gt; on &lt;code&gt;currency&lt;/code&gt;, &lt;code&gt;join&lt;/code&gt;, &lt;code&gt;group&lt;/code&gt;. &lt;code&gt;Returns&lt;/code&gt; says how each column is made: &lt;code&gt;plan&lt;/code&gt; &lt;code&gt;as is&lt;/code&gt;, &lt;code&gt;gross_cents&lt;/code&gt; a &lt;code&gt;sum&lt;/code&gt;, &lt;code&gt;net_cents&lt;/code&gt; computed from two other outputs.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Used by&lt;/code&gt; is the part to read before you change anything. Here it lists &lt;code&gt;billing.revenue_dashboard&lt;/code&gt;, a view that reads all 5 columns, and &lt;code&gt;billing.export_revenue()&lt;/code&gt;, a function drawn dashed because Postgres doesn&amp;#39;t record it and Seqora found it by searching the function&amp;#39;s code. The note under them is the consequence: changing a source column&amp;#39;s type is blocked while this view exists, and dropping it breaks both dependents.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;DROP VIEW&lt;/code&gt; refuses without &lt;code&gt;CASCADE&lt;/code&gt;, and &lt;code&gt;CASCADE&lt;/code&gt; drops the dependents too. &lt;code&gt;CREATE OR REPLACE VIEW&lt;/code&gt; can add columns at the end but can&amp;#39;t rename, remove or retype one, so a change to &lt;code&gt;month&lt;/code&gt; means recreating this view and every view above it, in order. The dashed function has no such protection: drop the view and &lt;code&gt;export_revenue()&lt;/code&gt; fails the next time it runs.&lt;/p&gt;
&lt;h2 id=&quot;query-shape&quot;&gt;Query shape&lt;a class=&quot;guide-anchor&quot; href=&quot;#query-shape&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The query as a row of steps: &lt;code&gt;invoices&lt;/code&gt;, &lt;code&gt;join accounts&lt;/code&gt;, &lt;code&gt;left join payments&lt;/code&gt; drawn dashed because it is outer, &lt;code&gt;where currency = &amp;#39;USD&amp;#39;&lt;/code&gt;, &lt;code&gt;group by month, plan&lt;/code&gt;. Under the steps, whether you can write through the view: &lt;code&gt;Grouping makes it read-only: you can&amp;#39;t insert or update through it.&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Beside it, the security verdict. A view runs with its owner&amp;#39;s permissions unless you say otherwise. Here &lt;code&gt;invoices&lt;/code&gt; has row security, and everyone who can read the view sees every row &lt;code&gt;reporting_owner&lt;/code&gt; can, so the policy is bypassed. The panel says so, &lt;code&gt;Runs with the owner&amp;#39;s permissions&lt;/code&gt;, and &lt;code&gt;Open the security_invoker fix in a SQL editor&lt;/code&gt; opens the fix:&lt;/p&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-key&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;VIEW&lt;/span&gt; billing.monthly_revenue &lt;span class=&quot;tok-key&quot;&gt;SET&lt;/span&gt; (security_invoker = &lt;span class=&quot;tok-key&quot;&gt;on&lt;/span&gt;);&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;security_invoker&lt;/code&gt; makes the view run as whoever reads it, with their grants and their row security. It needs PostgreSQL 15 or later. &lt;code&gt;Access&lt;/code&gt;, &lt;code&gt;All properties&lt;/code&gt; and &lt;code&gt;DDL&lt;/code&gt; fold out below, and &lt;code&gt;DDL&lt;/code&gt; on a plain view has &lt;code&gt;Open CREATE OR REPLACE in a SQL editor&lt;/code&gt;.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Dashed dependents come from searching function bodies in this database. Application code is never searched, so an empty &lt;code&gt;Used by&lt;/code&gt; doesn&amp;#39;t mean unused.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Compare with live data&lt;/code&gt; is a real query against the source tables, and it gives up after 12 seconds. Volatile functions such as &lt;code&gt;now()&lt;/code&gt; always differ.&lt;/li&gt;
&lt;li&gt;MySQL and MariaDB have no materialized views, and their views carry a &lt;code&gt;DEFINER&lt;/code&gt; and &lt;code&gt;SQL SECURITY&lt;/code&gt; instead of &lt;code&gt;security_invoker&lt;/code&gt;. On SQL Server the summary reads &lt;code&gt;Readers need only SELECT on it while its owner also owns what it reads.&lt;/code&gt;, because of ownership chaining. SQLite records no dependencies, so lineage there is read from the SQL text.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;Postgres does not store when a materialized view was last refreshed, and I looked for a long time before accepting that. So the page watches instead, and where it saw nothing it says &lt;code&gt;unknown&lt;/code&gt;, because a guessed timestamp is worse than none.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
</content>
  </entry>
  <entry>
    <title>Keyboard and the command palette</title>
    <link href="https://seqora.dev/guide/keyboard-and-the-command-palette/" />
    <id>https://seqora.dev/guide/keyboard-and-the-command-palette/</id>
    <published>2026-10-18T00:00:00Z</published>
    <updated>2026-10-18T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Reach every command from the palette, learn the default shortcuts on macOS and Windows, and remap the ones you want.</summary>
    <content type="html">&lt;p&gt;Read this if you&amp;#39;d rather keep your hands on the keyboard, or a shortcut did something you
didn&amp;#39;t expect. Every command in Seqora is in the palette, and the ones you use every few minutes
have a key.&lt;/p&gt;
&lt;h2 id=&quot;use-the-palette&quot;&gt;Use the palette&lt;a class=&quot;guide-anchor&quot; href=&quot;#use-the-palette&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Press &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;P&lt;/kbd&gt;&lt;/kbd&gt; on macOS or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;P&lt;/kbd&gt;&lt;/kbd&gt; on Windows. The title bar&amp;#39;s &lt;code&gt;Command palette&lt;/code&gt; button
does the same.&lt;/li&gt;
&lt;li&gt;Type a few letters of what you want, for example &lt;code&gt;diagram&lt;/code&gt; or &lt;code&gt;timeout&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Press &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt; on the highlighted entry.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The box reads &amp;quot;Search commands, tables, connections, and queries&amp;quot;, and it means settings too. Commands cover editors, tables,
diagrams, panes, connections, workspaces, the terminal, updates and feedback, and each shows its
shortcut. Settings are searchable too: type &lt;code&gt;rows kept&lt;/code&gt; and &lt;code&gt;Rows kept per result&lt;/code&gt; comes up
without opening Settings. &lt;code&gt;Change a setting…&lt;/code&gt; browses them all.&lt;/p&gt;
&lt;p&gt;Once you type, the palette also searches the database. &lt;code&gt;orders&lt;/code&gt; finds &lt;code&gt;commerce.orders&lt;/code&gt; and
every view, function, sequence or type with a page of its own, along with connections and the
saved queries in your SQL library. &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt; opens the table. &lt;code&gt;→&lt;/code&gt; shows its other actions:
&lt;code&gt;Open in split&lt;/code&gt;, &lt;code&gt;New query&lt;/code&gt;, &lt;code&gt;Copy name&lt;/code&gt;. &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;↩&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt; opens a result in a split
from the keyboard, and &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌥&lt;/kbd&gt;&lt;kbd&gt;C&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Alt&lt;/kbd&gt;&lt;kbd&gt;C&lt;/kbd&gt;&lt;/kbd&gt; copies its name.&lt;/p&gt;
&lt;p&gt;A prefix narrows the search to one kind: &lt;code&gt;&amp;gt;&lt;/code&gt; commands and settings, &lt;code&gt;#&lt;/code&gt; tables and objects,
&lt;code&gt;@&lt;/code&gt; connections, &lt;code&gt;/&lt;/code&gt; saved queries.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/palette-orders.webp?v=f2af447f79&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/palette-orders-800.webp?v=c240a074c7&quot; srcset=&quot;/guide/shots/palette-orders-800.webp?v=c240a074c7 800w, /guide/shots/palette-orders.webp?v=f2af447f79 1120w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(560px, 46rem)&quot; width=&quot;560&quot; height=&quot;313&quot; alt=&quot;The command palette with orders typed: the table orders, its sequences, order_items, and the Import data command, with shortcuts for navigating along the bottom.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;p&gt;With the box empty, &lt;code&gt;Recent&lt;/code&gt; lists the five commands you use most, and the rest follow in their
groups. Custom commands appear here too, under their own group.&lt;/p&gt;
&lt;p&gt;On macOS the same menus sit in the system menu bar, with their current chords as key
equivalents, so a remapped shortcut shows there too. Windows keeps the menus in the title bar.&lt;/p&gt;
&lt;h2 id=&quot;default-shortcuts&quot;&gt;Default shortcuts&lt;a class=&quot;guide-anchor&quot; href=&quot;#default-shortcuts&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;/kbd&gt; on macOS is &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;/kbd&gt; on Windows. The pages under Every panel write that as &lt;code&gt;Mod&lt;/code&gt;, so
&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;P&lt;/kbd&gt;&lt;/kbd&gt; is &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;P&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;P&lt;/kbd&gt;&lt;/kbd&gt;. These are the defaults, named as Settings › Keyboard lists them,
and every one in the first block can be remapped.&lt;/p&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;macOS&lt;/th&gt;
&lt;th&gt;Windows&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Open command palette&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;P&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;P&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Open settings&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;,&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;,&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Show keyboard shortcuts&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;H&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;H&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Toggle sidebar&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;B&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;B&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;New SQL editor&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;N&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;N&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Add connection…&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;N&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;N&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Open file…&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;O&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;O&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Open terminal&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;⌃&lt;/kbd&gt;&lt;kbd&gt;`&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;`&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Open table…&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;P&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;P&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Switch to tab…&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;A&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;A&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Open ER diagram…&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;E&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;E&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Focus next pane&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;F6&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;F6&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Focus previous pane&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;F6&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;F6&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Save SQL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;S&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;S&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Run selection or current statement&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;↩&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Run entire script&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;↩&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Search table data&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;F&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;F&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Watch table&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌥&lt;/kbd&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;W&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Alt&lt;/kbd&gt;&lt;kbd&gt;W&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Export rows…&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;X&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;X&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;On a Mac keyboard &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;F6&lt;/kbd&gt;&lt;/kbd&gt; needs &lt;code&gt;fn&lt;/code&gt; held, so &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌃&lt;/kbd&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;]&lt;/kbd&gt;&lt;/kbd&gt; and &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌃&lt;/kbd&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;[&lt;/kbd&gt;&lt;/kbd&gt; also move between panes.&lt;/p&gt;
&lt;p&gt;These are fixed:&lt;/p&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;macOS&lt;/th&gt;
&lt;th&gt;Windows&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Split pane right…&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;D&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;D&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Split pane down…&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;D&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;D&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Cycle tabs&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;⌃⇥&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Tab&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Go to tab 1 to 8&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;1&lt;/kbd&gt;&lt;/kbd&gt;–&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;8&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;1&lt;/kbd&gt;&lt;/kbd&gt;–&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;8&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Go to last tab&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;9&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;9&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Cancel running query&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;.&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;.&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Format SQL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;⌥&lt;/kbd&gt;&lt;kbd&gt;F&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;Alt&lt;/kbd&gt;&lt;kbd&gt;F&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Save SQL as…&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;S&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;S&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Reopen closed tab&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;T&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;T&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Close current tab&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;W&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;W&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;New SQL editor (alternate shortcut)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;⌃&lt;/kbd&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;`&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;td&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;`&lt;/kbd&gt;&lt;/kbd&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;In the data grid, &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Space&lt;/kbd&gt;&lt;/kbd&gt; opens the &lt;a href=&quot;/guide/value-inspector/&quot;&gt;value inspector&lt;/a&gt; on the selected
cell, &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;F2&lt;/kbd&gt;&lt;/kbd&gt; edits it, and &lt;code&gt;Delete&lt;/code&gt; stages a delete of the selected rows. &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;F&lt;/kbd&gt;&lt;/kbd&gt; or
&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;F&lt;/kbd&gt;&lt;/kbd&gt; is &lt;code&gt;Find in loaded rows&lt;/code&gt;, and &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;G&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;G&lt;/kbd&gt;&lt;/kbd&gt; is &lt;code&gt;Go to column&lt;/code&gt;.
&lt;code&gt;Search table data&lt;/code&gt; puts the cursor in &lt;code&gt;Filter rows&lt;/code&gt;. Shift-click a column header to add a
secondary sort, and &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;/kbd&gt;-click or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;/kbd&gt;-click a foreign key to open the row it points at.&lt;/p&gt;
&lt;p&gt;Inside the SQL editor, &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;E&lt;/kbd&gt;&lt;/kbd&gt; selects the current statement, &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;/&lt;/kbd&gt;&lt;/kbd&gt; toggles a line comment, &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;G&lt;/kbd&gt;&lt;/kbd&gt;
is &lt;code&gt;Go to line&lt;/code&gt;, &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌥&lt;/kbd&gt;&lt;kbd&gt;↑&lt;/kbd&gt;&lt;/kbd&gt; and &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌥&lt;/kbd&gt;&lt;kbd&gt;↓&lt;/kbd&gt;&lt;/kbd&gt; move a line, and &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;D&lt;/kbd&gt;&lt;/kbd&gt; is &lt;code&gt;Add cursor at next match&lt;/code&gt;. &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;/kbd&gt;
for &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;/kbd&gt; on Windows throughout. &lt;code&gt;Find and replace&lt;/code&gt; is the exception: &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌥&lt;/kbd&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;F&lt;/kbd&gt;&lt;/kbd&gt; on macOS, where &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;H&lt;/kbd&gt;&lt;/kbd&gt;
hides the app, and &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;H&lt;/kbd&gt;&lt;/kbd&gt; on Windows.&lt;/p&gt;
&lt;h2 id=&quot;see-every-shortcut&quot;&gt;See every shortcut&lt;a class=&quot;guide-anchor&quot; href=&quot;#see-every-shortcut&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Press &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;H&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;H&lt;/kbd&gt;&lt;/kbd&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;code&gt;Keyboard shortcuts&lt;/code&gt; opens with every binding in groups: &lt;code&gt;General&lt;/code&gt;, &lt;code&gt;Workspace&lt;/code&gt;,
&lt;code&gt;Command palette&lt;/code&gt;, &lt;code&gt;Data grid&lt;/code&gt;, &lt;code&gt;SQL editor&lt;/code&gt; and &lt;code&gt;ER diagram&lt;/code&gt;. Type in &lt;code&gt;Filter shortcuts&lt;/code&gt; to
find one by action or key. A shortcut you&amp;#39;ve changed is marked &lt;code&gt;Customized&lt;/code&gt;.
&lt;code&gt;Customize shortcuts…&lt;/code&gt; takes you to the place to change it.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/keyboard-shortcuts.webp?v=016370e067&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/keyboard-shortcuts-800.webp?v=775f4d6fa0&quot; srcset=&quot;/guide/shots/keyboard-shortcuts-800.webp?v=775f4d6fa0 800w, /guide/shots/keyboard-shortcuts.webp?v=016370e067 1560w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(780px, 46rem)&quot; width=&quot;780&quot; height=&quot;620&quot; alt=&quot;The Keyboard shortcuts sheet with General, Data grid, Workspace and SQL editor groups, a filter box and Customize shortcuts.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;remap-a-shortcut&quot;&gt;Remap a shortcut&lt;a class=&quot;guide-anchor&quot; href=&quot;#remap-a-shortcut&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Open Settings with &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;,&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;,&lt;/kbd&gt;&lt;/kbd&gt;, and choose &lt;code&gt;Keyboard&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Click the shortcut beside the command. It reads &lt;code&gt;Press keys…&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Press the new combination.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Esc&lt;/kbd&gt;&lt;/kbd&gt; cancels the recording. A shortcut must include &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌥&lt;/kbd&gt;&lt;/kbd&gt; on macOS, &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Alt&lt;/kbd&gt;&lt;/kbd&gt; on
Windows, so that it never swallows ordinary typing. Function keys are the exception. A plain
letter is refused with &amp;quot;Include ⌘ or ⌥ so the shortcut doesn’t interfere with typing.&amp;quot;, or
&amp;quot;Include Ctrl or Alt&amp;quot; on Windows.&lt;/p&gt;
&lt;p&gt;If the combination is taken, Seqora names the owner, for example &amp;quot;Ctrl Shift E is already used
by “Open ER diagram…”. Try another combination.&amp;quot;, and keeps listening so you can try another.&lt;/p&gt;
&lt;p&gt;Each row has &lt;code&gt;Reset to default&lt;/code&gt;. &lt;code&gt;Reset all shortcuts&lt;/code&gt; at the bottom asks &lt;code&gt;Reset all shortcuts?&lt;/code&gt;, says how many customised shortcuts go back to the platform default, and puts every
one back when you click &lt;code&gt;Reset&lt;/code&gt;.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/settings-keyboard.webp?v=2ed8863e38&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/settings-keyboard-800.webp?v=81e2de78a6&quot; srcset=&quot;/guide/shots/settings-keyboard-800.webp?v=81e2de78a6 800w, /guide/shots/settings-keyboard.webp?v=2ed8863e38 2000w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(1000px, 46rem)&quot; width=&quot;1000&quot; height=&quot;621&quot; alt=&quot;Settings open on Keyboard: a filter and a list of commands, each with its current shortcut.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;the-built-in-terminal&quot;&gt;The built-in terminal&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-built-in-terminal&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;`&lt;/kbd&gt;&lt;/kbd&gt; opens the terminal on both platforms. On macOS that is the Control key, not &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;/kbd&gt;.
The same key closes it again. The shell, font and scrollback are in Settings › &lt;code&gt;Terminal&lt;/code&gt;. More
on &lt;a href=&quot;/guide/terminal/&quot;&gt;Terminal&lt;/a&gt;.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;P&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;P&lt;/kbd&gt;&lt;/kbd&gt; opens the table picker. Seqora does not print.&lt;/li&gt;
&lt;li&gt;The surface with focus gets its keys first. Inside the SQL editor &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;D&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;D&lt;/kbd&gt;&lt;/kbd&gt; is
&lt;code&gt;Add cursor at next match&lt;/code&gt;, &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⇧&lt;/kbd&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;D&lt;/kbd&gt;&lt;/kbd&gt; duplicates the line, &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;B&lt;/kbd&gt;&lt;/kbd&gt; jumps to the matching bracket and
&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;F&lt;/kbd&gt;&lt;/kbd&gt; is the editor&amp;#39;s own find. Click outside the editor and the same keys split the pane,
toggle the sidebar and filter the grid.&lt;/li&gt;
&lt;li&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;W&lt;/kbd&gt;&lt;/kbd&gt; inside the terminal is still &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;W&lt;/kbd&gt;&lt;/kbd&gt; for the shell on Windows, and with no tab open the
key does nothing. It never quits.&lt;/li&gt;
&lt;li&gt;The fixed shortcuts can&amp;#39;t be remapped. Settings › Keyboard shows a conflict when two bindings
share a chord.&lt;/li&gt;
&lt;li&gt;On a keyboard layout where the backtick key needs a dead key, &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;`&lt;/kbd&gt;&lt;/kbd&gt; may never arrive.
Remap &lt;code&gt;Open terminal&lt;/code&gt; to something you can press.&lt;/li&gt;
&lt;li&gt;A custom command can declare its own &lt;code&gt;shortcut:&lt;/code&gt; in its YAML file.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;I let the surface with focus take its keys before the rest of the window does. In the SQL editor
&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;D&lt;/kbd&gt;&lt;/kbd&gt; adds a cursor and &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;B&lt;/kbd&gt;&lt;/kbd&gt; jumps to a bracket, and a key that also split the pane or folded the
sidebar was doing two things where you asked for one. For the same reason &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;W&lt;/kbd&gt;&lt;/kbd&gt; with no tab open
does nothing, so a third press after closing two tabs can&amp;#39;t quit the app.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
</content>
  </entry>
  <entry>
    <title>Sidebar</title>
    <link href="https://seqora.dev/guide/sidebar/" />
    <id>https://seqora.dev/guide/sidebar/</id>
    <published>2026-10-18T00:00:00Z</published>
    <updated>2026-10-18T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>The sidebar&#39;s three views, workspaces and environments, the connection menu, the explorer tree and its filter.</summary>
    <content type="html">&lt;p&gt;The sidebar holds connections, their objects, and the SQL you have saved or run. &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;B&lt;/kbd&gt;&lt;/kbd&gt; collapses it and opens it again, unless the SQL editor has focus, where &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;B&lt;/kbd&gt;&lt;/kbd&gt; is &lt;code&gt;Go to matching bracket&lt;/code&gt;. Dragging its edge past halfway to the rail collapses it too.&lt;/p&gt;
&lt;p&gt;Collapsed, it is an activity bar: &lt;code&gt;Explorer&lt;/code&gt;, &lt;code&gt;Queries&lt;/code&gt;, &lt;code&gt;History&lt;/code&gt; and &lt;code&gt;Filter explorer&lt;/code&gt; at the top, then one icon per live connection below a divider, with a dot for its state. Hovering one names the connection, environment and workspace, and right-clicking it opens the connection menu.&lt;/p&gt;
&lt;h2 id=&quot;views&quot;&gt;Views&lt;a class=&quot;guide-anchor&quot; href=&quot;#views&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Explorer&lt;/code&gt;: workspaces, connections and their objects.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Queries&lt;/code&gt;: saved &lt;code&gt;.sql&lt;/code&gt; files, with &lt;code&gt;New query&lt;/code&gt; and &lt;code&gt;Filter saved queries&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;History&lt;/code&gt;: every run, grouped by day. &lt;code&gt;All&lt;/code&gt; or &lt;code&gt;This connection&lt;/code&gt;, the &lt;code&gt;Failed&lt;/code&gt; and &lt;code&gt;Rolled back&lt;/code&gt; filters, and &lt;code&gt;Search SQL or connection&lt;/code&gt;. Selecting a run opens its SQL without running it. A run kept with its passwords taken out opens with a notice saying so, and each password reads &lt;code&gt;&amp;lt;redacted&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/history-sidebar.webp?v=aff1c9ad03&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/history-sidebar.webp?v=aff1c9ad03&quot; width=&quot;264&quot; height=&quot;560&quot; alt=&quot;The History view of the sidebar: runs from today, each with its SQL, status, time and connection, and one marked Rolled back.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;&lt;code&gt;History&lt;/code&gt;, with the &lt;code&gt;Failed&lt;/code&gt; and &lt;code&gt;Rolled back&lt;/code&gt; filters above the runs.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;workspaces-and-environments&quot;&gt;Workspaces and environments&lt;a class=&quot;guide-anchor&quot; href=&quot;#workspaces-and-environments&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;Workspaces&lt;/code&gt; heading has &lt;code&gt;Connect&lt;/code&gt;, which adds a connection, a crosshair that reveals the active table, &lt;code&gt;Collapse all&lt;/code&gt; and &lt;code&gt;Refresh connected databases&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A workspace is a named, coloured group of connections: &lt;code&gt;New workspace…&lt;/code&gt;, &lt;code&gt;Edit workspace&lt;/code&gt;, &lt;code&gt;Remove workspace…&lt;/code&gt;. Removing one that holds connections asks &lt;code&gt;Remove workspace?&lt;/code&gt;, then &lt;code&gt;Confirm removal&lt;/code&gt; with its name typed. An empty workspace asks once, with no typing.&lt;/li&gt;
&lt;li&gt;Connections sit under environments. If one of the environment&amp;#39;s words is &lt;code&gt;prod&lt;/code&gt; or &lt;code&gt;production&lt;/code&gt;, its connections open read-only by default.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;connection-menu&quot;&gt;Connection menu&lt;a class=&quot;guide-anchor&quot; href=&quot;#connection-menu&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Right-click a connection: &lt;code&gt;New SQL editor&lt;/code&gt;, then &lt;code&gt;Schema history&lt;/code&gt; and &lt;code&gt;Index advisor&lt;/code&gt; on engines that have them, &lt;code&gt;Add connection here&lt;/code&gt;, &lt;code&gt;Edit connection&lt;/code&gt;, &lt;code&gt;Duplicate connection…&lt;/code&gt;, &lt;code&gt;Refresh connection metadata&lt;/code&gt;, then &lt;code&gt;Connect&lt;/code&gt; when it is offline or &lt;code&gt;Reconnect&lt;/code&gt; and &lt;code&gt;Disconnect&lt;/code&gt; when it is not, &lt;code&gt;Unlock connection&lt;/code&gt; or &lt;code&gt;Lock connection&lt;/code&gt;, &lt;code&gt;Delete connection…&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Clicking the lock beside a connection asks &lt;code&gt;Unlock for writes?&lt;/code&gt; in a popover next to it. More in &lt;a href=&quot;/guide/connect/&quot;&gt;Connect&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;On launch and on every reconnect the tree draws the catalog it saved last time, marked &lt;code&gt;Showing the last-known catalog. Refreshing…&lt;/code&gt;, and swaps in the live one when the server answers.&lt;/p&gt;
&lt;h2 id=&quot;explorer-tree&quot;&gt;Explorer tree&lt;a class=&quot;guide-anchor&quot; href=&quot;#explorer-tree&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Under a schema: &lt;code&gt;Tables&lt;/code&gt;, &lt;code&gt;Views&lt;/code&gt;, &lt;code&gt;Materialized views&lt;/code&gt;, &lt;code&gt;Sequences&lt;/code&gt;, &lt;code&gt;Types&lt;/code&gt;, &lt;code&gt;Functions&lt;/code&gt;, &lt;code&gt;Procedures&lt;/code&gt;, then &lt;code&gt;Schema reports&lt;/code&gt; with &lt;code&gt;Columns&lt;/code&gt;, &lt;code&gt;Indexes&lt;/code&gt; and &lt;code&gt;Constraints&lt;/code&gt;. A folder of MySQL or SQLite counters reads &lt;code&gt;Auto-increment&lt;/code&gt;. &lt;code&gt;Extensions&lt;/code&gt; is listed once per connection, after the schemas. On SQL Server a schema also lists &lt;code&gt;Synonyms&lt;/code&gt;, and the database&amp;#39;s DDL triggers are listed once per connection under &lt;code&gt;Database triggers&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Under a table: &lt;code&gt;Indexes&lt;/code&gt;, &lt;code&gt;Constraints&lt;/code&gt;, &lt;code&gt;Triggers&lt;/code&gt;, &lt;code&gt;Rules&lt;/code&gt; when there are any, &lt;code&gt;Access&lt;/code&gt; except on SQLite, and &lt;code&gt;Partitions&lt;/code&gt; on partitioned tables. The caret folds the table on one click, and clicking the name opens it.&lt;/li&gt;
&lt;li&gt;Right-click a table for &lt;code&gt;Open table&lt;/code&gt;, &lt;code&gt;Open in split&lt;/code&gt;, &lt;code&gt;Watch&lt;/code&gt;, &lt;code&gt;Structure&lt;/code&gt;, &lt;code&gt;New SQL editor on table&lt;/code&gt;, &lt;code&gt;Count rows&lt;/code&gt;, &lt;code&gt;Show in ER diagram&lt;/code&gt;, &lt;code&gt;Import data…&lt;/code&gt;, &lt;code&gt;Copy name&lt;/code&gt;, &lt;code&gt;Copy CREATE TABLE&lt;/code&gt;, &lt;code&gt;Copy as&lt;/code&gt;, &lt;code&gt;Pin to Open table&lt;/code&gt;, and &lt;code&gt;Script&lt;/code&gt;, which holds &lt;code&gt;Add column&lt;/code&gt;, &lt;code&gt;Rename table&lt;/code&gt;, &lt;code&gt;Truncate&lt;/code&gt; and &lt;code&gt;Drop table&lt;/code&gt;. Right-click a schema for &lt;code&gt;Open ER diagram&lt;/code&gt;, &lt;code&gt;Database brief&lt;/code&gt;, &lt;code&gt;Watch tables&lt;/code&gt;, &lt;code&gt;Compare schema with…&lt;/code&gt;, &lt;code&gt;Schema snapshots…&lt;/code&gt;, &lt;code&gt;History&lt;/code&gt;, &lt;code&gt;Reports&lt;/code&gt;, &lt;code&gt;New SQL editor in schema&lt;/code&gt;, &lt;code&gt;Copy name&lt;/code&gt;, &lt;code&gt;Script&lt;/code&gt;, which holds &lt;code&gt;New table&lt;/code&gt; and &lt;code&gt;New schema design&lt;/code&gt;, and &lt;code&gt;Refresh catalog&lt;/code&gt;. A row that has children folds on one click and opens its page on a double click: &lt;code&gt;Indexes&lt;/code&gt;, &lt;code&gt;Constraints&lt;/code&gt; and &lt;code&gt;Triggers&lt;/code&gt; under a table.&lt;/li&gt;
&lt;li&gt;Drag a table onto a pane to open it there, or into an editor to insert its name.&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/sidebar-explorer.webp?v=ac4927fd56&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/sidebar-explorer.webp?v=ac4927fd56&quot; width=&quot;264&quot; height=&quot;688&quot; alt=&quot;The Explorer view: the Commerce workspace, the commerce-primary connection in prod with a lock, its schemas, and commerce.orders unfolded to Indexes, Constraints, Triggers and Access.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;The tree on the commerce sample, unfolded to &lt;code&gt;orders&lt;/code&gt;.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;filter&quot;&gt;Filter&lt;a class=&quot;guide-anchor&quot; href=&quot;#filter&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;Filter tables and objects&lt;/code&gt; keeps matching names and opens their parents. &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Esc&lt;/kbd&gt;&lt;/kbd&gt; clears it. &lt;code&gt;Show system objects&lt;/code&gt; in Settings adds &lt;code&gt;pg_catalog&lt;/code&gt; and &lt;code&gt;information_schema&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Read: &lt;a href=&quot;/guide/a-schema-you-did-not-write/&quot;&gt;A schema you did not write&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Tabs and panes</title>
    <link href="https://seqora.dev/guide/tabs-and-panes/" />
    <id>https://seqora.dev/guide/tabs-and-panes/</id>
    <published>2026-10-18T00:00:00Z</published>
    <updated>2026-10-18T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>The tab strip, tab groups and their menu, splitting a pane right or down, reopening closed tabs, and what happens when you quit.</summary>
    <content type="html">&lt;p&gt;Every table, editor, diagram and object page opens as a tab in a strip above its pane.&lt;/p&gt;
&lt;h2 id=&quot;tab-strip&quot;&gt;Tab strip&lt;a class=&quot;guide-anchor&quot; href=&quot;#tab-strip&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Drag a tab along the strip to reorder it. A middle click closes it.&lt;/li&gt;
&lt;li&gt;A dot in the environment&amp;#39;s colour before a tab&amp;#39;s name marks the connection it runs on, and hovering the tab names it, such as &lt;code&gt;commerce-primary (prod)&lt;/code&gt;. An import into a production connection carries &lt;code&gt;PROD&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A dot on a tab marks staged table edits that are not applied yet (&lt;code&gt;Unsaved table edits&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Double-click an SQL editor&amp;#39;s tab, or pick &lt;code&gt;Rename&lt;/code&gt; from its menu, to rename it.&lt;/li&gt;
&lt;li&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;W&lt;/kbd&gt;&lt;/kbd&gt; closes the current tab, and does nothing when no tab is open. &lt;code&gt;Reopen closed tab&lt;/code&gt; (&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;T&lt;/kbd&gt;&lt;/kbd&gt;) brings the last one back, up to the 10 set by &lt;code&gt;Remember closed tabs&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Tab&lt;/kbd&gt;&lt;/kbd&gt; and &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;Tab&lt;/kbd&gt;&lt;/kbd&gt; cycle through the tabs, from inside the SQL editor too.&lt;/li&gt;
&lt;li&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;1&lt;/kbd&gt;&lt;/kbd&gt; to &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;8&lt;/kbd&gt;&lt;/kbd&gt; jump to that tab, counting along the strip and skipping collapsed groups. &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;9&lt;/kbd&gt;&lt;/kbd&gt; jumps to the last tab. Inside the terminal the keys stay with the shell.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Switch to tab…&lt;/code&gt; (&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;A&lt;/kbd&gt;&lt;/kbd&gt;) lists the open tabs. When the strip overflows, a button at its end with the tab count opens the same list.&lt;/li&gt;
&lt;li&gt;New tabs open &lt;code&gt;After the current tab&lt;/code&gt; or &lt;code&gt;At the end of the group&lt;/code&gt;, set by &lt;code&gt;Open new tabs&lt;/code&gt; in Settings, &lt;code&gt;General&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;tab-groups&quot;&gt;Tab groups&lt;a class=&quot;guide-anchor&quot; href=&quot;#tab-groups&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Right-click a tab:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;New group&lt;/code&gt;, or &lt;code&gt;Group selected tabs&lt;/code&gt; when several are selected.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Move to group&lt;/code&gt;, &lt;code&gt;Remove from group&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Close tab&lt;/code&gt;, or &lt;code&gt;Close selected tabs&lt;/code&gt; with several selected, &lt;code&gt;Close tabs to the left&lt;/code&gt;, &lt;code&gt;Close tabs to the right&lt;/code&gt;, &lt;code&gt;Close other tabs&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Right-click a group&amp;#39;s label:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Rename&lt;/code&gt;, &lt;code&gt;Change color&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Collapse group&lt;/code&gt; folds its tabs into the label, &lt;code&gt;Expand group&lt;/code&gt; shows them.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Ungroup&lt;/code&gt; keeps the tabs, &lt;code&gt;Close group&lt;/code&gt; closes them.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;panes&quot;&gt;Panes&lt;a class=&quot;guide-anchor&quot; href=&quot;#panes&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Split pane right…&lt;/code&gt; (&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;D&lt;/kbd&gt;&lt;/kbd&gt;) and &lt;code&gt;Split pane down…&lt;/code&gt; (&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;D&lt;/kbd&gt;&lt;/kbd&gt;) open a second pane. These two shortcuts cannot be remapped. With the cursor in the SQL editor the same keys belong to the editor, so click the tab strip or use the palette.&lt;/li&gt;
&lt;li&gt;Drag a tab onto the edge of a pane to split there (&lt;code&gt;Drop to split&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Drag the divider between panes to resize them.&lt;/li&gt;
&lt;li&gt;&lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;F6&lt;/kbd&gt;&lt;/kbd&gt; and &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;F6&lt;/kbd&gt;&lt;/kbd&gt; move focus to the next and previous pane.&lt;/li&gt;
&lt;li&gt;Closing an editor pane inside a split with unsaved SQL, a running query or an open transaction asks the same questions as closing its tab.&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/tabs-split.webp?v=ecaeeaf515&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/tabs-split-800.webp?v=3314ff53c9&quot; srcset=&quot;/guide/shots/tabs-split-800.webp?v=3314ff53c9 800w, /guide/shots/tabs-split.webp?v=ecaeeaf515 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;582&quot; alt=&quot;Two panes side by side, stores on the left and orders on the right, with customers in a tab group in the strip above.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;A tab group in the strip, and &lt;code&gt;stores&lt;/code&gt; and &lt;code&gt;orders&lt;/code&gt; split into two panes.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;restore-and-quit&quot;&gt;Restore and quit&lt;a class=&quot;guide-anchor&quot; href=&quot;#restore-and-quit&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Restore open tabs and panel layout&lt;/code&gt;, on by default, reopens your tabs and splits at the next launch: editors, tables, ER diagrams, designs, object pages, and the result pane beside an editor without its rows. Each loads when first shown. A tab whose connection, design or object is gone says so and offers &lt;code&gt;Close tab&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;On quit, staged table edits open their review first. An editor with a running query or open transaction offers &lt;code&gt;Cancel query and quit&lt;/code&gt; or &lt;code&gt;Roll back and quit&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Quit Seqora?&lt;/code&gt; then lists editors whose SQL is not in a file, with &lt;code&gt;Cancel&lt;/code&gt; and &lt;code&gt;Quit anyway&lt;/code&gt;, while &lt;code&gt;Confirm before quitting with running work&lt;/code&gt; is on. An empty Untitled editor, or one that still holds only its starting text, does not count. A query still running with no editor open is listed whatever the setting says.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Read: &lt;a href=&quot;/guide/keyboard-and-the-command-palette/&quot;&gt;Keyboard and the command palette&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Connection dialog</title>
    <link href="https://seqora.dev/guide/connection-dialog/" />
    <id>https://seqora.dev/guide/connection-dialog/</id>
    <published>2026-10-18T00:00:00Z</published>
    <updated>2026-10-18T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Every field, chip and switch in the two steps of adding a connection, with the text each one shows.</summary>
    <content type="html">&lt;p&gt;&lt;code&gt;Add connection…&lt;/code&gt; (&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;N&lt;/kbd&gt;&lt;/kbd&gt;) opens it. Step one reaches the server, step two files the connection.&lt;/p&gt;
&lt;h2 id=&quot;step-one-connect-a-database&quot;&gt;Step one: Connect a database&lt;a class=&quot;guide-anchor&quot; href=&quot;#step-one-connect-a-database&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Engine: &lt;code&gt;PostgreSQL&lt;/code&gt;, &lt;code&gt;MySQL&lt;/code&gt;, &lt;code&gt;MariaDB&lt;/code&gt;, &lt;code&gt;SQLite&lt;/code&gt;, &lt;code&gt;SQL Server&lt;/code&gt;, or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Alt&lt;/kbd&gt;&lt;kbd&gt;1&lt;/kbd&gt;&lt;/kbd&gt; to &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Alt&lt;/kbd&gt;&lt;kbd&gt;5&lt;/kbd&gt;&lt;/kbd&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Connection URL on your clipboard&lt;/code&gt; offers a copied URL. &lt;code&gt;Use it&lt;/code&gt; fills the form.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Restored what you typed before closing&lt;/code&gt; brings back a form you closed without connecting, kept for the session only. &lt;code&gt;Start over&lt;/code&gt; clears it.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Connection URL&lt;/code&gt; fills the fields below. A password in it moves to &lt;code&gt;Password&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Host&lt;/code&gt;, &lt;code&gt;Port&lt;/code&gt;, &lt;code&gt;Username&lt;/code&gt;, &lt;code&gt;Password&lt;/code&gt; (&lt;code&gt;Optional&lt;/code&gt;), &lt;code&gt;Database&lt;/code&gt;: &lt;code&gt;Optional&lt;/code&gt; on MySQL and MariaDB, &lt;code&gt;Required&lt;/code&gt; on SQL Server.&lt;/li&gt;
&lt;li&gt;SQL Server adds &lt;code&gt;Instance&lt;/code&gt; (&lt;code&gt;Optional&lt;/code&gt;), such as &lt;code&gt;SQLEXPRESS&lt;/code&gt;, and &lt;code&gt;Sign in with&lt;/code&gt;: &lt;code&gt;SQL login&lt;/code&gt;, &lt;code&gt;Entra token&lt;/code&gt;, where &lt;code&gt;Password&lt;/code&gt; becomes &lt;code&gt;Access token&lt;/code&gt;, or &lt;code&gt;Windows&lt;/code&gt;, which signs in as your Windows account and saves no password. Away from Windows, &lt;code&gt;Windows&lt;/code&gt; is greyed out with the reason.&lt;/li&gt;
&lt;li&gt;SQLite shows &lt;code&gt;Database file&lt;/code&gt; and &lt;code&gt;Browse…&lt;/code&gt; instead: &amp;quot;A local .db, .sqlite, or .sqlite3 file. Seqora stores only its path.&amp;quot;&lt;/li&gt;
&lt;li&gt;Opened from a &lt;code&gt;seqora://connect&lt;/code&gt; link, the form carries the banner &lt;code&gt;From a link. Check it before you connect.&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/connect-step-one.webp?v=768f9a159f&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/connect-step-one-800.webp?v=04a9419fa6&quot; srcset=&quot;/guide/shots/connect-step-one-800.webp?v=04a9419fa6 800w, /guide/shots/connect-step-one.webp?v=768f9a159f 1200w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(600px, 46rem)&quot; width=&quot;600&quot; height=&quot;520&quot; alt=&quot;The Connect a database dialog with PostgreSQL chosen, a connection URL, host, port, username, password and database, and the TLS, SSH and timeout chips.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;p&gt;On server engines, three chips open panels:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;TLS, labelled with the current mode:&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Prefer&lt;/code&gt; (&lt;code&gt;TLS if available&lt;/code&gt;): &amp;quot;Uses TLS when the server offers it.&amp;quot;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Require&lt;/code&gt; (&lt;code&gt;TLS required&lt;/code&gt;): &amp;quot;Refuses to connect without TLS.&amp;quot;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Verify&lt;/code&gt; (&lt;code&gt;TLS verified&lt;/code&gt;): &amp;quot;Requires TLS and checks the certificate and hostname.&amp;quot;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Off&lt;/code&gt; (&lt;code&gt;TLS off&lt;/code&gt;): &amp;quot;Sends traffic unencrypted. Use only on trusted networks.&amp;quot;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Strict&lt;/code&gt; (&lt;code&gt;TDS 8.0 strict&lt;/code&gt;), SQL Server only: TLS before any SQL Server traffic, certificate always checked. Needs SQL Server 2022 or Azure SQL.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;No SSH tunnel&lt;/code&gt;, &lt;code&gt;SSH via &amp;lt;host&amp;gt;&lt;/code&gt; once set: the &lt;code&gt;Connect through an SSH tunnel&lt;/code&gt; switch, hosts &lt;code&gt;From ~/.ssh/config&lt;/code&gt;, &lt;code&gt;SSH host&lt;/code&gt;, &lt;code&gt;Port&lt;/code&gt;, &lt;code&gt;SSH username&lt;/code&gt;, then &lt;code&gt;Sign in with&lt;/code&gt;: &lt;code&gt;Private key&lt;/code&gt; (&lt;code&gt;~/.ssh/id_ed25519&lt;/code&gt;, with an optional &lt;code&gt;Passphrase&lt;/code&gt;), &lt;code&gt;Password&lt;/code&gt; (&lt;code&gt;SSH password&lt;/code&gt;) or &lt;code&gt;SSH agent&lt;/code&gt;. Secrets read &lt;code&gt;Stored encrypted on this computer&lt;/code&gt;. An unknown server stops at &lt;code&gt;Trust this SSH server?&lt;/code&gt; with its fingerprint, &lt;code&gt;Trust and connect&lt;/code&gt; and &lt;code&gt;Cancel&lt;/code&gt;. A changed key offers &lt;code&gt;Forget the saved host key&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;10s timeout&lt;/code&gt;: &lt;code&gt;Connection timeout&lt;/code&gt;, from the setting of that name.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;Connect&lt;/code&gt; (&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt;) is the test: there is no separate button. A wrong field is marked with &lt;code&gt;Seqora couldn’t connect.&lt;/code&gt; Other failures name the engine and may offer &lt;code&gt;Retry with a 30s timeout&lt;/code&gt;, &lt;code&gt;Retry without certificate verification&lt;/code&gt;, &lt;code&gt;Retry with TLS only if available&lt;/code&gt; or &lt;code&gt;Retry without TDS 8.0 strict&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Import connections…&lt;/code&gt; in the footer reads &lt;code&gt;.pgpass&lt;/code&gt;, &lt;code&gt;pg_service.conf&lt;/code&gt;, &lt;code&gt;.my.cnf&lt;/code&gt;, a &lt;code&gt;.env&lt;/code&gt; file, DBeaver, DataGrip, TablePlus, Azure Data Studio and SQL Server Management Studio (on Windows). Pick a &lt;code&gt;Save to&lt;/code&gt; workspace and environment, tick the connections, and &lt;code&gt;Import N connections&lt;/code&gt;. They start offline and locked.&lt;/p&gt;
&lt;h2 id=&quot;step-two-save-connection&quot;&gt;Step two: Save connection&lt;a class=&quot;guide-anchor&quot; href=&quot;#step-two-save-connection&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;A summary of engine, server version and connect time. &lt;code&gt;Edit details&lt;/code&gt; goes back. A MySQL connection that reached a MariaDB server says &lt;code&gt;This server is MariaDB.&lt;/code&gt; with &lt;code&gt;Use the MariaDB engine&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Name&lt;/code&gt;: left empty, it is the database name, or the file name on SQLite.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Database&lt;/code&gt;: the server&amp;#39;s databases, when it has several.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Workspace&lt;/code&gt;, &lt;code&gt;Environment&lt;/code&gt;: choose, or type a new name. &lt;code&gt;Environment&lt;/code&gt; suggests &lt;code&gt;Development&lt;/code&gt;, &lt;code&gt;Staging&lt;/code&gt; and &lt;code&gt;Production&lt;/code&gt;. A server on this computer starts in &lt;code&gt;Development&lt;/code&gt;. A remote one starts with none: &amp;quot;This host is not on this computer. Choose its environment so production is never filed under Development.&amp;quot; A host or name that mentions production offers &lt;code&gt;Use Production&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;New workspace color&lt;/code&gt;: for a new workspace.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Open read-only&lt;/code&gt;: &amp;quot;Blocks writes until you unlock it from the explorer.&amp;quot; For production it starts on: &amp;quot;On by default for production. Unlock from the explorer when you need to write.&amp;quot;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Back&lt;/code&gt;, &lt;code&gt;Save connection&lt;/code&gt; (&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/connect-step-two.webp?v=d0c0d92b87&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/connect-step-two-800.webp?v=2352a5ec1a&quot; srcset=&quot;/guide/shots/connect-step-two-800.webp?v=2352a5ec1a 800w, /guide/shots/connect-step-two.webp?v=d0c0d92b87 1200w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(600px, 46rem)&quot; width=&quot;600&quot; height=&quot;568&quot; alt=&quot;The Save connection dialog with the connection summary, Name, Database, Workspace, Environment, New workspace color and Open read-only.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;p&gt;Read: &lt;a href=&quot;/guide/connect/&quot;&gt;Connect&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Data grid</title>
    <link href="https://seqora.dev/guide/data-grid/" />
    <id>https://seqora.dev/guide/data-grid/</id>
    <published>2026-10-18T00:00:00Z</published>
    <updated>2026-10-18T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>The table grid&#39;s toolbar, the Filter rows syntax, sorting, columns, saved views, paging, Count and the Pending changes bar.</summary>
    <content type="html">&lt;p&gt;A table tab shows its rows in the grid. Views, materialized views and partitions open in it too: partitions can be edited, views can&amp;#39;t, with &amp;quot;Views are read-only here. Change rows in the tables the view reads from.&amp;quot; A query result uses the same grid, read-only. PostGIS and SQL Server geometry and geography cells show a small shape with its kind and vertex count, or the coordinates of a point.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/data-grid-orders.webp?v=569c21ef1d&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/data-grid-orders-800.webp?v=2403ef810e&quot; srcset=&quot;/guide/shots/data-grid-orders-800.webp?v=2403ef810e 800w, /guide/shots/data-grid-orders.webp?v=569c21ef1d 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;622&quot; alt=&quot;The commerce.orders table in the grid, filtered to refunded orders of 100,000 cents or more and sorted by placed_at, newest first, with the toolbar above and the status bar below.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;&lt;code&gt;Filter rows&lt;/code&gt; holds &lt;code&gt;total_cents &amp;gt;= 100000 &amp;amp;&amp;amp; status = &amp;quot;refunded&amp;quot;&lt;/code&gt;, and the arrow on &lt;code&gt;placed_at&lt;/code&gt; marks the sort.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;toolbar&quot;&gt;Toolbar&lt;a class=&quot;guide-anchor&quot; href=&quot;#toolbar&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Add row&lt;/code&gt;: stages a new row.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Columns&lt;/code&gt;: show, hide and reorder columns. &lt;code&gt;Reset layout&lt;/code&gt; undoes it.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Refresh&lt;/code&gt;, and beside it a menu with &lt;code&gt;Watch&lt;/code&gt; (&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;Alt&lt;/kbd&gt;&lt;kbd&gt;W&lt;/kbd&gt;&lt;/kbd&gt;) every 1 to 10 seconds and &lt;code&gt;Auto-refresh&lt;/code&gt; every 5 to 60 seconds. Watching marks new and changed rows live, as &lt;a href=&quot;/guide/watch-a-table/&quot;&gt;Watch a table&lt;/a&gt; shows.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Show in ER diagram&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Export&lt;/code&gt; (&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;X&lt;/kbd&gt;&lt;/kbd&gt;) opens the export panel: &lt;code&gt;Loaded&lt;/code&gt; rows or &lt;code&gt;All rows&lt;/code&gt;, in CSV, TSV, JSON, JSONL, SQL, XLSX, Parquet or Markdown.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;More actions&lt;/code&gt;: &lt;code&gt;Find in loaded rows&lt;/code&gt; (&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;F&lt;/kbd&gt;&lt;/kbd&gt;), &lt;code&gt;Go to column&lt;/code&gt; (&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;G&lt;/kbd&gt;&lt;/kbd&gt;), &lt;code&gt;Explore relationships&lt;/code&gt; with a row selected, &lt;code&gt;Copy as…&lt;/code&gt; with cells selected, &lt;code&gt;Export rows…&lt;/code&gt;, &lt;code&gt;Import data…&lt;/code&gt; and &lt;code&gt;Open as SQL&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;filter-rows&quot;&gt;Filter rows&lt;a class=&quot;guide-anchor&quot; href=&quot;#filter-rows&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;Filter rows&lt;/code&gt; (&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;F&lt;/kbd&gt;&lt;/kbd&gt;, &lt;code&gt;Search table data&lt;/code&gt;) filters on the server. The &lt;code&gt;Filter syntax&lt;/code&gt; popover lists:&lt;/p&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Write&lt;/th&gt;
&lt;th&gt;Means&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;&lt;code&gt;= != &amp;gt; &amp;gt;= &amp;lt; &amp;lt;=&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Compare: &lt;code&gt;total &amp;gt;= 100&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;~ !~&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Contains, ignoring case: &lt;code&gt;email ~ &amp;quot;acme&amp;quot;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;like ilike&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Pattern with % and _: &lt;code&gt;name like &amp;quot;A%&amp;quot;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;in (…)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Any of: &lt;code&gt;status in (&amp;quot;active&amp;quot;, &amp;quot;trialing&amp;quot;)&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;= null&lt;/code&gt;, &lt;code&gt;!= null&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Missing values, present values&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;amp;&amp;amp; || ! ( )&lt;/code&gt;, or &lt;code&gt;and or not&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Combine conditions&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;Right-click a cell for &lt;code&gt;Filter by this value&lt;/code&gt; or &lt;code&gt;Exclude this value&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;sorting-and-columns&quot;&gt;Sorting and columns&lt;a class=&quot;guide-anchor&quot; href=&quot;#sorting-and-columns&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The sort button on a header sorts ascending, then descending, then not at all. Shift-click adds another key. A plain click on the header selects the column.&lt;/li&gt;
&lt;li&gt;Column menu: &lt;code&gt;Pin left&lt;/code&gt;, &lt;code&gt;Move left&lt;/code&gt;, &lt;code&gt;Move right&lt;/code&gt;, &lt;code&gt;Copy name&lt;/code&gt;, &lt;code&gt;Fit to content&lt;/code&gt;, &lt;code&gt;Hide&lt;/code&gt;, &lt;code&gt;Format&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Saved views&lt;/code&gt; stores the filter, sort and layout under a name (&lt;code&gt;Name this view&lt;/code&gt;), on this computer only.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;paging&quot;&gt;Paging&lt;a class=&quot;guide-anchor&quot; href=&quot;#paging&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The grid loads &lt;code&gt;Rows per table page&lt;/code&gt;, 100 by default, and fetches more as you scroll (&lt;code&gt;Loading more…&lt;/code&gt;). The status bar shows the estimated total and &lt;code&gt;Count&lt;/code&gt;, which is exact. Once the first screen of rows has scrolled away, the status bar adds &lt;code&gt;Top&lt;/code&gt;, and &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;↑&lt;/kbd&gt;&lt;/kbd&gt; or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;↑&lt;/kbd&gt;&lt;/kbd&gt; goes back to the first row. A table with no primary key and too many rows to sort warns that rows load in the server&amp;#39;s scan order, so a page can repeat or skip rows if that order changes.&lt;/p&gt;
&lt;h2 id=&quot;pending-changes&quot;&gt;Pending changes&lt;a class=&quot;guide-anchor&quot; href=&quot;#pending-changes&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Edits are staged, not written. A value that doesn&amp;#39;t fit the column&amp;#39;s type gets a red outline and a warning icon as you type. &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt; and &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Tab&lt;/kbd&gt;&lt;/kbd&gt; stop there and say what the type expects, and clicking another cell drops the edit. The pending-changes bar (&amp;quot;Kept in this window until you apply them&amp;quot;) lists each with &lt;code&gt;Revert this change&lt;/code&gt;. &lt;code&gt;Discard&lt;/code&gt; drops them all, after asking. &lt;code&gt;Review&lt;/code&gt; (&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;S&lt;/kbd&gt;&lt;/kbd&gt;) opens &lt;code&gt;Review staged changes&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Read: &lt;a href=&quot;/guide/edit-data/&quot;&gt;Edit data&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>SQL editor</title>
    <link href="https://seqora.dev/guide/sql-editor/" />
    <id>https://seqora.dev/guide/sql-editor/</id>
    <published>2026-10-18T00:00:00Z</published>
    <updated>2026-10-18T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>The SQL editor&#39;s buttons and keys, the lock, the status footer, transaction controls, completion, saving, and what each engine refuses.</summary>
    <content type="html">&lt;p&gt;&lt;code&gt;New SQL editor&lt;/code&gt; (&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;N&lt;/kbd&gt;&lt;/kbd&gt;) opens an editor on the connection of the tab in front.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/sql-editor.webp?v=0e893088a4&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/sql-editor-800.webp?v=4057351a64&quot; srcset=&quot;/guide/shots/sql-editor-800.webp?v=4057351a64 800w, /guide/shots/sql-editor.webp?v=0e893088a4 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;253&quot; alt=&quot;A SQL editor with Run, Run all and Format, the Autocommit badge, the connection, schema and lock in its header, a seven-line query, and Completed in its footer.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;The toolbar and the transaction badge on the left, the connection, schema and lock on the right, and &lt;code&gt;Query status&lt;/code&gt; along the bottom.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;actions&quot;&gt;Actions&lt;a class=&quot;guide-anchor&quot; href=&quot;#actions&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Run&lt;/code&gt; (&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt;): the selection, or the statement under the cursor.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Run all&lt;/code&gt; (&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt;): the whole script.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Cancel run&lt;/code&gt; (&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;.&lt;/kbd&gt;&lt;/kbd&gt;, or &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Esc&lt;/kbd&gt;&lt;/kbd&gt; in the result pane) replaces &lt;code&gt;Run&lt;/code&gt; while a query runs. It reads &lt;code&gt;Cancellation requested…&lt;/code&gt;, then the footer says &lt;code&gt;Cancelled&lt;/code&gt;. It also closes an open &lt;code&gt;Review high-risk SQL&lt;/code&gt; panel.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Format&lt;/code&gt; (&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;Alt&lt;/kbd&gt;&lt;kbd&gt;F&lt;/kbd&gt;&lt;/kbd&gt;): formats the SQL.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Save SQL&lt;/code&gt; (&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;S&lt;/kbd&gt;&lt;/kbd&gt;): asks for a &lt;code&gt;File name&lt;/code&gt; the first time, and &lt;code&gt;Replace &amp;lt;file&amp;gt;?&lt;/code&gt; if that name is taken. &lt;code&gt;Save SQL as…&lt;/code&gt; (&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;S&lt;/kbd&gt;&lt;/kbd&gt;) saves a copy.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Close editor&lt;/code&gt;. With unsaved edits it asks &lt;code&gt;Save changes to &amp;lt;name&amp;gt;?&lt;/code&gt; with &lt;code&gt;Don&amp;#39;t save&lt;/code&gt; and &lt;code&gt;Save…&lt;/code&gt;, and &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Esc&lt;/kbd&gt;&lt;/kbd&gt; keeps editing. A running query asks &lt;code&gt;Query still running&lt;/code&gt; with &lt;code&gt;Cancel query and close&lt;/code&gt;, an open transaction &lt;code&gt;Transaction still open&lt;/code&gt; with &lt;code&gt;Roll back and close&lt;/code&gt;, each beside &lt;code&gt;Keep editing&lt;/code&gt;. Closing the editor&amp;#39;s pane inside a split asks the same.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The connection name in the header opens a list of connections, with &lt;code&gt;Filter connections&lt;/code&gt;, to move the editor to another one. The lock beside it reads &lt;code&gt;Locked · read-only&lt;/code&gt; or &lt;code&gt;Unlocked · writes enabled&lt;/code&gt;, and clicking it unlocks or locks the connection. When the lock refuses a run, the lock lights up and its tooltip says why.&lt;/p&gt;
&lt;h2 id=&quot;query-status&quot;&gt;Query status&lt;a class=&quot;guide-anchor&quot; href=&quot;#query-status&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The footer, &lt;code&gt;Query status&lt;/code&gt;, reads &lt;code&gt;Ready&lt;/code&gt; until a run, then the state: &lt;code&gt;Preparing&lt;/code&gt;, &lt;code&gt;Awaiting approval&lt;/code&gt;, &lt;code&gt;Running&lt;/code&gt; with a timer counting up, &lt;code&gt;Completed&lt;/code&gt;, &lt;code&gt;Failed&lt;/code&gt; or &lt;code&gt;Cancelled&lt;/code&gt;. After it: rows loaded, rows affected, the elapsed time, &lt;code&gt;N notices&lt;/code&gt;, and when the result was cut &lt;code&gt;Row limit reached · N more not kept&lt;/code&gt;, &lt;code&gt;Row limit reached · stopped on the server after N rows&lt;/code&gt;, or &lt;code&gt;Size limit reached&lt;/code&gt;, with &lt;code&gt;Change limit&lt;/code&gt; after a row limit. A failed run adds &lt;code&gt;Report this problem&lt;/code&gt;, and its error card opens in the &lt;a href=&quot;/guide/result-pane/&quot;&gt;result pane&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;transactions&quot;&gt;Transactions&lt;a class=&quot;guide-anchor&quot; href=&quot;#transactions&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The badge reads &lt;code&gt;Autocommit&lt;/code&gt;, &lt;code&gt;Manual commit&lt;/code&gt;, &lt;code&gt;Transaction open&lt;/code&gt;, &lt;code&gt;Transaction failed&lt;/code&gt;, &lt;code&gt;State unknown&lt;/code&gt;, &lt;code&gt;Connection lost&lt;/code&gt;, &lt;code&gt;Disconnected&lt;/code&gt; or &lt;code&gt;Unavailable&lt;/code&gt;. &lt;code&gt;Begin&lt;/code&gt; starts a transaction, &lt;code&gt;Commit&lt;/code&gt; ends it, &lt;code&gt;Rollback&lt;/code&gt; discards every change since &lt;code&gt;Begin&lt;/code&gt;. &lt;code&gt;Refresh transaction&lt;/code&gt; asks the server again. &lt;code&gt;Begin&lt;/code&gt; and &lt;code&gt;Commit&lt;/code&gt; are disabled while the connection is locked. &lt;code&gt;New editors start in&lt;/code&gt; in Settings picks &lt;code&gt;Autocommit&lt;/code&gt; or &lt;code&gt;Manual commit&lt;/code&gt; for new editors.&lt;/p&gt;
&lt;h2 id=&quot;completion&quot;&gt;Completion&lt;a class=&quot;guide-anchor&quot; href=&quot;#completion&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Completion offers the connection&amp;#39;s tables and columns, automatically unless &lt;code&gt;Suggest completions while typing&lt;/code&gt; is off. With &lt;code&gt;Check table and column names&lt;/code&gt; on, a table or column the connected database doesn&amp;#39;t have is underlined as you type. Snippets: &lt;code&gt;sel&lt;/code&gt;, &lt;code&gt;ins&lt;/code&gt;, &lt;code&gt;upd&lt;/code&gt;, &lt;code&gt;del&lt;/code&gt;, &lt;code&gt;join&lt;/code&gt;, &lt;code&gt;cte&lt;/code&gt;, &lt;code&gt;explain&lt;/code&gt;, &lt;code&gt;tx&lt;/code&gt;, and &lt;code&gt;fn&lt;/code&gt; on PostgreSQL only.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Statement timeout&lt;/code&gt; in Settings, off by default, stops one statement that runs longer than the limit.&lt;/p&gt;
&lt;h2 id=&quot;per-engine&quot;&gt;Per engine&lt;a class=&quot;guide-anchor&quot; href=&quot;#per-engine&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Engine&lt;/th&gt;
&lt;th&gt;The editor refuses&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;PostgreSQL&lt;/td&gt;
&lt;td&gt;Nothing extra. Each editor holds two server connections, the editor&amp;#39;s and a read-only observer.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MySQL&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SET NAMES&lt;/code&gt; and other character set changes, &lt;code&gt;RESET&lt;/code&gt;, a bare &lt;code&gt;DELIMITER&lt;/code&gt;, executable comments, a stored program with a &lt;code&gt;BEGIN … END&lt;/code&gt; body that isn&amp;#39;t wrapped in &lt;code&gt;DELIMITER $$ … $$&lt;/code&gt;, and a &lt;code&gt;SET sql_mode&lt;/code&gt; that isn&amp;#39;t the last statement.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MariaDB&lt;/td&gt;
&lt;td&gt;The same as MySQL. A script in &lt;code&gt;ORACLE&lt;/code&gt; SQL mode can&amp;#39;t be split.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SQLite&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ATTACH&lt;/code&gt; and &lt;code&gt;DETACH&lt;/code&gt;, unbound parameters, &lt;code&gt;PRAGMA&lt;/code&gt;s outside an allow-list on a locked connection.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SQL Server&lt;/td&gt;
&lt;td&gt;Nothing extra. &lt;code&gt;USE&lt;/code&gt; switches the tab&amp;#39;s own database, and the tab follows it.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;On MySQL and MariaDB, an error inside a transaction leaves the badge at &lt;code&gt;State unknown&lt;/code&gt;, which disables &lt;code&gt;Run&lt;/code&gt; and &lt;code&gt;Begin&lt;/code&gt; until &lt;code&gt;Rollback&lt;/code&gt; or &lt;code&gt;Refresh transaction&lt;/code&gt; settles it. A plain statement failing in autocommit stays &lt;code&gt;Autocommit&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Read: &lt;a href=&quot;/guide/run-cancel-and-transactions/&quot;&gt;Run, cancel, and transactions&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Object pages</title>
    <link href="https://seqora.dev/guide/object-pages/" />
    <id>https://seqora.dev/guide/object-pages/</id>
    <published>2026-10-18T00:00:00Z</published>
    <updated>2026-10-18T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>The frame every object page shares, what Free shows and Pro adds, the sections of each kind, the table and schema reports, and which engines have which.</summary>
    <content type="html">&lt;p&gt;Click an object in the explorer to open it. Index, sequence, routine, view and type pages are Pro. On Free, a click on a view opens its rows, and &lt;code&gt;Open view&lt;/code&gt; in the menu goes to the page.&lt;/p&gt;
&lt;h2 id=&quot;the-frame&quot;&gt;The frame&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-frame&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Header: &lt;code&gt;schema.name&lt;/code&gt;, kind, table link, &lt;code&gt;Copy name&lt;/code&gt;, &lt;code&gt;Refresh&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;All properties&lt;/code&gt; and &lt;code&gt;DDL&lt;/code&gt;, folded. The DDL has &lt;code&gt;Copy&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;free-and-pro&quot;&gt;Free and Pro&lt;a class=&quot;guide-anchor&quot; href=&quot;#free-and-pro&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;On Free, a Pro page shows the header, &lt;code&gt;Definition&lt;/code&gt; (the DDL) and a panel such as &lt;code&gt;Index details are part of Seqora Pro.&lt;/code&gt; The panel says what the page would show on this engine, lists its sections, and offers &lt;code&gt;Start 14-day trial&lt;/code&gt; and &lt;code&gt;Already have Pro? Enter your key&lt;/code&gt;. It shows nothing of the object beyond its DDL. Table sub-pages and schema reports are Free, and a probe on them, &lt;code&gt;Estimate bloat&lt;/code&gt; on PostgreSQL, &lt;code&gt;Check index pages&lt;/code&gt; on MySQL and MariaDB, &lt;code&gt;Measure free space&lt;/code&gt; on SQLite, carries the Pro badge.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/object-page-gate.webp?v=3ba8ee3586&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/object-page-gate-800.webp?v=96c5b07da6&quot; srcset=&quot;/guide/shots/object-page-gate-800.webp?v=96c5b07da6 800w, /guide/shots/object-page-gate.webp?v=3ba8ee3586 2000w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(1000px, 46rem)&quot; width=&quot;1000&quot; height=&quot;582&quot; alt=&quot;An index page on Free: the header and Definition, then a panel saying index details are part of Seqora Pro, its sections, and Start 14-day trial.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;The index page of &lt;code&gt;billing.invoices_customer_created_idx&lt;/code&gt; on Free.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;each-kind&quot;&gt;Each kind&lt;a class=&quot;guide-anchor&quot; href=&quot;#each-kind&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;/guide/what-an-index-page-tells-you/&quot;&gt;Index&lt;/a&gt;: &lt;code&gt;Usage&lt;/code&gt;, &lt;code&gt;Key and sample entries&lt;/code&gt;, &lt;code&gt;Queries it can answer&lt;/code&gt;, &lt;code&gt;With and without this index&lt;/code&gt;, &lt;code&gt;Where the space goes&lt;/code&gt;, &lt;code&gt;Overlapping indexes&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/guide/what-a-sequence-page-tells-you/&quot;&gt;Sequence&lt;/a&gt;: &lt;code&gt;How much is left&lt;/code&gt;, &lt;code&gt;Latest values&lt;/code&gt;, &lt;code&gt;Who takes values from it&lt;/code&gt;, &lt;code&gt;Who can use it&lt;/code&gt;, &lt;code&gt;Widening the column&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/guide/what-a-function-page-tells-you/&quot;&gt;Function or procedure&lt;/a&gt;: &lt;code&gt;How to call it&lt;/code&gt;, &lt;code&gt;Who can run it, and as whom&lt;/code&gt;, &lt;code&gt;Declared vs. body&lt;/code&gt;, &lt;code&gt;How often it runs&lt;/code&gt;, &lt;code&gt;Who uses it and what it touches&lt;/code&gt;, &lt;code&gt;Body&lt;/code&gt;, &lt;code&gt;Try it&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/guide/what-a-view-page-tells-you/&quot;&gt;View&lt;/a&gt;: &lt;code&gt;Snapshot freshness&lt;/code&gt; for a materialized view, &lt;code&gt;Lineage&lt;/code&gt; with what it reads from, returns and is used by, &lt;code&gt;Query shape&lt;/code&gt;, &lt;code&gt;Security&lt;/code&gt;. A materialized view created or refreshed &lt;code&gt;WITH NO DATA&lt;/code&gt; says so.&lt;/li&gt;
&lt;li&gt;Type: &lt;code&gt;Labels in sort order&lt;/code&gt; and &lt;code&gt;How often each label is used&lt;/code&gt; for an enum, the rules from the default down to the base type for a domain, &lt;code&gt;Fields in order&lt;/code&gt; and &lt;code&gt;A sample value&lt;/code&gt; for a composite, &lt;code&gt;Bounds&lt;/code&gt; for a range, then &lt;code&gt;What uses it&lt;/code&gt;. Extensions: installed tiles and &lt;code&gt;Available on this server, not installed&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Views, materialized views and partitions also open as rows in the &lt;a href=&quot;/guide/data-grid/&quot;&gt;data grid&lt;/a&gt;, from &lt;code&gt;Open rows&lt;/code&gt; in the explorer menu. Object tabs come back after a restart; one whose object is gone offers &lt;code&gt;Close tab&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;table-pages-and-schema-reports&quot;&gt;Table pages and schema reports&lt;a class=&quot;guide-anchor&quot; href=&quot;#table-pages-and-schema-reports&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Indexes&lt;/code&gt;: &lt;code&gt;Matrix&lt;/code&gt; or &lt;code&gt;List&lt;/code&gt;, a verdict per index.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Constraints&lt;/code&gt;: every rule, &lt;code&gt;NOT VALID&lt;/code&gt; violation counts, &lt;code&gt;All constraints&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Triggers&lt;/code&gt;: each trigger with its detail and DDL.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Access&lt;/code&gt;: roles against privileges, and row-level security policies.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Partitions&lt;/code&gt;: a range timeline, list groups or hash buckets.&lt;/li&gt;
&lt;li&gt;Schema reports: &lt;code&gt;Columns&lt;/code&gt; (&lt;code&gt;All&lt;/code&gt;, &lt;code&gt;Mixed types&lt;/code&gt;, &lt;code&gt;Mostly empty&lt;/code&gt;), &lt;code&gt;Indexes&lt;/code&gt; (&lt;code&gt;Map&lt;/code&gt; or &lt;code&gt;Table&lt;/code&gt;, &lt;code&gt;Needs a look&lt;/code&gt;, &lt;code&gt;Estimate bloat&lt;/code&gt;), &lt;code&gt;Constraints&lt;/code&gt; (what points where), &lt;code&gt;Sequences&lt;/code&gt; (runway).&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/table-indexes.webp?v=dfa6dc2df2&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/table-indexes-800.webp?v=396887a2fb&quot; srcset=&quot;/guide/shots/table-indexes-800.webp?v=396887a2fb 800w, /guide/shots/table-indexes.webp?v=dfa6dc2df2 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;722&quot; alt=&quot;The Indexes page of commerce.orders in Matrix view: one row per column, one column per index, the key position of each, and No index on store_id.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;&lt;code&gt;Indexes&lt;/code&gt; on &lt;code&gt;commerce.orders&lt;/code&gt;, in &lt;code&gt;Matrix&lt;/code&gt;.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;engines&quot;&gt;Engines&lt;a class=&quot;guide-anchor&quot; href=&quot;#engines&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Page&lt;/th&gt;
&lt;th&gt;PostgreSQL&lt;/th&gt;
&lt;th&gt;MySQL, MariaDB&lt;/th&gt;
&lt;th&gt;SQLite&lt;/th&gt;
&lt;th&gt;SQL Server&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;Indexes, constraints, triggers, views, sequences, columns&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Routines, partitions, access&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Types&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Extensions&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;On SQL Server the type page covers alias types and table types, and synonyms and database-level DDL
triggers are listed in the explorer without a page of their own.&lt;/p&gt;
&lt;p&gt;Read: &lt;a href=&quot;/guide/what-does-this-table-do/&quot;&gt;What does this table do?&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Review dialogs</title>
    <link href="https://seqora.dev/guide/review-dialogs/" />
    <id>https://seqora.dev/guide/review-dialogs/</id>
    <published>2026-10-18T00:00:00Z</published>
    <updated>2026-10-18T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>The four places Seqora stops before a write: unlocking, high-risk SQL, staged row edits, and applying a schema design.</summary>
    <content type="html">&lt;p&gt;Seqora stops for review before four kinds of write.&lt;/p&gt;
&lt;h2 id=&quot;unlock-for-writes&quot;&gt;Unlock for writes?&lt;a class=&quot;guide-anchor&quot; href=&quot;#unlock-for-writes&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A popover at the lock that asked, naming the connection and environment. Outside production it reads &amp;quot;Edits, deletes, and schema changes will run on&amp;quot; the connection &amp;quot;in&amp;quot; its environment, with &lt;code&gt;Cancel&lt;/code&gt; (&lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Esc&lt;/kbd&gt;&lt;/kbd&gt;) and &lt;code&gt;Unlock&lt;/code&gt; (&lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt;). On &lt;code&gt;commerce-primary&lt;/code&gt; the title is &lt;code&gt;Unlock production for writes?&lt;/code&gt;, the text adds &amp;quot;This is live data.&amp;quot;, &lt;code&gt;Cancel&lt;/code&gt; has focus, and the button is &lt;code&gt;Unlock production&lt;/code&gt;. From a shortcut or the palette it opens at the top of the window. &lt;code&gt;Re-lock after unlocking&lt;/code&gt; in Settings locks the connection again later, and production locks again after 15 minutes even when it is &lt;code&gt;Never&lt;/code&gt;.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/review-unlock.webp?v=ec87311cf3&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/review-unlock.webp?v=ec87311cf3&quot; width=&quot;265&quot; height=&quot;143&quot; alt=&quot;The Unlock production for writes popover under the lock, naming commerce-primary in prod, with Cancel focused and a red Unlock production button.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;review-high-risk-sql&quot;&gt;Review high-risk SQL&lt;a class=&quot;guide-anchor&quot; href=&quot;#review-high-risk-sql&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A panel in the editor&amp;#39;s result pane, or under the SQL when there is no result pane, not a dialog. It opens before DDL that removes or changes something, an &lt;code&gt;UPDATE&lt;/code&gt; or &lt;code&gt;DELETE&lt;/code&gt; without a &lt;code&gt;WHERE&lt;/code&gt;, and anything Seqora cannot prove safe. A new table, view or index runs without it. It lists each statement with the reason and names the environment, connection and database. On production it asks you to type the connection&amp;#39;s name. Elsewhere a click or &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;mac&quot;&gt;&lt;kbd&gt;⌘&lt;/kbd&gt;&lt;kbd&gt;↩&lt;/kbd&gt;&lt;/kbd&gt; / &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt; confirms, as set in Settings. The box takes focus, so what you type never lands in the SQL. &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Esc&lt;/kbd&gt;&lt;/kbd&gt; or &lt;code&gt;Cancel run&lt;/code&gt; declines. &lt;a href=&quot;/guide/run-cancel-and-transactions/&quot;&gt;Run, cancel, and transactions&lt;/a&gt; has the full list.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/review-high-risk.webp?v=eb70965b4e&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/review-high-risk-800.webp?v=f70fb85f8b&quot; srcset=&quot;/guide/shots/review-high-risk-800.webp?v=f70fb85f8b 800w, /guide/shots/review-high-risk.webp?v=eb70965b4e 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;235&quot; alt=&quot;The Review high-risk SQL panel in an editor&amp;#39;s result pane: an UPDATE with no WHERE clause, the target, a box to type commerce-primary, and Confirm and run.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;On production the box asks for the connection&amp;#39;s name, and &lt;code&gt;Confirm and run&lt;/code&gt; waits for it.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;review-staged-changes&quot;&gt;Review staged changes&lt;a class=&quot;guide-anchor&quot; href=&quot;#review-staged-changes&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Opened by &lt;code&gt;Review&lt;/code&gt; on the &lt;code&gt;Pending changes&lt;/code&gt; bar. &lt;code&gt;Visual diff&lt;/code&gt; tags each row &lt;code&gt;UPDATE&lt;/code&gt;, &lt;code&gt;DELETE&lt;/code&gt; or &lt;code&gt;INSERT&lt;/code&gt; with before and after, and JSON cells as &lt;code&gt;Original JSON&lt;/code&gt; and &lt;code&gt;Proposed JSON&lt;/code&gt;. &lt;code&gt;SQL script&lt;/code&gt; shows &amp;quot;SQL for these changes, run as one transaction:&amp;quot; with &lt;code&gt;Copy SQL&lt;/code&gt;. A delete says what it cascades to (&amp;quot;Also deletes … rows from …&amp;quot;). A new row missing a required value is named, with &amp;quot;A trigger or the server supplies this value, so apply anyway&amp;quot; to go ahead. The footer reads &amp;quot;One transaction · rolls back if any row changed since it loaded&amp;quot;. &lt;code&gt;Keep editing&lt;/code&gt; (&lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Esc&lt;/kbd&gt;&lt;/kbd&gt;) or &lt;code&gt;Apply 3 changes&lt;/code&gt;. &lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt; applies, except with deletes or on production, where it takes &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;either&quot;&gt;&lt;kbd data-mod title=&quot;⌘ on macOS, Ctrl on Windows and Linux&quot;&gt;Mod&lt;/kbd&gt;&lt;kbd&gt;Enter&lt;/kbd&gt;&lt;/kbd&gt;. If a row changed on the server, nothing is applied and the cell shows &lt;code&gt;Original&lt;/code&gt;, &lt;code&gt;Server now&lt;/code&gt; and &lt;code&gt;Yours&lt;/code&gt;, with &lt;code&gt;Keep mine&lt;/code&gt; and &lt;code&gt;Take theirs&lt;/code&gt;.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/review-staged-diff.webp?v=2327d003aa&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/review-staged-diff-800.webp?v=2876c04400&quot; srcset=&quot;/guide/shots/review-staged-diff-800.webp?v=2876c04400 800w, /guide/shots/review-staged-diff.webp?v=2327d003aa 1560w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(780px, 46rem)&quot; width=&quot;780&quot; height=&quot;496&quot; alt=&quot;Review staged changes in Visual diff: two UPDATE rows and a DELETE with before and after values, a Production badge, and a red Apply 3 changes button.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;review-changes&quot;&gt;Review changes&lt;a class=&quot;guide-anchor&quot; href=&quot;#review-changes&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Opened by &lt;code&gt;Review and apply&lt;/code&gt; in a design or a compare. The eyebrow is &lt;code&gt;Review changes&lt;/code&gt;, the title the design&amp;#39;s name or the compare&amp;#39;s, such as &lt;code&gt;orders-prod ← orders-local&lt;/code&gt;. Three steps, &lt;code&gt;Checks&lt;/code&gt;, &lt;code&gt;Dry run&lt;/code&gt; and &lt;code&gt;Apply&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Checks&lt;/code&gt;: read-only probes for empty values, duplicates, orphans and dependents, plus design issues. Some need &lt;code&gt;I understand&lt;/code&gt;. &lt;code&gt;Check again&lt;/code&gt; runs them once more. &lt;code&gt;Rebase onto the live schema&lt;/code&gt; appears when &amp;quot;The live schema changed since this design started&amp;quot;. A compare offers &lt;code&gt;Compare again&lt;/code&gt; instead.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Dry run&lt;/code&gt;: PostgreSQL and SQLite run every statement in a transaction and roll back. MySQL and MariaDB replay on empty copies in a scratch database.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Apply 4 statements&lt;/code&gt;: on production, first type the database name (&amp;quot;Production · type &lt;code&gt;&amp;lt;db&amp;gt;&lt;/code&gt; to apply&amp;quot;). Seqora saves a snapshot of the target before the first statement runs. Afterwards: &lt;code&gt;Changes applied&lt;/code&gt;, &lt;code&gt;Save as .sql&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;On Free the footer reads &amp;quot;The dry run and apply are part of Pro. This design and its SQL stay saved.&amp;quot;, and the apply button carries the Pro badge.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/design-review.webp?v=e362896325&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/design-review-800.webp?v=af4f250a0d&quot; srcset=&quot;/guide/shots/design-review-800.webp?v=af4f250a0d 800w, /guide/shots/design-review.webp?v=e362896325 2000w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(1000px, 46rem)&quot; width=&quot;1000&quot; height=&quot;691&quot; alt=&quot;The Review changes panel for a design: the Checks, Dry run and Apply steps, one check passed, the SQL beside them, and Writes locked with an Unlock button.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;A design on a locked connection. The checks ran, and &lt;code&gt;Dry run&lt;/code&gt; waits for the unlock.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Read: &lt;a href=&quot;/guide/design-a-schema-change/&quot;&gt;Design a schema change&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Terminal</title>
    <link href="https://seqora.dev/guide/terminal/" />
    <id>https://seqora.dev/guide/terminal/</id>
    <published>2026-10-18T00:00:00Z</published>
    <updated>2026-10-18T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>The terminal panel inside Seqora: how to open it, which shell it runs, its settings, and why it has no link to your database.</summary>
    <content type="html">&lt;p&gt;&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;`&lt;/kbd&gt;&lt;/kbd&gt; opens the terminal panel and closes it again. It is &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;/kbd&gt; on macOS too. In the command palette the same command reads &lt;code&gt;Open terminal&lt;/code&gt; or &lt;code&gt;Close terminal&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;what-it-is-for&quot;&gt;What it is for&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-it-is-for&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A shell beside your SQL, for &lt;code&gt;psql&lt;/code&gt;, &lt;code&gt;pg_dump&lt;/code&gt;, a migration tool or &lt;code&gt;git&lt;/code&gt;, without leaving the window.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/terminal-panel.webp?v=6b84b1dade&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/terminal-panel-800.webp?v=8f90b2b6e7&quot; srcset=&quot;/guide/shots/terminal-panel-800.webp?v=8f90b2b6e7 800w, /guide/shots/terminal-panel.webp?v=6b84b1dade 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;622&quot; alt=&quot;The terminal panel open under a SQL editor, with git and node version commands run in it.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;what-it-is-not&quot;&gt;What it is not&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-it-is-not&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;It is not connected to the database. The shell starts in your home folder, or the &lt;code&gt;Start directory&lt;/code&gt; you set, with your own environment, and knows nothing about the connection open in Seqora. A &lt;code&gt;psql&lt;/code&gt; started there needs its own connection details.&lt;/p&gt;
&lt;h2 id=&quot;controls&quot;&gt;Controls&lt;a class=&quot;guide-anchor&quot; href=&quot;#controls&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Close terminal&lt;/code&gt; closes the panel and ends the shell. Opening it again starts a fresh one, which is how a new &lt;code&gt;Shell&lt;/code&gt; setting takes effect.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Resize terminal&lt;/code&gt; is the handle that resizes the panel.&lt;/li&gt;
&lt;li&gt;When the shell ends, the panel says so, for example &lt;code&gt;Shell exited with code 0.&lt;/code&gt;, and offers &lt;code&gt;Restart terminal&lt;/code&gt;. The same strip reads &lt;code&gt;Terminal could not start.&lt;/code&gt; when the shell never came up.&lt;/li&gt;
&lt;li&gt;While the terminal has focus, every key goes to the shell, &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;W&lt;/kbd&gt;&lt;/kbd&gt; included. Only &lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Ctrl&lt;/kbd&gt;&lt;kbd&gt;`&lt;/kbd&gt;&lt;/kbd&gt; reaches Seqora.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;settings&quot;&gt;Settings&lt;a class=&quot;guide-anchor&quot; href=&quot;#settings&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Settings, &lt;code&gt;Terminal&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Shell&lt;/code&gt;: &lt;code&gt;Automatic&lt;/code&gt;, which prefers PowerShell on Windows, one of the shells found on this computer, or &lt;code&gt;Custom path…&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Start directory&lt;/code&gt;: empty starts in your home folder. A leading &lt;code&gt;~&lt;/code&gt; stands for home. A relative path or a folder that doesn&amp;#39;t exist falls back to home.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Shell arguments&lt;/code&gt;: extra arguments, separated by spaces, with double quotes around one that holds a space.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Terminal font&lt;/code&gt;: a Nerd Font draws prompt glyphs correctly.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Terminal font size&lt;/code&gt;: 8 to 24 px, 10 by default.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Cursor shape&lt;/code&gt;: &lt;code&gt;Bar&lt;/code&gt;, &lt;code&gt;Block&lt;/code&gt; or &lt;code&gt;Underline&lt;/code&gt;. &lt;code&gt;Blink cursor&lt;/code&gt;, on by default.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Scrollback&lt;/code&gt;: 1,000, 10,000 or 50,000 lines, 10,000 by default.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Copy on select&lt;/code&gt;: copies selected text when you release the mouse. Off by default.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Read: &lt;a href=&quot;/guide/keyboard-and-the-command-palette/&quot;&gt;Keyboard and the command palette&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Loops</title>
    <link href="https://seqora.dev/guide/loops/" />
    <id>https://seqora.dev/guide/loops/</id>
    <published>2026-10-18T00:00:00Z</published>
    <updated>2026-10-18T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>The figure that makes every row count and time in EXPLAIN ANALYZE a per-run average, and how the Plan tab multiplies it back out.</summary>
    <content type="html">&lt;p&gt;&lt;code&gt;loops=N&lt;/code&gt; is the last figure on every node of an &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt; plan. It says how many
times the node ran. The rows and the time printed beside it are averages per run, not totals.
The sample&amp;#39;s &lt;a class=&quot;guide-term&quot; href=&quot;/guide/index-scan/&quot; data-term-icon=&quot;lightning&quot; data-term-description=&quot;How an Index Scan fetches rows, why 206,880 cheap lookups add up, and what the table&amp;#39;s physical order does to each one.&quot;&gt;&lt;code&gt;Index Scan using order_items_order_idx on order_items&lt;/code&gt;&lt;/a&gt; prints &lt;code&gt;rows=3 loops=206880&lt;/code&gt;: 3 rows each time, 206,880 times, 620,640 rows in all. &lt;code&gt;Index Scan using customers_pkey on customers&lt;/code&gt; prints &lt;code&gt;rows=1 loops=620640&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;why-it-matters&quot;&gt;Why it matters&lt;a class=&quot;guide-anchor&quot; href=&quot;#why-it-matters&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Read the rows without the loops and the plan lies to you. An index scan that returns 3 rows
sounds free. 206,880 of them cost more than the &lt;a class=&quot;guide-term&quot; href=&quot;/guide/seq-scan/&quot; data-term-icon=&quot;list-dashes&quot; data-term-description=&quot;What a Seq Scan reads, the kept-to-read ratio that tells you it is the problem, and the index that replaces it.&quot;&gt;Seq Scan&lt;/a&gt; they hang off. The node under a
&lt;a href=&quot;/guide/nested-loop/&quot;&gt;Nested Loop&lt;/a&gt; runs once per outer row, so its loop count is the outer
side&amp;#39;s row count. When the &lt;a href=&quot;/guide/estimated-rows/&quot;&gt;outer estimate&lt;/a&gt; is 338× off, the loop count is 338× off with it.
Under a &lt;a href=&quot;/guide/gather/&quot;&gt;Gather&lt;/a&gt;, loops is the number of processes.&lt;/p&gt;
&lt;h2 id=&quot;what-to-do&quot;&gt;What to do&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-do&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Multiply before judging: rows × loops, time × loops.&lt;/li&gt;
&lt;li&gt;If the loop count is far above the planner&amp;#39;s estimate for the outer side, fix that
estimate first. &lt;code&gt;ANALYZE commerce.orders&lt;/code&gt; takes the sample from 206,880 loops to one
&lt;a href=&quot;/guide/hash-join/&quot;&gt;Hash Join&lt;/a&gt; pass.&lt;/li&gt;
&lt;li&gt;If the loop count is right, make each loop cheaper: an index that answers the lookup from
one page, or an &lt;a href=&quot;/guide/index-only-scan/&quot;&gt;Index Only Scan&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;in-the-plan-tab&quot;&gt;In the Plan tab&lt;a class=&quot;guide-anchor&quot; href=&quot;#in-the-plan-tab&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;a href=&quot;/guide/plan-tab/&quot;&gt;Plan tab&lt;/a&gt; multiplies for you. Every band is rows × loops, and the loop
count sits under the band as &lt;code&gt;↻ ×N&lt;/code&gt;, with the planner&amp;#39;s loops after a &lt;code&gt;┅&lt;/code&gt; while the header&amp;#39;s
&lt;code&gt;Estimates&lt;/code&gt; toggle is on. Marker 4 is the one this page is about.&lt;/p&gt;
&lt;figure class=&quot;guide-figure&quot;&gt;
&lt;div class=&quot;guide-figure-stage frame&quot; data-island=&quot;plan-flow&quot;&gt;
&lt;div class=&quot;app-surface&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The row flow of the sample, with the loop label under the order_items scan.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;figcaption&gt;
&lt;p&gt;The row flow of the sample, with the loop label under the &lt;code&gt;order_items&lt;/code&gt; scan.&lt;/p&gt;
&lt;ol class=&quot;guide-legend&quot;&gt;
&lt;li&gt;The band into &lt;code&gt;Seq Scan on orders&lt;/code&gt; is the 12,000,000 rows read in its one run. A scan that
runs once has no loop label.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;207K ┅ 612&lt;/code&gt; is the scan&amp;#39;s output, 206,880 rows, against the planner&amp;#39;s 612. Every node to
the right of it under the Nested Loop runs once per one of these rows.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;−11.8M&lt;/code&gt; is what the filter removed, in that one pass.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;↻ ×207K ┅ ×612&lt;/code&gt; under the &lt;code&gt;order_items&lt;/code&gt; scan is its loop count, 206,880 runs where the
planner budgeted for 612. The band above it is already multiplied out: 3 rows × 206,880
runs, 620,640.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;1.64 s&lt;/code&gt; is the scan&amp;#39;s self time for its one run. A looped node&amp;#39;s time is already the total
across its runs: &lt;code&gt;EXPLAIN&lt;/code&gt; reports it per loop, and Seqora multiplies it out before drawing
the node, the inspector and the time strip.&lt;/li&gt;
&lt;li&gt;The result end is 24 rows, once.&lt;/li&gt;
&lt;/ol&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The inspector splits the two back out: a &lt;code&gt;Rows per loop&lt;/code&gt; ruler, 3 against the planner&amp;#39;s 3,
&lt;code&gt;on target&lt;/code&gt;, and a &lt;code&gt;Loops&lt;/code&gt; ruler, 206,880 against 612, &lt;code&gt;338× more&lt;/code&gt;.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;PostgreSQL 17 rounds the per-loop rows to a whole number. A node that found one row in a
tenth of its loops prints &lt;code&gt;rows=0&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry>
    <title>Estimated rows</title>
    <link href="https://seqora.dev/guide/estimated-rows/" />
    <id>https://seqora.dev/guide/estimated-rows/</id>
    <published>2026-10-18T00:00:00Z</published>
    <updated>2026-10-18T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>The planner&#39;s bet against the receipt, how to find the node where an estimate first goes wrong, and the three ways to correct it.</summary>
    <content type="html">&lt;p&gt;Every node carries two row counts. &lt;code&gt;rows=612&lt;/code&gt; in the first parenthesis is the planner&amp;#39;s
estimate, made from &lt;code&gt;pg_stats&lt;/code&gt; before the query ran. &lt;code&gt;actual rows=206880&lt;/code&gt; in the second is
what happened. Every decision in the plan was based on the first. The sample&amp;#39;s &lt;a class=&quot;guide-term&quot; href=&quot;/guide/seq-scan/&quot; data-term-icon=&quot;list-dashes&quot; data-term-description=&quot;What a Seq Scan reads, the kept-to-read ratio that tells you it is the problem, and the index that replaces it.&quot;&gt;&lt;code&gt;Seq Scan on commerce.orders&lt;/code&gt;&lt;/a&gt; guessed 612 and found 206,880, 338× more, and the
&lt;a href=&quot;/guide/nested-loop/&quot;&gt;Nested Loops&lt;/a&gt; above it were chosen for 612.&lt;/p&gt;
&lt;h2 id=&quot;why-it-matters&quot;&gt;Why it matters&lt;a class=&quot;guide-anchor&quot; href=&quot;#why-it-matters&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A wrong estimate is behind most bad plans: a plan costed for 612 rows and run on 206,880 does
338× the lookups it budgeted for. Find where it starts. The join above the sample&amp;#39;s scan
expects 1,836 and produces 620,640, the same 338×, because it inherited the error. The source
is the scan. &lt;code&gt;orders&lt;/code&gt; was last analysed 41 days ago, before most of the last 30 days of rows
existed.&lt;/p&gt;
&lt;h2 id=&quot;what-to-do&quot;&gt;What to do&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-do&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;ANALYZE commerce.orders&lt;/code&gt;. The estimate corrects and the planner switches to Hash Joins.
Autovacuum analyses a table after 10% of it changes, 1,200,000 rows on &lt;code&gt;orders&lt;/code&gt;, so lower
&lt;code&gt;autovacuum_analyze_scale_factor&lt;/code&gt; on a table that keeps going stale.&lt;/li&gt;
&lt;li&gt;If the estimate is still off, the statistics are too coarse. &lt;code&gt;default_statistics_target&lt;/code&gt;
is 100 buckets per column. Raise it for the column that matters:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-key&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;TABLE&lt;/span&gt; commerce.orders &lt;span class=&quot;tok-key&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;COLUMN&lt;/span&gt; placed_at &lt;span class=&quot;tok-key&quot;&gt;SET&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;STATISTICS&lt;/span&gt; &lt;span class=&quot;tok-number&quot;&gt;1000&lt;/span&gt;;
&lt;span class=&quot;tok-key&quot;&gt;ANALYZE&lt;/span&gt; commerce.orders;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;If two filtered columns move together, &lt;code&gt;CREATE STATISTICS&lt;/code&gt; on the pair tells the planner.
&lt;a href=&quot;/guide/reading-the-stats/&quot;&gt;Reading the stats&lt;/a&gt; covers &lt;code&gt;pg_stats&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;in-the-plan-tab&quot;&gt;In the Plan tab&lt;a class=&quot;guide-anchor&quot; href=&quot;#in-the-plan-tab&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In the &lt;a href=&quot;/guide/plan-tab/&quot;&gt;Plan tab&lt;/a&gt;, an estimate-only plan labels every band &lt;code&gt;≈N&lt;/code&gt;. An analyzed
plan draws the actual band and, when the estimate is off by more than 2×, two dashed lines on it
at the planner&amp;#39;s width, on the band where the error starts. A band that only inherited the
error, or that a &lt;a href=&quot;/guide/limit/&quot;&gt;Limit&lt;/a&gt; cut short, stays solid. Past 10× the label adds the
planner&amp;#39;s figure, &lt;code&gt;┅ 612&lt;/code&gt;. Both need the header&amp;#39;s &lt;code&gt;Estimates&lt;/code&gt; toggle, which is on by default.
Marker 2 is the dashed estimate, and marker 4 is the same error one node up.&lt;/p&gt;
&lt;figure class=&quot;guide-figure&quot;&gt;
&lt;div class=&quot;guide-figure-stage frame&quot; data-island=&quot;plan-flow&quot;&gt;
&lt;div class=&quot;app-surface&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The row flow of the sample, with the dashed estimate on the output of Seq Scan on orders.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;figcaption&gt;
&lt;p&gt;The row flow of the sample, with the dashed estimate on the output of &lt;code&gt;Seq Scan on orders&lt;/code&gt;.&lt;/p&gt;
&lt;ol class=&quot;guide-legend&quot;&gt;
&lt;li&gt;The band into the scan is 12,000,000 rows read. The planner knew this one, because the
table&amp;#39;s size is in the statistics.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;207K ┅ 612&lt;/code&gt; is actual beside estimate: 206,880 rows found, 612 expected, the dashed lines
drawn inside the band at 612. The gap between the two widths is what 41 days of stale statistics looks like.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;−11.8M&lt;/code&gt; is what the filter removed. The planner expected it to remove all but 612 of the
12,000,000, which is why it priced everything downstream for 612.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;↻ ×207K ┅ ×612&lt;/code&gt; is the error inherited: the planner priced 612 index probes into
&lt;code&gt;order_items&lt;/code&gt; and got 206,880. The finding does not fire here and the band stays solid,
because the error started below.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;1.64 s&lt;/code&gt; is the scan&amp;#39;s self time. The estimate did not change this number, only every
decision above it.&lt;/li&gt;
&lt;li&gt;The result end, off to the right, is where the 24 rows leave. Nothing between it and the
scan was planned for what happened.&lt;/li&gt;
&lt;/ol&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The finding reads &lt;code&gt;Estimate off 338× · Nested Loop&lt;/code&gt;, &lt;code&gt;more rows than planned · 207K vs 612 · analyzed 41 days ago&lt;/code&gt;, with &lt;code&gt;Copy ANALYZE orders&lt;/code&gt;. It fires where the error starts, not on every node that
inherits it.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The finding needs 100 or more actual rows and a factor of 10 or more, or 5 or more when the
planner guessed low and the guess led into a &lt;a class=&quot;guide-term&quot; href=&quot;/guide/nested-loop/&quot; data-term-icon=&quot;repeat&quot; data-term-description=&quot;The join that runs its inner side once per outer row, why it was right for 612 rows and wrong for 206,880, and the one fix.&quot;&gt;Nested Loop&lt;/a&gt;. A node a &lt;code&gt;Limit&lt;/code&gt; stopped early
never gets one.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry>
    <title>Why is this query slow?</title>
    <link href="https://seqora.dev/guide/why-is-this-query-slow/" />
    <id>https://seqora.dev/guide/why-is-this-query-slow/</id>
    <published>2026-10-17T00:00:00Z</published>
    <updated>2026-10-17T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Read the Plan tab on a 4.6-second report: the row flow, where the time went, and the three things to look at first.</summary>
    <content type="html">&lt;div class=&quot;guide-gate&quot;&gt;
&lt;p&gt;Most queries never need a plan. Open one when a query that used to take a moment now takes seconds, when a page in your app got slow after a deploy, or when you added an index and want to know whether the planner uses it. This page reads one slow plan from the top down. For every mark the tab draws and why it is drawn that way, see &lt;a href=&quot;/guide/plan-tab/&quot;&gt;The Plan tab, and why it looks this way&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;the-symptom&quot;&gt;The symptom&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-symptom&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A revenue report by country, for web orders placed in the last 30 days:&lt;/p&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-key&quot;&gt;WITH&lt;/span&gt; web_orders &lt;span class=&quot;tok-key&quot;&gt;AS&lt;/span&gt; (
  &lt;span class=&quot;tok-key&quot;&gt;SELECT&lt;/span&gt; id, customer_id &lt;span class=&quot;tok-key&quot;&gt;FROM&lt;/span&gt; commerce.orders
  &lt;span class=&quot;tok-key&quot;&gt;WHERE&lt;/span&gt;  channel = &lt;span class=&quot;tok-string&quot;&gt;&amp;#39;web&amp;#39;&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;AND&lt;/span&gt; placed_at &amp;gt;= now() - &lt;span class=&quot;tok-key&quot;&gt;interval&lt;/span&gt; &lt;span class=&quot;tok-string&quot;&gt;&amp;#39;30 days&amp;#39;&lt;/span&gt;
)
&lt;span class=&quot;tok-key&quot;&gt;SELECT&lt;/span&gt; c.country,
       count(*)           &lt;span class=&quot;tok-key&quot;&gt;AS&lt;/span&gt; items,
       sum(oi.line_total) &lt;span class=&quot;tok-key&quot;&gt;AS&lt;/span&gt; revenue,
       rank() &lt;span class=&quot;tok-key&quot;&gt;OVER&lt;/span&gt; (&lt;span class=&quot;tok-key&quot;&gt;ORDER&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;BY&lt;/span&gt; sum(oi.line_total) &lt;span class=&quot;tok-key&quot;&gt;DESC&lt;/span&gt;) &lt;span class=&quot;tok-key&quot;&gt;AS&lt;/span&gt; rank
&lt;span class=&quot;tok-key&quot;&gt;FROM&lt;/span&gt;   web_orders w
&lt;span class=&quot;tok-key&quot;&gt;JOIN&lt;/span&gt;   crm.customers c         &lt;span class=&quot;tok-key&quot;&gt;ON&lt;/span&gt; c.id = w.customer_id
&lt;span class=&quot;tok-key&quot;&gt;JOIN&lt;/span&gt;   commerce.order_items oi &lt;span class=&quot;tok-key&quot;&gt;ON&lt;/span&gt; oi.order_id = w.id
&lt;span class=&quot;tok-key&quot;&gt;GROUP&lt;/span&gt;  &lt;span class=&quot;tok-key&quot;&gt;BY&lt;/span&gt; c.country
&lt;span class=&quot;tok-key&quot;&gt;ORDER&lt;/span&gt;  &lt;span class=&quot;tok-key&quot;&gt;BY&lt;/span&gt; revenue &lt;span class=&quot;tok-key&quot;&gt;DESC&lt;/span&gt;;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;It returns 24 rows and takes 4.6 seconds. &lt;code&gt;commerce.orders&lt;/code&gt; has 12,000,000 rows and two indexes that contain &lt;code&gt;placed_at&lt;/code&gt;. Nothing about the query looks wrong.&lt;/p&gt;
&lt;h2 id=&quot;what-the-plan-tab-shows&quot;&gt;What the Plan tab shows&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-the-plan-tab-shows&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Run the statement, then click &lt;code&gt;Plan&lt;/code&gt; in the &lt;code&gt;Result&lt;/code&gt;, &lt;code&gt;Chart&lt;/code&gt;, &lt;code&gt;Plan&lt;/code&gt; switch above the rows (Pro). Seqora does not read your run. It runs its own &lt;code&gt;EXPLAIN&lt;/code&gt;, estimates first, and for a read statement follows with &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt; inside a transaction it rolls back. The header says &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt;, &lt;code&gt;4.58 s exec&lt;/code&gt; and &lt;code&gt;2.4 ms plan&lt;/code&gt;, then &lt;code&gt;2 settings&lt;/code&gt;, which lists what the plan ran with: &lt;code&gt;work_mem 4MB&lt;/code&gt; and &lt;code&gt;max_parallel_workers_per_gather 0&lt;/code&gt;. The rest of the tab is five parts. This section takes them one at a time, in the order your eye meets them.&lt;/p&gt;
&lt;h3 id=&quot;the-row-flow&quot;&gt;The row flow&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;Flow&lt;/code&gt; lens draws the plan left to right, from the tables into the result. Each band is the rows leaving a node, as wide as the count across every loop, so a node that ran many times is drawn at its total. Six things on this flow matter for this query.&lt;/p&gt;
&lt;figure class=&quot;guide-figure&quot;&gt;
&lt;div class=&quot;guide-figure-stage frame&quot; data-island=&quot;plan-flow&quot;&gt;
&lt;div class=&quot;app-surface&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The row flow of the report. Rows run left to right, from the tables into the result.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;figcaption&gt;
&lt;p&gt;The row flow of the report. Rows run left to right, from the tables into the result.&lt;/p&gt;
&lt;ol class=&quot;guide-legend&quot;&gt;
&lt;li&gt;The band from the &lt;code&gt;orders&lt;/code&gt; wheel into &lt;code&gt;Seq Scan on orders&lt;/code&gt; is 12,000,000 rows wide: the scan read the whole table.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;207K ┅ 612&lt;/code&gt; is what left the scan, 206,880 rows, beside a dotted ghost drawn at the planner&amp;#39;s estimate of 612. A ghost appears when an estimate is off by more than 2×, and the planner&amp;#39;s figure joins the label past 10×. This one is off by 338×.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;−11.8M&lt;/code&gt; is the 11,793,120 rows the filter read and threw away. The scan kept 1.7% of what it read.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;↻ ×207K ┅ ×612&lt;/code&gt; under the &lt;code&gt;order_items&lt;/code&gt; scan is how many times it ran, once per order the scan kept, where the planner had budgeted for 612 runs. The band above it is already multiplied out, 620,640 rows.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;1.64 s&lt;/code&gt; on the scan&amp;#39;s bar is its self time, the node minus its inputs. This one node is 36% of the query.&lt;/li&gt;
&lt;li&gt;The result end, which the figure reaches when you scroll it right, is where the 24 rows leave the plan. Every node between it and the scan was planned for 612 rows.&lt;/li&gt;
&lt;/ol&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Read it as a story. Markers 1 and 3 say the scan read everything and kept little. Marker 2 says the planner thought it would keep almost nothing, so it chose joins that probe an index once per kept row, and marker 4 says those probes ran 206,880 times instead of 612. The seconds are in the scan, marker 5, and in the probes.&lt;/p&gt;
&lt;h3 id=&quot;the-wheel-beside-a-scan&quot;&gt;The wheel beside a scan&lt;/h3&gt;
&lt;p&gt;Every scan has a wheel on its left: the table, drawn as a ring. Double-click one in the app for the &lt;code&gt;Table wheel&lt;/code&gt; guide, which labels its parts and prints the table&amp;#39;s numbers. This is the wheel of &lt;code&gt;orders&lt;/code&gt;.&lt;/p&gt;
&lt;figure class=&quot;guide-figure&quot;&gt;
&lt;div class=&quot;guide-figure-stage frame&quot; data-island=&quot;plan-wheel&quot;&gt;
&lt;div class=&quot;app-surface&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The wheel beside Seq Scan on orders, drawn large, with the guide&amp;#39;s own labels.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;figcaption&gt;
&lt;p&gt;The wheel beside &lt;code&gt;Seq Scan on orders&lt;/code&gt;, drawn large, with the guide&amp;#39;s own labels.&lt;/p&gt;
&lt;ol class=&quot;guide-legend&quot;&gt;
&lt;li&gt;&lt;code&gt;Blue · rows kept&lt;/code&gt; is the stretch of the table where the 206,880 kept rows live, &lt;code&gt;2% of rows read&lt;/code&gt;. It is one unbroken stretch because &lt;code&gt;placed_at&lt;/code&gt; follows the order rows were written, so the last 30 days sit together.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Rim · the table&lt;/code&gt; is every page of &lt;code&gt;orders&lt;/code&gt; in physical order, &lt;code&gt;183K pages · 1.4 GB&lt;/code&gt;. The wheel is the table, not the rows the query returned.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Arrow · full scan&lt;/code&gt; means the scan swept the whole rim to reach the blue. An index on &lt;code&gt;channel, placed_at&lt;/code&gt; would enter the rim at the blue stretch and read little else.&lt;/li&gt;
&lt;/ol&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h3 id=&quot;where-the-time-went&quot;&gt;Where the time went&lt;/h3&gt;
&lt;p&gt;The strip above the canvas splits the 4,581 ms by node. Hover a segment for &lt;code&gt;Self time&lt;/code&gt;, the node minus its inputs, &lt;code&gt;Share&lt;/code&gt; and &lt;code&gt;With inputs&lt;/code&gt;.&lt;/p&gt;
&lt;figure class=&quot;guide-figure&quot;&gt;
&lt;div class=&quot;guide-figure-stage frame&quot; data-island=&quot;plan-time-strip&quot;&gt;
&lt;div class=&quot;app-surface&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The time strip of the report, one segment per node, widest first.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;figcaption&gt;
&lt;p&gt;The time strip of the report, one segment per node, widest first.&lt;/p&gt;
&lt;ol class=&quot;guide-legend&quot;&gt;
&lt;li&gt;&lt;code&gt;orders 36%&lt;/code&gt; is the Seq Scan&amp;#39;s self time, 1,640 ms. That is where the seconds are, and the first segment to look at on any plan.&lt;/li&gt;
&lt;li&gt;The total at the left is the 4.58 s every segment is a share of. A segment is self time, so the strip adds up to the total with nothing counted twice.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;Nested Loop&lt;/code&gt; segments are the two joins, about half a second between them. The scans under them, &lt;code&gt;order_items&lt;/code&gt; and &lt;code&gt;customers&lt;/code&gt;, cost 0.005 ms a run, which the strip multiplies by 206,880 and 620,640 runs into 1,034 ms and 1,241 ms.&lt;/li&gt;
&lt;/ol&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Two of the three seconds that are not the scan are those loops. The aggregate and the sort take almost nothing.&lt;/p&gt;
&lt;h3 id=&quot;findings&quot;&gt;Findings&lt;/h3&gt;
&lt;p&gt;Seqora reads the plan for the patterns worth a sentence and lists them under the canvas, with a numbered badge on the node each one sits on. Both of these sit on the scan, so the flow above shows one badge.&lt;/p&gt;
&lt;figure class=&quot;guide-figure&quot;&gt;
&lt;div class=&quot;guide-figure-stage frame&quot; data-island=&quot;plan-findings&quot;&gt;
&lt;div class=&quot;app-surface&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The findings panel for the report: two findings, both on Seq Scan on orders.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;figcaption&gt;
&lt;p&gt;The findings panel for the report: two findings, both on &lt;code&gt;Seq Scan on orders&lt;/code&gt;.&lt;/p&gt;
&lt;ol class=&quot;guide-legend&quot;&gt;
&lt;li&gt;&lt;code&gt;Seq Scan on orders&lt;/code&gt;, &lt;code&gt;keeps 2% · 36% of time&lt;/code&gt;, fires because the scan keeps less than a fifth of what it reads. &lt;code&gt;Test index&lt;/code&gt; rehearses the index it proposes without building it. On MySQL, MariaDB and SQLite the action is &lt;code&gt;Copy CREATE INDEX&lt;/code&gt; instead.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Estimate off 338× · Nested Loop&lt;/code&gt;, &lt;code&gt;more rows than planned · 207K vs 612 · analyzed 41 days ago&lt;/code&gt;, fires on the node where the error starts, not on every node that inherits it. &lt;code&gt;Copy ANALYZE orders&lt;/code&gt; copies the fix.&lt;/li&gt;
&lt;/ol&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h3 id=&quot;the-inspector&quot;&gt;The inspector&lt;/h3&gt;
&lt;p&gt;Click the scan and the inspector opens on the right. It puts the scan&amp;#39;s numbers on rulers and bars, and lists the indexes the planner could have used.&lt;/p&gt;
&lt;figure class=&quot;guide-figure&quot;&gt;
&lt;div class=&quot;guide-figure-stage frame&quot; data-island=&quot;plan-inspector&quot;&gt;
&lt;div class=&quot;app-surface&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The inspector for Seq Scan on orders, with the suggested index at the bottom of its index list.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;figcaption&gt;
&lt;p&gt;The inspector for &lt;code&gt;Seq Scan on orders&lt;/code&gt;, with the suggested index at the bottom of its index list.&lt;/p&gt;
&lt;ol class=&quot;guide-legend&quot;&gt;
&lt;li&gt;&lt;code&gt;Rows&lt;/code&gt; draws read against kept, 12,000,000 against 206,880, &lt;code&gt;2% kept&lt;/code&gt;. The scan did 98% of its reading for nothing.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Rows per loop&lt;/code&gt; puts the 206,880 rows found against the 612 the planner expected on one ruler, &lt;code&gt;338× more&lt;/code&gt;. There is no &lt;code&gt;Loops&lt;/code&gt; ruler because the scan ran once.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Pages&lt;/code&gt; is &lt;code&gt;99% from disk&lt;/code&gt;: &lt;code&gt;cache 1,204&lt;/code&gt; against &lt;code&gt;disk 182K&lt;/code&gt;. The table was not in memory, which is most of the 1,640 ms.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Indexes · orders&lt;/code&gt; lists the three indexes on the table against &lt;code&gt;filters on channel, placed_at&lt;/code&gt;. &lt;code&gt;orders_customer_placed_idx&lt;/code&gt; and &lt;code&gt;orders_status_placed_idx&lt;/code&gt; are &lt;code&gt;not leading&lt;/code&gt;: they contain &lt;code&gt;placed_at&lt;/code&gt;, but a B-tree is entered from its first column, and neither starts with &lt;code&gt;channel&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;suggested&lt;/code&gt; is the index the finding proposes, &lt;code&gt;channel, placed_at&lt;/code&gt;, with &lt;code&gt;Test index&lt;/code&gt;. It plans the statement again with a hypothetical index and prints the whole plan&amp;#39;s cost before and after, which &lt;a href=&quot;/guide/will-this-index-help/&quot;&gt;Will this index help?&lt;/a&gt; reads.&lt;/li&gt;
&lt;/ol&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Under the index list, &lt;code&gt;heap order&lt;/code&gt; sketches how the first filtered column sits in the table: &lt;code&gt;channel 0.02&lt;/code&gt;, scattered. The wheel is placed by &lt;code&gt;placed_at&lt;/code&gt; instead, at 0.99, which is why the kept rows are one stretch. That matters once the index exists, because its range of recent web orders reads neighbouring pages.&lt;/p&gt;
&lt;h3 id=&quot;all-of-it-together&quot;&gt;All of it together&lt;/h3&gt;
&lt;p&gt;That is every part. Here is the whole thing they came from: the Plan tab as the app shows it, with the text plan from the SQL editor beside it.&lt;/p&gt;
&lt;div class=&quot;guide-island explain-demo&quot; data-island=&quot;explain-compare&quot;&gt;
&lt;p class=&quot;explain-fallback&quot;&gt;All of it together: the Plan tab as the app shows it.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;the-three-things-to-look-at-first&quot;&gt;The three things to look at first&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-three-things-to-look-at-first&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Any plan, from the top:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The node with the biggest self time. That is where the seconds are.&lt;/li&gt;
&lt;li&gt;The lowest node whose estimate is off by 10× or more. Every decision above it was made on a wrong number.&lt;/li&gt;
&lt;li&gt;A scan that reads far more than it keeps. That is a missing or unusable index.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;On a plan too big to read as a drawing, &lt;code&gt;Step table&lt;/code&gt; at the end of the time strip lists every node in a sortable table. Click &lt;code&gt;Self time&lt;/code&gt; and the biggest one is first.&lt;/p&gt;
&lt;p&gt;On this plan all three point at the same node, which is common. The scan of &lt;code&gt;orders&lt;/code&gt; is the biggest self time. It is the lowest node with a bad estimate, 612 against 206,880. And it reads 12,000,000 rows to keep 206,880, because no index on &lt;code&gt;orders&lt;/code&gt; starts with &lt;code&gt;channel&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The bad estimate explains the rest. &lt;code&gt;orders&lt;/code&gt; was analysed 41 days ago, and most of the last 30 days of orders arrived after that. The planner priced the joins for 612 rows, and for 612 rows a &lt;a class=&quot;guide-term&quot; href=&quot;/guide/nested-loop/&quot; data-term-icon=&quot;repeat&quot; data-term-description=&quot;The join that runs its inner side once per outer row, why it was right for 612 rows and wrong for 206,880, and the one fix.&quot;&gt;Nested Loop&lt;/a&gt; that probes an index per row is the right call. It ran that loop 206,880 times against &lt;code&gt;order_items&lt;/code&gt;, and the join above it 620,640 times against &lt;code&gt;customers&lt;/code&gt;. The join above the loops expected 1,836 rows and produced 620,640. Two of the three seconds in the strip are those loops.&lt;/p&gt;
&lt;h2 id=&quot;what-to-do&quot;&gt;What to do&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-do&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In this order:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;ANALYZE commerce.orders;&lt;/code&gt; The &lt;code&gt;Estimate off&lt;/code&gt; finding copies it. It reads a sample of the table and takes seconds. Seqora cannot prove &lt;code&gt;ANALYZE&lt;/code&gt; is read-only, so a locked connection rejects it: unlock from the sidebar, run it, and confirm the &lt;code&gt;Review high-risk SQL&lt;/code&gt; panel. Capture the plan again and the estimate is close to 206,880, so the planner switches both joins to Hash Joins. The scan is still a &lt;a class=&quot;guide-term&quot; href=&quot;/guide/seq-scan/&quot; data-term-icon=&quot;list-dashes&quot; data-term-description=&quot;What a Seq Scan reads, the kept-to-read ratio that tells you it is the problem, and the index that replaces it.&quot;&gt;Seq Scan&lt;/a&gt;, so this alone fixes the loops and not the 1,640 ms.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;CREATE INDEX orders_channel_placed_idx ON commerce.orders (channel, placed_at DESC);&lt;/code&gt; This is the suggested index. Before building it on a 12-million-row table, test it: &lt;a href=&quot;/guide/will-this-index-help/&quot;&gt;Will this index help?&lt;/a&gt; shows what &lt;code&gt;Test index&lt;/code&gt; tells you and what it cannot. Build it with &lt;code&gt;CONCURRENTLY&lt;/code&gt; on a table people are writing to.&lt;/li&gt;
&lt;/ol&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt; runs the query. A read that takes 4.6 seconds takes 4.6 seconds again when you open &lt;code&gt;Plan&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Seqora analyzes reads on its own. For an &lt;code&gt;UPDATE&lt;/code&gt;, &lt;code&gt;DELETE&lt;/code&gt; or &lt;code&gt;INSERT&lt;/code&gt;, or a &lt;code&gt;SELECT&lt;/code&gt; that calls a function able to write, such as &lt;code&gt;nextval()&lt;/code&gt;, it shows estimates and offers &lt;code&gt;Analyze in rollback&lt;/code&gt;, which runs the statement inside &lt;code&gt;BEGIN … ROLLBACK&lt;/code&gt;. That needs an unlocked connection, and it asks &lt;code&gt;Run this statement to analyze it?&lt;/code&gt; first, because sequence values and trigger side effects are not undone, and the locks it takes are held until it finishes, for up to 5 minutes. On production you type &lt;code&gt;RUN&lt;/code&gt; before &lt;code&gt;Run and roll back&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The inspector&amp;#39;s &lt;code&gt;Rows per loop&lt;/code&gt; is per loop. &lt;code&gt;order_items&lt;/code&gt; returning 3 rows is 3 rows each of 206,880 times. The bands in the flow are already multiplied.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;commerce.orders&lt;/code&gt; was last analysed 41 days ago in the copy behind this page. Yours was probably analysed last night by autovacuum, and the estimate will be closer. The missing index is the same either way.&lt;/li&gt;
&lt;li&gt;The numbers above come from a 12-million-row copy of the sample. A smaller copy gives the same plan shape with smaller numbers.&lt;/li&gt;
&lt;li&gt;SQLite shows estimates only, with no timings. MySQL, MariaDB and SQL Server analyze reads only. &lt;a href=&quot;/guide/other-engines/&quot;&gt;MySQL, MariaDB, SQLite and SQL Server&lt;/a&gt; has the table.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;I drew the plan as row flow because every time I read &lt;code&gt;EXPLAIN&lt;/code&gt; text I was doing the same arithmetic by hand: rows times loops, this node minus its children, this count against that one. I wanted to see where the rows pile up and have the multiplication done for me. The text is still there under &lt;code&gt;Raw plan JSON&lt;/code&gt;.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
</content>
  </entry>
  <entry>
    <title>What does this table do?</title>
    <link href="https://seqora.dev/guide/what-does-this-table-do/" />
    <id>https://seqora.dev/guide/what-does-this-table-do/</id>
    <published>2026-10-17T00:00:00Z</published>
    <updated>2026-10-17T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Read a table you did not create from its constraints, indexes, triggers and access before you touch a row in it.</summary>
    <content type="html">&lt;div class=&quot;guide-gate&quot;&gt;
&lt;p&gt;You opened a table you did not create and you want to know what it is for before you change a row in it. If you wrote it, or you only need its column list, the table tab already tells you. This page is for the other case: &lt;code&gt;commerce.orders&lt;/code&gt;, 12,000,000 rows, built by someone who has left.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;the-symptom&quot;&gt;The symptom&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-symptom&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Someone asks you to close out a batch of orders. You open &lt;code&gt;commerce.orders&lt;/code&gt;, see &lt;code&gt;status&lt;/code&gt;, &lt;code&gt;placed_at&lt;/code&gt; and &lt;code&gt;total_cents&lt;/code&gt;, and the UPDATE writes itself. What the rows don&amp;#39;t show: who points at this table, what fires when you write to it, whether your WHERE clause has an index under it, and whether your role is allowed to do this at all.&lt;/p&gt;
&lt;h2 id=&quot;what-the-explorer-shows&quot;&gt;What the explorer shows&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-the-explorer-shows&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Expand &lt;code&gt;commerce.orders&lt;/code&gt; in the sidebar. Under it: &lt;code&gt;Indexes&lt;/code&gt;, &lt;code&gt;Constraints&lt;/code&gt;, &lt;code&gt;Triggers&lt;/code&gt; and &lt;code&gt;Access&lt;/code&gt;, plus &lt;code&gt;Rules&lt;/code&gt; and &lt;code&gt;Partitions&lt;/code&gt; when the table has any. Read them in this order.&lt;/p&gt;
&lt;h3 id=&quot;the-table-tab-and-how-many-rows&quot;&gt;The table tab and how many rows&lt;/h3&gt;
&lt;p&gt;Open the table. The status bar says &lt;code&gt;of ~12M&lt;/code&gt;, and hovering over it reads &amp;quot;About 12,000,000 rows (catalog estimate).&amp;quot; That number is &lt;code&gt;pg_class.reltuples&lt;/code&gt;, set by the last ANALYZE or VACUUM. &lt;code&gt;orders&lt;/code&gt; was last analysed 41 days ago, so it is 41 days old. Click &lt;code&gt;Count&lt;/code&gt; for a real &lt;code&gt;count(*)&lt;/code&gt;, which reads all 12,000,000 rows to get there.&lt;/p&gt;
&lt;h3 id=&quot;columns-with-facts&quot;&gt;Columns, with facts&lt;/h3&gt;
&lt;p&gt;Click a column header to select the column (only the header&amp;#39;s sort button sorts) and press Space. The inspector shows what &lt;code&gt;pg_stats&lt;/code&gt; knows about it: &lt;code&gt;Most common values&lt;/code&gt;, the &lt;code&gt;NULL&lt;/code&gt; share, and a &lt;code&gt;Distribution&lt;/code&gt; across equal-count bands. On &lt;code&gt;status&lt;/code&gt; it shows the five values and their shares. On &lt;code&gt;customer_id&lt;/code&gt; it shows 398,000 distinct values. That says more than the type does: &lt;code&gt;status&lt;/code&gt; is a small enum stored as text, &lt;code&gt;customer_id&lt;/code&gt; is close to one per customer.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/value-inspector-column.webp?v=418bb60069&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/value-inspector-column-800.webp?v=8c9bb23b12&quot; srcset=&quot;/guide/shots/value-inspector-column-800.webp?v=8c9bb23b12 800w, /guide/shots/value-inspector-column.webp?v=418bb60069 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;622&quot; alt=&quot;The value inspector on orders.status: definition, the five most common values with shares, and NULL share, beside the grid.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;p&gt;Select a single cell instead and &lt;code&gt;In this table&lt;/code&gt; counts the loaded rows that share its value, with &lt;code&gt;Count in table&lt;/code&gt; for the rest.&lt;/p&gt;
&lt;h3 id=&quot;constraints-who-depends-on-this-table&quot;&gt;Constraints: who depends on this table&lt;/h3&gt;
&lt;p&gt;Open &lt;code&gt;Constraints&lt;/code&gt;. The rail has three columns: &lt;code&gt;Points at this table&lt;/code&gt;, &lt;code&gt;Rules on its columns&lt;/code&gt;, &lt;code&gt;Points to&lt;/code&gt;.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/table-constraints.webp?v=dda05d8662&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/table-constraints-800.webp?v=a16ff912f6&quot; srcset=&quot;/guide/shots/table-constraints-800.webp?v=a16ff912f6 800w, /guide/shots/table-constraints.webp?v=dda05d8662 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;722&quot; alt=&quot;The Constraints page of commerce.orders: invoices and order items pointing at it, its columns with rules in the middle, customers and stores on the right, and a note that store_id has no index.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;&lt;code&gt;store_id&lt;/code&gt; has no index, so a delete of a store scans all 12 million orders, and the page says so.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;Points to&lt;/code&gt; lists &lt;code&gt;crm.customers&lt;/code&gt; through &lt;code&gt;customer_id&lt;/code&gt; and &lt;code&gt;commerce.stores&lt;/code&gt; through &lt;code&gt;store_id&lt;/code&gt;. These are the parents. An order cannot exist without its customer and its store.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Points at this table&lt;/code&gt; lists &lt;code&gt;commerce.order_items&lt;/code&gt; through &lt;code&gt;order_id&lt;/code&gt; and &lt;code&gt;billing.invoices&lt;/code&gt; through &lt;code&gt;order_id&lt;/code&gt;. These are the dependants. Deleting an order means PostgreSQL checks both, and each card says what a delete here does to the other side.&lt;/p&gt;
&lt;p&gt;The middle column holds the primary key, the unique keys and the CHECK rules. &lt;code&gt;Every rule holds&lt;/code&gt; is the verdict when nothing is &lt;code&gt;NOT VALID&lt;/code&gt;. A constraint added &lt;code&gt;NOT VALID&lt;/code&gt; gets its own row, because PostgreSQL enforces it for new rows and has never checked the old ones. &lt;code&gt;Count rows that break it&lt;/code&gt; runs that check, and &lt;code&gt;Copy VALIDATE&lt;/code&gt; gives you the statement that makes it a real constraint.&lt;/p&gt;
&lt;h3 id=&quot;indexes-how-this-table-is-queried&quot;&gt;Indexes: how this table is queried&lt;/h3&gt;
&lt;p&gt;Open &lt;code&gt;Indexes&lt;/code&gt;. &lt;code&gt;Matrix&lt;/code&gt; shows one row per column and one column per index, with &lt;code&gt;What it means&lt;/code&gt; at the end of each row. &lt;code&gt;List&lt;/code&gt; shows one row per index with its size, scans, last use and a verdict: &lt;code&gt;OK&lt;/code&gt;, &lt;code&gt;Never used&lt;/code&gt;, &lt;code&gt;Covered by &amp;lt;index&amp;gt;&lt;/code&gt;, &lt;code&gt;Invalid&lt;/code&gt; or &lt;code&gt;Building&lt;/code&gt;, and on MySQL and MariaDB &lt;code&gt;Invisible&lt;/code&gt; or &lt;code&gt;Ignored&lt;/code&gt;.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/table-indexes.webp?v=dfa6dc2df2&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/table-indexes-800.webp?v=396887a2fb&quot; srcset=&quot;/guide/shots/table-indexes-800.webp?v=396887a2fb 800w, /guide/shots/table-indexes.webp?v=dfa6dc2df2 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;722&quot; alt=&quot;The Indexes page of commerce.orders in Matrix view: three indexes across the top, a row per column with key positions, and What it means on the right.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;orders&lt;/code&gt; has three indexes: &lt;code&gt;orders_pkey&lt;/code&gt; on &lt;code&gt;id&lt;/code&gt;, &lt;code&gt;orders_customer_placed_idx&lt;/code&gt; on &lt;code&gt;(customer_id, placed_at DESC)&lt;/code&gt; and &lt;code&gt;orders_status_placed_idx&lt;/code&gt; on &lt;code&gt;(status, placed_at DESC)&lt;/code&gt;. Read the matrix by row:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;customer_id&lt;/code&gt; and &lt;code&gt;status&lt;/code&gt; each lead an index. A query that filters on either can be fast.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;placed_at&lt;/code&gt; sits at key position 2 in both. A query on &lt;code&gt;placed_at&lt;/code&gt; alone can&amp;#39;t use either, because a B-tree is ordered by its first column first.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;channel&lt;/code&gt; has no cell in any index. &lt;code&gt;WHERE channel = &amp;#39;web&amp;#39;&lt;/code&gt; reads the whole table. That is the slow query on &lt;a href=&quot;/guide/why-is-this-query-slow/&quot;&gt;Why is this query slow?&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The index set is the clearest record of how a table is used. Two indexes that lead with &lt;code&gt;customer_id&lt;/code&gt; and &lt;code&gt;status&lt;/code&gt; say the app looks orders up per customer and per status, newest first. Nobody built one for &lt;code&gt;channel&lt;/code&gt;, so nobody queried it, until now.&lt;/p&gt;
&lt;p&gt;A foreign key with no index gets a &lt;code&gt;No index.&lt;/code&gt; note on its row and the cost: &lt;code&gt;Deleting a store scans all orders.&lt;/code&gt; On &lt;code&gt;orders&lt;/code&gt;, &lt;code&gt;customer_id&lt;/code&gt; is fine because it leads an index, and &lt;code&gt;store_id&lt;/code&gt; gets the note, because no index starts with it. &lt;a href=&quot;/guide/why-does-this-delete-take-three-minutes/&quot;&gt;Why does this DELETE take three minutes?&lt;/a&gt; is about the table that isn&amp;#39;t.&lt;/p&gt;
&lt;h3 id=&quot;triggers-what-every-write-costs&quot;&gt;Triggers: what every write costs&lt;/h3&gt;
&lt;p&gt;Open &lt;code&gt;Triggers&lt;/code&gt;. The page has a tab per operation, &lt;code&gt;INSERT&lt;/code&gt;, &lt;code&gt;UPDATE&lt;/code&gt;, &lt;code&gt;DELETE&lt;/code&gt; and &lt;code&gt;TRUNCATE&lt;/code&gt;, and lays out what runs in the order PostgreSQL runs it, around &lt;code&gt;Row is written&lt;/code&gt;: &lt;code&gt;Before each row&lt;/code&gt;, &lt;code&gt;After each row&lt;/code&gt;, &lt;code&gt;After the statement&lt;/code&gt;. A statement-level trigger before the write, and a view&amp;#39;s &lt;code&gt;Instead of writing&lt;/code&gt;, get lanes of their own. An empty lane says &lt;code&gt;Nothing runs here&lt;/code&gt;.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/table-triggers.webp?v=85908069f2&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/table-triggers-800.webp?v=b6133d2f51&quot; srcset=&quot;/guide/shots/table-triggers-800.webp?v=b6133d2f51 800w, /guide/shots/table-triggers.webp?v=85908069f2 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;722&quot; alt=&quot;The Triggers page of commerce.orders on INSERT: lanes around Row is written, orders_audit in After each row, and the source of audit.log_change below.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;&lt;code&gt;orders_audit&lt;/code&gt; selected, with the function it runs.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;orders&lt;/code&gt; has one trigger, &lt;code&gt;orders_audit&lt;/code&gt;, in the &lt;code&gt;After each row&lt;/code&gt; lane. It fires &lt;code&gt;AFTER INSERT OR UPDATE OR DELETE FOR EACH ROW&lt;/code&gt; and calls &lt;code&gt;audit.log_change()&lt;/code&gt;, which writes to &lt;code&gt;audit.change_log&lt;/code&gt;. Click it for the detail. This is the fact to know before an UPDATE: every row you change here writes a row there, with &lt;code&gt;old_record&lt;/code&gt; and &lt;code&gt;new_record&lt;/code&gt; as JSON. &lt;code&gt;audit.change_log&lt;/code&gt; has 4,000,000 rows. Update 100,000 orders and it has 4,100,000.&lt;/p&gt;
&lt;h3 id=&quot;access-who-may-do-what&quot;&gt;Access: who may do what&lt;/h3&gt;
&lt;p&gt;Open &lt;code&gt;Access&lt;/code&gt;. The matrix is roles against &lt;code&gt;Read&lt;/code&gt;, &lt;code&gt;Add&lt;/code&gt;, &lt;code&gt;Change&lt;/code&gt; and &lt;code&gt;Remove&lt;/code&gt;. Row security policies are drawn into the same matrix, because a grant and a policy together are what a role can actually see. &lt;code&gt;Grants and policies agree&lt;/code&gt; is the verdict when they do. If your role has &lt;code&gt;Read&lt;/code&gt; only, the UPDATE fails, and this page is the quicker way to learn that.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/table-access.webp?v=dc4d1ccafe&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/table-access-800.webp?v=aa406c4ce7&quot; srcset=&quot;/guide/shots/table-access-800.webp?v=aa406c4ce7 800w, /guide/shots/table-access.webp?v=dc4d1ccafe 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;722&quot; alt=&quot;The Access page of commerce.orders: roles against Read, Add, Change and Remove, row security off, and an explanation of the selected cell.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;h3 id=&quot;the-ddl&quot;&gt;The DDL&lt;/h3&gt;
&lt;p&gt;At the bottom of each sub-page, folded, &lt;code&gt;DDL&lt;/code&gt; holds that page&amp;#39;s own statements with &lt;code&gt;Copy&lt;/code&gt;: the index definitions on &lt;code&gt;Indexes&lt;/code&gt;, the constraints on &lt;code&gt;Constraints&lt;/code&gt;, the triggers on &lt;code&gt;Triggers&lt;/code&gt;. For the whole &lt;code&gt;CREATE TABLE&lt;/code&gt;, right-click &lt;code&gt;orders&lt;/code&gt; in the explorer and pick &lt;code&gt;Copy CREATE TABLE&lt;/code&gt;. Read it last. By now you can.&lt;/p&gt;
&lt;h2 id=&quot;what-is-free-and-what-is-pro&quot;&gt;What is Free and what is Pro&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-is-free-and-what-is-pro&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The lists above are Free. The probes are Pro: counting the rows that break a &lt;code&gt;NOT VALID&lt;/code&gt; constraint, estimating bloat. A probe on a Free install carries the Pro badge where it sits. &lt;a href=&quot;/guide/object-pages/&quot;&gt;Object pages&lt;/a&gt; shows what a Pro page looks like on Free.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;of ~12M&lt;/code&gt; is a catalog estimate from the last ANALYZE or VACUUM. &lt;code&gt;Count&lt;/code&gt; is exact.&lt;/li&gt;
&lt;li&gt;Column facts come from &lt;code&gt;pg_stats&lt;/code&gt;, which is a sample. &lt;code&gt;Most common values&lt;/code&gt; for &lt;code&gt;status&lt;/code&gt; is reliable at five distinct values. For &lt;code&gt;customer_id&lt;/code&gt; at 398,000 it is a sketch.&lt;/li&gt;
&lt;li&gt;MySQL, MariaDB and SQL Server have the Indexes, Constraints, Triggers, Access and Partitions pages. SQLite has no Access or Partitions page. Column facts come from MySQL 8 histograms, and MariaDB, SQLite and SQL Server have none. See &lt;a href=&quot;/guide/other-engines/&quot;&gt;MySQL, MariaDB, SQLite and SQL Server&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Rules&lt;/code&gt; and &lt;code&gt;Partitions&lt;/code&gt; only appear in the tree when the table has them.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;I put the DDL last and folded because a &lt;code&gt;CREATE TABLE&lt;/code&gt; is the worst way to read a table. It lists columns in the order someone typed them years ago and says nothing about who points here, what fires on a write, or whether anyone uses the index. The sub-pages answer those first.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
</content>
  </entry>
  <entry>
    <title>What a sequence page tells you</title>
    <link href="https://seqora.dev/guide/what-a-sequence-page-tells-you/" />
    <id>https://seqora.dev/guide/what-a-sequence-page-tells-you/</id>
    <published>2026-10-17T00:00:00Z</published>
    <updated>2026-10-17T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Read a sequence page: how many values are left and when they run out, whether the table has got ahead of it, and what widening an integer column costs.</summary>
    <content type="html">&lt;div class=&quot;guide-gate&quot;&gt;
&lt;p&gt;Open a sequence page when an insert fails with a duplicate key on an id column, when a table&amp;#39;s id is &lt;code&gt;integer&lt;/code&gt; and the numbers look big, or before you reset or drop one. If every id in your schema is &lt;code&gt;bigint&lt;/code&gt; and nothing is failing, skip this one.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;the-symptom&quot;&gt;The symptom&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-symptom&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;An insert into &lt;code&gt;billing.events&lt;/code&gt; fails with &lt;code&gt;duplicate key value violates unique constraint &amp;quot;events_pkey&amp;quot;&lt;/code&gt;, the day after a restore. Or nothing has failed yet, and you notice that &lt;code&gt;events.id&lt;/code&gt; is &lt;code&gt;integer&lt;/code&gt; and the latest id is past 1.5 billion.&lt;/p&gt;
&lt;div class=&quot;guide-island objects-stage&quot; data-island=&quot;object-sequence&quot;&gt;
&lt;div class=&quot;app-window&quot; data-platform=&quot;macos&quot;&gt;
&lt;div class=&quot;app-window-bar&quot; aria-hidden=&quot;true&quot;&gt;
&lt;span class=&quot;app-window-lights&quot;&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span class=&quot;app-window-title&quot;&gt;Seqora&lt;/span&gt;
&lt;span class=&quot;app-window-controls&quot;&gt;
&lt;svg viewBox=&quot;0 0 10 10&quot;&gt;&lt;path d=&quot;M0 5h10&quot; /&gt;&lt;/svg&gt;
&lt;svg viewBox=&quot;0 0 10 10&quot;&gt;&lt;path d=&quot;M.5.5h9v9h-9z&quot; /&gt;&lt;/svg&gt;
&lt;svg viewBox=&quot;0 0 10 10&quot;&gt;&lt;path d=&quot;M0 0l10 10M10 0L0 10&quot; /&gt;&lt;/svg&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div class=&quot;app-surface&quot; data-page=&quot;sequence&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The sequence page of &lt;code&gt;billing.events_id_seq&lt;/code&gt;, a &lt;code&gt;bigint&lt;/code&gt; sequence feeding the &lt;code&gt;integer&lt;/code&gt; column &lt;code&gt;billing.events.id&lt;/code&gt;, 71% of the way to the integer limit.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&quot;what-a-sequence-is&quot;&gt;What a sequence is&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-a-sequence-is&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A sequence is a counter that lives outside your transaction. &lt;code&gt;nextval()&lt;/code&gt; hands over the next number at once, before the &lt;code&gt;INSERT&lt;/code&gt; that asked for it commits, and that number is spent whether the insert commits, fails or rolls back. That is why id columns have gaps, and why gaps are fine.&lt;/p&gt;
&lt;p&gt;The header reads &lt;code&gt;Serial · feeds events.id integer · 1.5B handed out&lt;/code&gt;. The sections below are Pro. On Free the header keeps &lt;code&gt;Serial&lt;/code&gt;, the table and the engine, then &lt;code&gt;Definition&lt;/code&gt;, then a panel, &lt;code&gt;Sequence details are part of Seqora Pro.&lt;/code&gt;, that names the Pro sections (&lt;a href=&quot;/guide/object-pages/&quot;&gt;Object pages&lt;/a&gt; shows the gate). The verdict at the top: &lt;code&gt;About 5 months left. events_id_seq has used 71.4% of the values up to the integer limit of events.id. Widening to bigint rewrites the table, so plan it ahead.&lt;/code&gt;, with &lt;code&gt;Open ALTER TABLE in a SQL editor&lt;/code&gt; beside it.&lt;/p&gt;
&lt;p&gt;Under the verdict, &lt;code&gt;Definition&lt;/code&gt; holds the &lt;code&gt;CREATE SEQUENCE&lt;/code&gt; with &lt;code&gt;Copy&lt;/code&gt;, beside &lt;code&gt;Data type&lt;/code&gt;, &lt;code&gt;Increment&lt;/code&gt;, &lt;code&gt;Cache&lt;/code&gt;, &lt;code&gt;Owner&lt;/code&gt; and the other values you would look up. &lt;code&gt;On this page&lt;/code&gt; jumps to the sections, and each one folds to its heading and a line.&lt;/p&gt;
&lt;h2 id=&quot;how-much-is-left&quot;&gt;How much is left&lt;a class=&quot;guide-anchor&quot; href=&quot;#how-much-is-left&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The sequence is &lt;code&gt;bigint&lt;/code&gt; and could count to 9.2 quintillion. The column it feeds is &lt;code&gt;integer&lt;/code&gt; and stops at 2,147,483,647. The gauge is drawn to the column&amp;#39;s limit, with a dashed extension for the sequence&amp;#39;s own, because the column is what runs out. The marker sits at 1,533,422,880, 71.4%.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Values per day&lt;/code&gt; is measured from &lt;code&gt;occurred_at&lt;/code&gt; on &lt;code&gt;events&lt;/code&gt; over the last 30 days. At 4M values a day the remaining 614 million last about five months, and until then nothing in any log says so.&lt;/p&gt;
&lt;h2 id=&quot;latest-values&quot;&gt;Latest values&lt;a class=&quot;guide-anchor&quot; href=&quot;#latest-values&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The left column is the highest eight values of &lt;code&gt;events.id&lt;/code&gt;, with the sequence&amp;#39;s next value placed among them. The right column says which of two states you are in.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;In step with the table&lt;/code&gt;: the next value, 1,533,422,881, is past the highest id in &lt;code&gt;events&lt;/code&gt;, so the next insert is safe.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Behind the table&lt;/code&gt;: the table already holds the value the sequence would hand out next, so inserts fail with a duplicate key until it moves past the table. This happens after a restore or a bulk import that inserted explicit ids. &lt;code&gt;Open setval in a SQL editor&lt;/code&gt; opens the fix:&lt;/p&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-comment&quot;&gt;-- Moves events_id_seq so its next value follows the highest id in events.&lt;/span&gt;
&lt;span class=&quot;tok-key&quot;&gt;SELECT&lt;/span&gt; setval(&lt;span class=&quot;tok-string&quot;&gt;&amp;#39;billing.events_id_seq&amp;#39;&lt;/span&gt;, (&lt;span class=&quot;tok-key&quot;&gt;SELECT&lt;/span&gt; max(id) &lt;span class=&quot;tok-key&quot;&gt;FROM&lt;/span&gt; billing.events), &lt;span class=&quot;tok-literal&quot;&gt;true&lt;/span&gt;);&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;This sequence has &lt;code&gt;CACHE 1&lt;/code&gt;. With &lt;code&gt;CACHE 20&lt;/code&gt; each connection reserves 20 values at a time, which is cheaper on a busy sequence, and loses the unused ones when it closes, so gaps of up to 20 are normal.&lt;/p&gt;
&lt;h2 id=&quot;widening-eventsid-to-bigint&quot;&gt;Widening events.id to bigint&lt;a class=&quot;guide-anchor&quot; href=&quot;#widening-eventsid-to-bigint&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;This section appears only at &lt;code&gt;warn&lt;/code&gt; or &lt;code&gt;critical&lt;/code&gt;. Its lead sentence is the cost: a &lt;code&gt;bigint&lt;/code&gt; column never runs out, and changing the type rewrites every table below, each locked for reads and writes until its rewrite finishes, about 322 GB in total.&lt;/p&gt;
&lt;p&gt;The table lists every column that changes: &lt;code&gt;events.id&lt;/code&gt; itself, &lt;code&gt;integer → bigint&lt;/code&gt;, 310 GB, then every foreign key column that points at it and is still &lt;code&gt;integer&lt;/code&gt;. &lt;code&gt;Open ALTER TABLE in a SQL editor&lt;/code&gt; opens the &lt;code&gt;ALTER TABLE … ALTER COLUMN … TYPE bigint&lt;/code&gt; statements in one transaction.&lt;/p&gt;
&lt;p&gt;That &lt;code&gt;ALTER&lt;/code&gt; holds an &lt;code&gt;ACCESS EXCLUSIVE&lt;/code&gt; lock for the whole rewrite, and on 310 GB that is hours. The five months of runway are for the alternative the page names beside the button: add a &lt;code&gt;bigint&lt;/code&gt; column, backfill it in batches, then swap it in.&lt;/p&gt;
&lt;h2 id=&quot;who-takes-values-from-it&quot;&gt;Who takes values from it&lt;a class=&quot;guide-anchor&quot; href=&quot;#who-takes-values-from-it&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;billing.events.id&lt;/code&gt;, &lt;code&gt;serial column · integer · unique · partitioned table&lt;/code&gt;, then &lt;code&gt;billing.invoice_events&lt;/code&gt; and &lt;code&gt;billing.event_attachments&lt;/code&gt;, whose columns take values from the same sequence. A column&amp;#39;s default calls &lt;code&gt;nextval()&lt;/code&gt;, and inserts may also set &lt;code&gt;id&lt;/code&gt; themselves, which is how a table gets ahead of its sequence. An identity column declared &lt;code&gt;GENERATED ALWAYS&lt;/code&gt; closes that door.&lt;/p&gt;
&lt;h2 id=&quot;who-can-use-it&quot;&gt;Who can use it&lt;a class=&quot;guide-anchor&quot; href=&quot;#who-can-use-it&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A table of roles against &lt;code&gt;Take next&lt;/code&gt;, &lt;code&gt;Read&lt;/code&gt; and &lt;code&gt;Reset&lt;/code&gt;, which are &lt;code&gt;nextval()&lt;/code&gt;, &lt;code&gt;currval()&lt;/code&gt; and &lt;code&gt;setval()&lt;/code&gt;. Here &lt;code&gt;app&lt;/code&gt; can do all three, &lt;code&gt;app_rw&lt;/code&gt; can take and read, and &lt;code&gt;reporting&lt;/code&gt; can only read. A &lt;code&gt;PUBLIC&lt;/code&gt; row is highlighted, because then every role can take values. &lt;code&gt;All properties&lt;/code&gt; and &lt;code&gt;DDL&lt;/code&gt; fold out below.&lt;/p&gt;
&lt;h2 id=&quot;mysql-mariadb-sqlite-and-sql-server&quot;&gt;MySQL, MariaDB, SQLite and SQL Server&lt;a class=&quot;guide-anchor&quot; href=&quot;#mysql-mariadb-sqlite-and-sql-server&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;MySQL and MariaDB: an &lt;code&gt;AUTO_INCREMENT&lt;/code&gt; column is the counter, and &lt;code&gt;All properties&lt;/code&gt; shows &lt;code&gt;Next value&lt;/code&gt;, &lt;code&gt;auto_increment_increment&lt;/code&gt; and &lt;code&gt;innodb_autoinc_lock_mode&lt;/code&gt;. MariaDB&amp;#39;s own sequences get the same page as PostgreSQL&amp;#39;s.&lt;/li&gt;
&lt;li&gt;SQLite: an &lt;code&gt;INTEGER PRIMARY KEY&lt;/code&gt; is the rowid, and the property is &lt;code&gt;Largest id in the table&lt;/code&gt;, or &lt;code&gt;Largest id handed out (sqlite_sequence)&lt;/code&gt; with &lt;code&gt;AUTOINCREMENT&lt;/code&gt;. Ids are 64-bit, so there is no runway to watch.&lt;/li&gt;
&lt;li&gt;SQL Server: a sequence, or an &lt;code&gt;IDENTITY&lt;/code&gt; column with &lt;code&gt;Seed&lt;/code&gt;, &lt;code&gt;Increment&lt;/code&gt; and &lt;code&gt;Last value handed out&lt;/code&gt;. An identity the table has got ahead of offers &lt;code&gt;Open DBCC CHECKIDENT in a SQL editor&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The runway is a straight line through the last 30 days. A launch or a backfill changes it. Without a timestamp column the rate comes from insert counts since the statistics reset.&lt;/li&gt;
&lt;li&gt;A sequence with &lt;code&gt;CYCLE&lt;/code&gt; on a unique column gets its own warning: at the limit it starts again from 1, and those values are taken.&lt;/li&gt;
&lt;li&gt;The sizes here come from the 12-million-row copy of the sample.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;An &lt;code&gt;integer&lt;/code&gt; key that runs out does it with no warning in any log. I wanted the date on a gauge you would see while looking for something else, so the page opens with how much is left, not with the DDL.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
</content>
  </entry>
  <entry>
    <title>What a function page tells you</title>
    <link href="https://seqora.dev/guide/what-a-function-page-tells-you/" />
    <id>https://seqora.dev/guide/what-a-function-page-tells-you/</id>
    <published>2026-10-17T00:00:00Z</published>
    <updated>2026-10-17T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Read a function page: how to call it, who can run it and as whom, what it promises the planner, what it touches, and the SECURITY DEFINER fix.</summary>
    <content type="html">&lt;div class=&quot;guide-gate&quot;&gt;
&lt;p&gt;Open a function page when you are about to call something you didn&amp;#39;t write, when a trigger is doing something you can&amp;#39;t find, or when someone asks what runs as whom. If all you want is the source, &lt;code&gt;Body&lt;/code&gt; is near the bottom and &lt;code&gt;DDL&lt;/code&gt; under it.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;the-symptom&quot;&gt;The symptom&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-symptom&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A few invoices have the wrong total. The trigger &lt;code&gt;invoice_lines_recalc&lt;/code&gt; on &lt;code&gt;billing.invoice_lines&lt;/code&gt; calls &lt;code&gt;billing.apply_discount&lt;/code&gt;, which someone who has left wrote in &lt;code&gt;plpgsql&lt;/code&gt;. Before you call it by hand to see what it does, you want to know what it writes, and as whom.&lt;/p&gt;
&lt;div class=&quot;guide-island objects-stage&quot; data-island=&quot;object-function&quot;&gt;
&lt;div class=&quot;app-window&quot; data-platform=&quot;macos&quot;&gt;
&lt;div class=&quot;app-window-bar&quot; aria-hidden=&quot;true&quot;&gt;
&lt;span class=&quot;app-window-lights&quot;&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;&lt;/i&gt;&lt;/span&gt;
&lt;span class=&quot;app-window-title&quot;&gt;Seqora&lt;/span&gt;
&lt;span class=&quot;app-window-controls&quot;&gt;
&lt;svg viewBox=&quot;0 0 10 10&quot;&gt;&lt;path d=&quot;M0 5h10&quot; /&gt;&lt;/svg&gt;
&lt;svg viewBox=&quot;0 0 10 10&quot;&gt;&lt;path d=&quot;M.5.5h9v9h-9z&quot; /&gt;&lt;/svg&gt;
&lt;svg viewBox=&quot;0 0 10 10&quot;&gt;&lt;path d=&quot;M0 0l10 10M10 0L0 10&quot; /&gt;&lt;/svg&gt;
&lt;/span&gt;
&lt;/div&gt;
&lt;div class=&quot;app-surface&quot; data-page=&quot;function&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The function page of &lt;code&gt;billing.apply_discount&lt;/code&gt;, a &lt;code&gt;plpgsql&lt;/code&gt; function that runs as its owner with no &lt;code&gt;search_path&lt;/code&gt; pinned, and that anyone who can connect can execute.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&quot;what-a-function-is&quot;&gt;What a function is&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-a-function-is&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A function is code the server runs when a query calls it. &lt;code&gt;apply_discount&lt;/code&gt; locks one invoice, checks that it is open, cuts &lt;code&gt;total_cents&lt;/code&gt; by a percentage and returns the new total. The database decides who it runs as, what it can see, and how often the planner may call it, and the page is about those three things.&lt;/p&gt;
&lt;p&gt;The header reads &lt;code&gt;Function · plpgsql · owned by app · 2 overloads&lt;/code&gt;. The sections below are Pro. On Free the header keeps &lt;code&gt;Function · plpgsql&lt;/code&gt; and the engine, without the owner or the overload count, then &lt;code&gt;Definition&lt;/code&gt;, then a panel, &lt;code&gt;Function details are part of Seqora Pro.&lt;/code&gt;, that names the Pro sections (&lt;a href=&quot;/guide/object-pages/&quot;&gt;Object pages&lt;/a&gt; shows the gate). This function opens with two verdicts: &lt;code&gt;Runs as its owner without a fixed search_path&lt;/code&gt;, in red, and &lt;code&gt;Anyone who can connect can run it&lt;/code&gt;. Each has its fix beside it, and the boxes further down say why.&lt;/p&gt;
&lt;h2 id=&quot;how-to-call-it&quot;&gt;How to call it&lt;a class=&quot;guide-anchor&quot; href=&quot;#how-to-call-it&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The signature, one argument per line: &lt;code&gt;invoice_id bigint&lt;/code&gt;, &lt;code&gt;pct numeric = 10.0&lt;/code&gt; marked &lt;code&gt;optional&lt;/code&gt;, &lt;code&gt;note text = &amp;#39;a, b&amp;#39;&lt;/code&gt; marked &lt;code&gt;optional&lt;/code&gt;, returning &lt;code&gt;numeric&lt;/code&gt;. Beside it the summary in words: &lt;code&gt;Takes invoice_id, pct and note (pct and note are optional) and returns a numeric. It changes data and runs with its owner&amp;#39;s permissions (app).&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Under the signature, the facts a daily lookup wants: &lt;code&gt;Language&lt;/code&gt;, &lt;code&gt;Volatility&lt;/code&gt;, &lt;code&gt;Security&lt;/code&gt;, &lt;code&gt;Owner&lt;/code&gt; and the rest. &lt;code&gt;On this page&lt;/code&gt; jumps to the sections below, and each one folds to its heading and a line.&lt;/p&gt;
&lt;h2 id=&quot;who-can-run-it-and-as-whom&quot;&gt;Who can run it, and as whom&lt;a class=&quot;guide-anchor&quot; href=&quot;#who-can-run-it-and-as-whom&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Four boxes in a row. &lt;code&gt;Explain each&lt;/code&gt; adds a line under each box saying what it means. &lt;code&gt;Who can call it&lt;/code&gt;: &lt;code&gt;PUBLIC&lt;/code&gt;, because new functions get that by default. &lt;code&gt;Runs as&lt;/code&gt;: &lt;code&gt;Owner (app)&lt;/code&gt;, whoever calls it. &lt;code&gt;search_path&lt;/code&gt;: &lt;code&gt;Not pinned&lt;/code&gt;, in red. &lt;code&gt;What it changes&lt;/code&gt;: &lt;code&gt;Writes billing.invoices&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;SECURITY DEFINER&lt;/code&gt; means the function runs as &lt;code&gt;app&lt;/code&gt;, its owner, no matter who calls it. But &lt;code&gt;search_path&lt;/code&gt; decides which &lt;code&gt;round()&lt;/code&gt; an unqualified name means, and here it is whatever the caller set. A caller who puts a schema they own before &lt;code&gt;pg_catalog&lt;/code&gt; can supply their own &lt;code&gt;round(numeric)&lt;/code&gt;, call &lt;code&gt;apply_discount&lt;/code&gt;, and have their code run with &lt;code&gt;app&lt;/code&gt;&amp;#39;s permissions. Since &lt;code&gt;PUBLIC&lt;/code&gt; can execute it, every role that can connect is such a caller.&lt;/p&gt;
&lt;p&gt;The fix is two statements, and the page opens each in a SQL editor. &lt;code&gt;Open the search_path fix in a SQL editor&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-key&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;FUNCTION&lt;/span&gt; billing.apply_discount(invoice_id bigint, pct numeric, note text)
  &lt;span class=&quot;tok-key&quot;&gt;SET&lt;/span&gt; search_path = billing, pg_temp;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;pg_temp&lt;/code&gt; goes last so a temporary table can&amp;#39;t shadow a real one. The PostgreSQL docs&amp;#39; stricter form, &lt;code&gt;pg_catalog, pg_temp&lt;/code&gt;, works when the body qualifies every table, as here. Then &lt;code&gt;Open REVOKE in a SQL editor&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-key&quot;&gt;REVOKE&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;EXECUTE&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;ON&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;FUNCTION&lt;/span&gt; billing.apply_discount(invoice_id bigint, pct numeric, note text) &lt;span class=&quot;tok-key&quot;&gt;FROM&lt;/span&gt; PUBLIC;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;and grant &lt;code&gt;EXECUTE&lt;/code&gt; to the one role that needs it.&lt;/p&gt;
&lt;h2 id=&quot;declared-vs-body&quot;&gt;Declared vs. body&lt;a class=&quot;guide-anchor&quot; href=&quot;#declared-vs-body&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;What the function promises the planner, checked against what its code does. This one declares nothing, so the table folds to &lt;code&gt;All defaults: VOLATILE · PARALLEL UNSAFE · CALLED ON NULL INPUT · NOT LEAKPROOF · COST 100&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Volatility is the one worth remembering. &lt;code&gt;VOLATILE&lt;/code&gt;, the default, says the function can change data or give a different answer each time, so Postgres calls it again for every row. &lt;code&gt;STABLE&lt;/code&gt; says the same arguments give the same answer within one statement, so the planner can call it once and use it in an index scan. &lt;code&gt;IMMUTABLE&lt;/code&gt; says the same arguments give the same answer forever, so Postgres may precompute it and build an index on it. A function marked &lt;code&gt;IMMUTABLE&lt;/code&gt; that reads a table keeps returning the old answer after the table changes, and the page says so in red.&lt;/p&gt;
&lt;h2 id=&quot;how-often-it-runs&quot;&gt;How often it runs&lt;a class=&quot;guide-anchor&quot; href=&quot;#how-often-it-runs&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Calls and time per call from &lt;code&gt;pg_stat_user_functions&lt;/code&gt;. It needs &lt;code&gt;track_functions&lt;/code&gt; set to &lt;code&gt;pl&lt;/code&gt; or &lt;code&gt;all&lt;/code&gt;. Here it is &lt;code&gt;none&lt;/code&gt;, so the section says Postgres isn&amp;#39;t counting function calls and shows the &lt;code&gt;ALTER DATABASE … SET track_functions = &amp;#39;pl&amp;#39;&lt;/code&gt; that turns it on.&lt;/p&gt;
&lt;h2 id=&quot;who-uses-it-and-what-it-touches&quot;&gt;Who uses it and what it touches&lt;a class=&quot;guide-anchor&quot; href=&quot;#who-uses-it-and-what-it-touches&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;Used by&lt;/code&gt; on the left: the trigger &lt;code&gt;invoice_lines_recalc&lt;/code&gt;, which runs it after insert or update for each row, and under &lt;code&gt;Mentioned in code&lt;/code&gt;, &lt;code&gt;billing.close_period()&lt;/code&gt;, drawn dashed because it was found by searching other functions&amp;#39; code, not recorded by Postgres. &lt;code&gt;Touches&lt;/code&gt; on the right: &lt;code&gt;billing.invoices&lt;/code&gt;, &lt;code&gt;update&lt;/code&gt;, with a &lt;code&gt;writes&lt;/code&gt; chip, and under &lt;code&gt;Calls&lt;/code&gt; any function the body calls.&lt;/p&gt;
&lt;h2 id=&quot;try-it-body-and-the-rest&quot;&gt;Try it, Body and the rest&lt;a class=&quot;guide-anchor&quot; href=&quot;#try-it-body-and-the-rest&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;Try it&lt;/code&gt; has one field per argument. Fill in an invoice id, leave &lt;code&gt;pct&lt;/code&gt; empty and the default applies. The &lt;code&gt;Call&lt;/code&gt; box shows the statement as it will run, wrapped in &lt;code&gt;BEGIN&lt;/code&gt; and &lt;code&gt;ROLLBACK&lt;/code&gt; because the body writes.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Body · 11 lines&lt;/code&gt; is the source, with a chip for each thing it does: &lt;code&gt;update billing.invoices&lt;/code&gt;, &lt;code&gt;reads billing.invoices&lt;/code&gt;, &lt;code&gt;raises &amp;quot;invoice is not open&amp;quot;&lt;/code&gt;. &lt;code&gt;All properties&lt;/code&gt; and &lt;code&gt;DDL&lt;/code&gt; fold out under it.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The body analysis is a reading of the text, so dynamic SQL and calls into other functions aren&amp;#39;t followed.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Mentioned in code&lt;/code&gt; searches other functions in this database. Application code is never searched, so an empty &lt;code&gt;Used by&lt;/code&gt; doesn&amp;#39;t mean unused.&lt;/li&gt;
&lt;li&gt;MySQL and MariaDB routines have a &lt;code&gt;DEFINER&lt;/code&gt; and &lt;code&gt;SQL SECURITY&lt;/code&gt; instead, and &lt;code&gt;DETERMINISTIC&lt;/code&gt; there is advisory. SQL Server resolves names by schema, not by a &lt;code&gt;search_path&lt;/code&gt; the caller sets, so &lt;code&gt;Runs as its owner without a fixed search_path&lt;/code&gt; never appears there. SQLite has no functions page.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;The &lt;code&gt;search_path&lt;/code&gt; box is red because it is the one function problem I have found in nearly every schema I have opened. It is what &lt;code&gt;SECURITY DEFINER&lt;/code&gt; gives you if you stop there, and the fix is one &lt;code&gt;ALTER&lt;/code&gt;, so the page puts both in front of you before it shows the body.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
</content>
  </entry>
  <entry>
    <title>Why does this DELETE take three minutes?</title>
    <link href="https://seqora.dev/guide/why-does-this-delete-take-three-minutes/" />
    <id>https://seqora.dev/guide/why-does-this-delete-take-three-minutes/</id>
    <published>2026-10-17T00:00:00Z</published>
    <updated>2026-10-17T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>See what PostgreSQL does on a DELETE when foreign keys point at the row, where Seqora shows it, and the one CREATE INDEX that ends it.</summary>
    <content type="html">&lt;div class=&quot;guide-gate&quot;&gt;
&lt;p&gt;A DELETE of one row by primary key should take a millisecond. If yours takes minutes, something is checking something, and it is almost always a foreign key pointing at the row from a table with no index on that column. This page shows the check, where Seqora puts it on screen, and the index that ends it.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;the-symptom&quot;&gt;The symptom&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-symptom&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-key&quot;&gt;DELETE&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;FROM&lt;/span&gt; billing.invoices &lt;span class=&quot;tok-key&quot;&gt;WHERE&lt;/span&gt; id = &lt;span class=&quot;tok-number&quot;&gt;48110273&lt;/span&gt;;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Run it. The &lt;code&gt;Query status&lt;/code&gt; footer says it is running, and keeps saying it. &lt;code&gt;invoices&lt;/code&gt; has 8,100,000 rows and &lt;code&gt;invoices_pkey&lt;/code&gt; on &lt;code&gt;id&lt;/code&gt;, so finding the row took no time. The three minutes are what happens after it is found.&lt;/p&gt;
&lt;h2 id=&quot;what-postgresql-does-on-a-delete&quot;&gt;What PostgreSQL does on a DELETE&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-postgresql-does-on-a-delete&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Two tables point at &lt;code&gt;billing.invoices&lt;/code&gt;: &lt;code&gt;billing.payments&lt;/code&gt; through &lt;code&gt;invoice_id&lt;/code&gt;, and &lt;code&gt;billing.events&lt;/code&gt; through &lt;code&gt;invoice_id&lt;/code&gt;. Before the delete can finish, PostgreSQL has to prove that no payment and no event still references invoice 48110273. It does that with a trigger on each foreign key, an internal one you did not write, which runs a query shaped like this:&lt;/p&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-key&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;tok-number&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;FROM&lt;/span&gt; billing.payments &lt;span class=&quot;tok-key&quot;&gt;WHERE&lt;/span&gt; invoice_id = &lt;span class=&quot;tok-number&quot;&gt;48110273&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;FOR&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;KEY&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;SHARE&lt;/span&gt;;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;On &lt;code&gt;events&lt;/code&gt; the query uses &lt;code&gt;events_invoice_idx&lt;/code&gt; and returns at once. On &lt;code&gt;payments&lt;/code&gt; there is no index on &lt;code&gt;invoice_id&lt;/code&gt;. The only way to answer &amp;quot;is there a payment for this invoice&amp;quot; is to read all 7,900,000 payments. That is the three minutes: one sequential scan of &lt;code&gt;payments&lt;/code&gt;, for one deleted row.&lt;/p&gt;
&lt;p&gt;With &lt;code&gt;ON DELETE CASCADE&lt;/code&gt; it is worse. The scan finds the payments and deletes them, and each deleted payment fires its own checks against whatever points at &lt;code&gt;payments&lt;/code&gt;. Cascades multiply the work by the depth of the tree.&lt;/p&gt;
&lt;h2 id=&quot;what-seqora-shows&quot;&gt;What Seqora shows&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-seqora-shows&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id=&quot;the-diagram&quot;&gt;The diagram&lt;/h3&gt;
&lt;p&gt;Open the ER diagram for &lt;code&gt;billing&lt;/code&gt; and click &lt;code&gt;invoices&lt;/code&gt;. The inspector&amp;#39;s &lt;code&gt;Referenced by&lt;/code&gt; section lists &lt;code&gt;payments.invoice_id&lt;/code&gt; and &lt;code&gt;events.invoice_id&lt;/code&gt;. A foreign key with &lt;code&gt;ON DELETE CASCADE&lt;/code&gt; carries a trash icon there, &amp;quot;Deleting a row in invoices also deletes the payments rows that point to it&amp;quot; on hover. One with no icon is the default, &lt;code&gt;NO ACTION&lt;/code&gt;: a delete is checked and refused if anything still points here. Either way the check runs.&lt;/p&gt;
&lt;p&gt;Now click &lt;code&gt;payments&lt;/code&gt;. In its &lt;code&gt;Columns&lt;/code&gt;, &lt;code&gt;invoice_id&lt;/code&gt; carries an amber dot. Hover it: &amp;quot;No index on invoice_id. Joins and deletes through this key scan payments.&amp;quot;&lt;/p&gt;
&lt;h3 id=&quot;the-constraints-page&quot;&gt;The Constraints page&lt;/h3&gt;
&lt;p&gt;Under &lt;code&gt;billing.invoices&lt;/code&gt; in the explorer, open &lt;code&gt;Constraints&lt;/code&gt;. The &lt;code&gt;Points at this table&lt;/code&gt; column lists the same two tables with what a delete here does to each. Both constraints are correct, which is the point. The problem is not in &lt;code&gt;invoices&lt;/code&gt; at all.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/invoices-constraints.webp?v=af5dfacbac&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/invoices-constraints-800.webp?v=8b54953ff5&quot; srcset=&quot;/guide/shots/invoices-constraints-800.webp?v=8b54953ff5 800w, /guide/shots/invoices-constraints.webp?v=af5dfacbac 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;1002&quot; alt=&quot;The Constraints page of billing.invoices: events and payments pointing at it, with a red note on payments that each delete scans all payments because invoice_id has no index.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;The red line on the &lt;code&gt;payments&lt;/code&gt; card is the three minutes.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h3 id=&quot;the-indexes-page-of-the-other-table&quot;&gt;The Indexes page of the other table&lt;/h3&gt;
&lt;p&gt;Open &lt;code&gt;billing.payments&lt;/code&gt;, then &lt;code&gt;Indexes&lt;/code&gt;. In &lt;code&gt;Matrix&lt;/code&gt;, the &lt;code&gt;invoice_id&lt;/code&gt; row carries the note &lt;code&gt;No index.&lt;/code&gt; followed by &lt;code&gt;Deleting an invoice scans all payments.&lt;/code&gt; The page&amp;#39;s verdicts say the same, &lt;code&gt;No index for invoice_id&lt;/code&gt;, with &lt;code&gt;Open CREATE INDEX in a SQL editor&lt;/code&gt; next to it. That sentence is the whole diagnosis.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/payments-indexes.webp?v=16d4463fe7&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/payments-indexes-800.webp?v=2ebea57936&quot; srcset=&quot;/guide/shots/payments-indexes-800.webp?v=2ebea57936 800w, /guide/shots/payments-indexes.webp?v=16d4463fe7 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;722&quot; alt=&quot;The Indexes page of billing.payments in Matrix view: one index on id, and the invoice_id row marked No index, Deleting an invoice scans all payments.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;p&gt;The schema-wide version is the &lt;code&gt;Indexes&lt;/code&gt; report under &lt;code&gt;Schema reports&lt;/code&gt; for &lt;code&gt;billing&lt;/code&gt;. &lt;code&gt;Other checks&lt;/code&gt; lists every foreign key without an index, and &lt;code&gt;payments.invoice_id&lt;/code&gt; is the one on it.&lt;/p&gt;
&lt;h3 id=&quot;the-plan-tab&quot;&gt;The Plan tab&lt;/h3&gt;
&lt;p&gt;The Plan tab is Pro. Run the DELETE again and click &lt;code&gt;Plan&lt;/code&gt;. For a write, the Plan tab shows the estimate only: two nodes, &lt;code&gt;Delete on invoices&lt;/code&gt; fed by an &lt;a class=&quot;guide-term&quot; href=&quot;/guide/index-scan/&quot; data-term-icon=&quot;lightning&quot; data-term-description=&quot;How an Index Scan fetches rows, why 206,880 cheap lookups add up, and what the table&amp;#39;s physical order does to each one.&quot;&gt;&lt;code&gt;Index Scan using invoices_pkey&lt;/code&gt;&lt;/a&gt;, at a tiny cost, because the planner does not cost triggers. To see the time, click &lt;code&gt;Analyze in rollback&lt;/code&gt;. It asks &lt;code&gt;Run this statement to analyze it?&lt;/code&gt;, then runs the statement inside &lt;code&gt;BEGIN … ROLLBACK&lt;/code&gt;, so the row is deleted and put back. &lt;code&gt;Run and roll back&lt;/code&gt; needs &lt;code&gt;RUN&lt;/code&gt; typed on a production connection. The button is disabled on a locked connection, so unlock from the sidebar first. The dialog lists what Analyze does not undo: &lt;code&gt;Sequence values, trigger and function side effects&lt;/code&gt;, and that locks are &lt;code&gt;Held until it finishes, up to 5 min&lt;/code&gt;.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/delete-plan-estimate.webp?v=e29530bf29&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/delete-plan-estimate-800.webp?v=3e605cf852&quot; srcset=&quot;/guide/shots/delete-plan-estimate-800.webp?v=3e605cf852 800w, /guide/shots/delete-plan-estimate.webp?v=e29530bf29 1872w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(936px, 46rem)&quot; width=&quot;936&quot; height=&quot;919&quot; alt=&quot;The Plan tab for the DELETE, estimates only: an Index Scan feeding Delete on invoices, with Analyze in rollback above and Findings need Analyze below.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;The estimate, on an invoice with no payments. The plan looks perfect.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Now the strip above the canvas, &lt;code&gt;Where the time went&lt;/code&gt;, is almost one colour: a segment labelled &lt;code&gt;Triggers&lt;/code&gt;, &amp;quot;Time inside trigger functions&amp;quot;, holding nearly all of the three minutes. Hover it for the share. Foreign key checks are triggers as far as PostgreSQL is concerned, so that is where they land. The plan nodes themselves take a few milliseconds. When the time is in &lt;code&gt;Triggers&lt;/code&gt; and the plan is small, stop reading the plan and open the Indexes page of every table that points at yours.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/delete-plan-triggers.webp?v=f042e385fe&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/delete-plan-triggers-800.webp?v=aa8372fd66&quot; srcset=&quot;/guide/shots/delete-plan-triggers-800.webp?v=aa8372fd66 800w, /guide/shots/delete-plan-triggers.webp?v=f042e385fe 1872w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(936px, 46rem)&quot; width=&quot;936&quot; height=&quot;919&quot; alt=&quot;The Plan tab after Analyze in rollback: the time strip almost entirely one segment labelled Triggers, with tiny Index Scan and Delete segments before it.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;On this copy &lt;code&gt;payments&lt;/code&gt; is already in memory, so the statement takes about half a second. The shape is the same: nearly all of it is &lt;code&gt;Triggers&lt;/code&gt;.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;what-to-do&quot;&gt;What to do&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-do&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-key&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;INDEX&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;CONCURRENTLY&lt;/span&gt; payments_invoice_idx
  &lt;span class=&quot;tok-key&quot;&gt;ON&lt;/span&gt; billing.payments (invoice_id);&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;This is what &lt;code&gt;Open CREATE INDEX in a SQL editor&lt;/code&gt; puts in the editor. It runs straight away. Without &lt;code&gt;CONCURRENTLY&lt;/code&gt; it would stop at the &lt;code&gt;Review high-risk SQL&lt;/code&gt; panel first, because a plain &lt;code&gt;CREATE INDEX&lt;/code&gt; blocks writes to the table while it builds; &lt;a href=&quot;/guide/run-cancel-and-transactions/&quot;&gt;Run, cancel, and transactions&lt;/a&gt; explains the panel.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;CONCURRENTLY&lt;/code&gt; buys you a &lt;code&gt;payments&lt;/code&gt; table that stays writable while the index builds. It costs two scans of the table instead of one, a longer build, and the statement cannot run inside a transaction: if the editor shows &lt;code&gt;Transaction open&lt;/code&gt;, commit first. If the build is interrupted, the index is left behind invalid, and the Indexes page says &lt;code&gt;payments_invoice_idx is invalid&lt;/code&gt; with a &lt;code&gt;Rebuild&lt;/code&gt; action.&lt;/p&gt;
&lt;p&gt;After it exists, run the DELETE again with &lt;code&gt;Analyze in rollback&lt;/code&gt;. The &lt;code&gt;Triggers&lt;/code&gt; segment shrinks to nothing worth hovering and the statement takes milliseconds. The foreign key check is now one index lookup.&lt;/p&gt;
&lt;p&gt;One more thing you will meet on the way. Type the DELETE without its WHERE and the same panel stops it, with the reason &lt;code&gt;No WHERE clause, so this deletes every row in the table.&lt;/code&gt; That one is not slow. It is 8,100,000 invoices and every payment and event they own.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Foreign key checks run as internal triggers, and the Plan tab shows them under &lt;code&gt;Triggers&lt;/code&gt; together with any trigger you wrote. &lt;code&gt;invoices&lt;/code&gt; also has an audit trigger writing to &lt;code&gt;audit.change_log&lt;/code&gt;, so the segment is both. The Triggers page lists only yours.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Analyze in rollback&lt;/code&gt; runs the DELETE for real before rolling it back. It takes the same locks for the same time.&lt;/li&gt;
&lt;li&gt;Cascades multiply. With &lt;code&gt;Del: Cascade&lt;/code&gt; from &lt;code&gt;invoices&lt;/code&gt; to &lt;code&gt;payments&lt;/code&gt;, the index above makes finding the payments fast, and deleting them still fires whatever points at &lt;code&gt;payments&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The new index is paid for on every INSERT into &lt;code&gt;payments&lt;/code&gt;. For a foreign key column that is the right trade, and it is a trade.&lt;/li&gt;
&lt;li&gt;The downloadable sample is much smaller than 7,900,000 payments. Your DELETE will be slow in shape and quick in seconds.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;I made the Plan tab run writes inside &lt;code&gt;BEGIN … ROLLBACK&lt;/code&gt; because the only honest plan of a DELETE is the one that deletes. An estimate costs the scan and never the trigger, so the estimated plan of this statement looks perfect. Running it and rolling it back is the only way to see the three minutes, and better in a transaction that undoes itself than in production.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
</content>
  </entry>
  <entry>
    <title>Is my JSONB query using the index?</title>
    <link href="https://seqora.dev/guide/is-my-jsonb-query-using-the-index/" />
    <id>https://seqora.dev/guide/is-my-jsonb-query-using-the-index/</id>
    <published>2026-10-17T00:00:00Z</published>
    <updated>2026-10-17T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Tell from the Plan tab whether a GIN index answered your JSONB query, why -&gt;&gt; never can, and which rewrite or index fixes it.</summary>
    <content type="html">&lt;div class=&quot;guide-gate&quot;&gt;
&lt;p&gt;You put a GIN index on a &lt;code&gt;jsonb&lt;/code&gt; column and a query on that column is still slow. If the query uses &lt;code&gt;@&amp;gt;&lt;/code&gt; and the Plan tab shows a &lt;code&gt;Bitmap Index Scan&lt;/code&gt;, you are fine and can leave. This page is for the query that uses &lt;code&gt;-&amp;gt;&amp;gt;&lt;/code&gt; and the index that sits there unused.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;the-symptom&quot;&gt;The symptom&lt;a class=&quot;guide-anchor&quot; href=&quot;#the-symptom&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;crm.customers&lt;/code&gt; has 412,000 rows and a column &lt;code&gt;attributes jsonb&lt;/code&gt; holding documents like &lt;code&gt;{&amp;quot;plan&amp;quot;: &amp;quot;pro&amp;quot;, &amp;quot;referrer&amp;quot;: &amp;quot;ads&amp;quot;}&lt;/code&gt;. It has a GIN index, &lt;code&gt;customers_attributes_idx&lt;/code&gt;, created with the default operator class, &lt;code&gt;jsonb_ops&lt;/code&gt;. Two queries ask the same question:&lt;/p&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-key&quot;&gt;SELECT&lt;/span&gt; id, email &lt;span class=&quot;tok-key&quot;&gt;FROM&lt;/span&gt; crm.customers
&lt;span class=&quot;tok-key&quot;&gt;WHERE&lt;/span&gt;  attributes @&amp;gt; &lt;span class=&quot;tok-string&quot;&gt;&amp;#39;{&amp;quot;plan&amp;quot;: &amp;quot;pro&amp;quot;}&amp;#39;&lt;/span&gt;;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-key&quot;&gt;SELECT&lt;/span&gt; id, email &lt;span class=&quot;tok-key&quot;&gt;FROM&lt;/span&gt; crm.customers
&lt;span class=&quot;tok-key&quot;&gt;WHERE&lt;/span&gt;  attributes-&amp;gt;&amp;gt;&lt;span class=&quot;tok-string&quot;&gt;&amp;#39;plan&amp;#39;&lt;/span&gt; = &lt;span class=&quot;tok-string&quot;&gt;&amp;#39;pro&amp;#39;&lt;/span&gt;;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The first comes back at once. The second reads the whole table. Same rows out, same index on disk.&lt;/p&gt;
&lt;h2 id=&quot;what-the-plan-tab-shows&quot;&gt;What the Plan tab shows&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-the-plan-tab-shows&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The Plan tab is Pro. Run the first query and click &lt;code&gt;Plan&lt;/code&gt;. The scan on &lt;code&gt;customers&lt;/code&gt; is one node, &lt;a class=&quot;guide-term&quot; href=&quot;/guide/bitmap-heap-scan/&quot; data-term-icon=&quot;grid-four&quot; data-term-description=&quot;The two-node scan for the middle ground, what a lossy bitmap costs, and how to read the exact and lossy page counts.&quot;&gt;&lt;code&gt;Bitmap Heap Scan&lt;/code&gt;&lt;/a&gt;, with the &lt;code&gt;Bitmap Index Scan&lt;/code&gt; on &lt;code&gt;customers_attributes_idx&lt;/code&gt; folded into it. Select it and the conditions block at the bottom of the inspector reads &lt;code&gt;Index Cond: (attributes @&amp;gt; &amp;#39;{&amp;quot;plan&amp;quot;: &amp;quot;pro&amp;quot;}&amp;#39;::jsonb)&lt;/code&gt;. The table wheel beside the scan draws the index hub and the page bitmap, not the full-scan arrow. Under &lt;code&gt;Indexes · customers&lt;/code&gt;, &lt;code&gt;customers_attributes_idx&lt;/code&gt; is tagged &lt;code&gt;✓ used&lt;/code&gt;.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/jsonb-contains.webp?v=ad07740b22&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/jsonb-contains-800.webp?v=71183ea2b5&quot; srcset=&quot;/guide/shots/jsonb-contains-800.webp?v=71183ea2b5 800w, /guide/shots/jsonb-contains.webp?v=ad07740b22 1872w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(936px, 46rem)&quot; width=&quot;936&quot; height=&quot;919&quot; alt=&quot;The Plan tab for the containment query: one Bitmap Heap Scan node on customers, its table wheel drawing the index, and customers_attributes_idx tagged used.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;p&gt;Run the second and click &lt;code&gt;Plan&lt;/code&gt;. One node, &lt;a class=&quot;guide-term&quot; href=&quot;/guide/seq-scan/&quot; data-term-icon=&quot;list-dashes&quot; data-term-description=&quot;What a Seq Scan reads, the kept-to-read ratio that tells you it is the problem, and the index that replaces it.&quot;&gt;&lt;code&gt;Seq Scan on customers&lt;/code&gt;&lt;/a&gt;, with &lt;code&gt;Filter: ((attributes -&amp;gt;&amp;gt; &amp;#39;plan&amp;#39;::text) = &amp;#39;pro&amp;#39;::text)&lt;/code&gt; in the conditions block. About 6% of customers are on the pro plan, so the row flow draws a &lt;code&gt;−N&lt;/code&gt; drain under the scan for the other 94%, roughly 387,000 of 412,000 rows. The wheel shows the full-scan arrow. Under &lt;code&gt;Indexes · customers&lt;/code&gt;, &lt;code&gt;customers_attributes_idx&lt;/code&gt; is tagged &lt;code&gt;not chosen&lt;/code&gt;. The Findings panel adds &lt;code&gt;Seq Scan on customers&lt;/code&gt;, because the scan read 10,000 rows or more and kept a fifth or less of them.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/jsonb-arrow.webp?v=78c639530b&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/jsonb-arrow-800.webp?v=9300484a57&quot; srcset=&quot;/guide/shots/jsonb-arrow-800.webp?v=9300484a57 800w, /guide/shots/jsonb-arrow.webp?v=78c639530b 1872w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(936px, 46rem)&quot; width=&quot;936&quot; height=&quot;919&quot; alt=&quot;The Plan tab for the arrow query: a Seq Scan on customers with a drain of 387,000 rows, 6% kept, customers_attributes_idx tagged not chosen, and a finding.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;not chosen&lt;/code&gt; is the planner&amp;#39;s verdict, not an error. It looked at the index and found nothing in it that could answer the question.&lt;/p&gt;
&lt;h2 id=&quot;why-the-index-cannot-answer-&quot;&gt;Why the index cannot answer -&amp;gt;&amp;gt;&lt;a class=&quot;guide-anchor&quot; href=&quot;#why-the-index-cannot-answer-&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;An index does not index a column. It indexes a column for a set of operators, and that set is the operator class. The default class for &lt;code&gt;jsonb&lt;/code&gt;, &lt;code&gt;jsonb_ops&lt;/code&gt;, stores every key and every value in the document as separate entries. It can answer &lt;code&gt;@&amp;gt;&lt;/code&gt; (contains), &lt;code&gt;?&lt;/code&gt; (has key), &lt;code&gt;?|&lt;/code&gt; and &lt;code&gt;?&amp;amp;&lt;/code&gt; (has any, has all of these keys), and the &lt;code&gt;jsonpath&lt;/code&gt; operators &lt;code&gt;@?&lt;/code&gt; and &lt;code&gt;@@&lt;/code&gt;. That is the whole list. The planner can only use an index for an operator in its class. The &lt;a href=&quot;https://www.postgresql.org/docs/current/datatype-json.html#JSON-INDEXING&quot; rel=&quot;noopener&quot;&gt;JSON indexing&lt;svg class=&quot;guide-icon guide-external&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#arrow-up-right&quot; /&gt;&lt;/svg&gt;&lt;/a&gt; section of the manual has the full table.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;attributes-&amp;gt;&amp;gt;&amp;#39;plan&amp;#39;&lt;/code&gt; is not on the list. It produces a &lt;code&gt;text&lt;/code&gt; value, and &lt;code&gt;=&lt;/code&gt; compares that text. The index holds the key &lt;code&gt;plan&lt;/code&gt; and the JSON value &lt;code&gt;&amp;quot;pro&amp;quot;&lt;/code&gt;. It has never seen the text &lt;code&gt;&amp;#39;pro&amp;#39;&lt;/code&gt;, and does not know that &lt;code&gt;-&amp;gt;&amp;gt;&lt;/code&gt; is how you get from one to the other. So the planner reads the table.&lt;/p&gt;
&lt;p&gt;That is also why the first query works. &lt;code&gt;@&amp;gt; &amp;#39;{&amp;quot;plan&amp;quot;: &amp;quot;pro&amp;quot;}&amp;#39;&lt;/code&gt; asks &amp;quot;does the document contain this&amp;quot;, which is exactly what &lt;code&gt;jsonb_ops&lt;/code&gt; indexes.&lt;/p&gt;
&lt;h2 id=&quot;what-to-do&quot;&gt;What to do&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-do&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Three choices, in the order to try them.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Rewrite to containment&lt;/strong&gt; when the query asks about a fixed key and value. &lt;code&gt;WHERE attributes @&amp;gt; &amp;#39;{&amp;quot;plan&amp;quot;: &amp;quot;pro&amp;quot;}&amp;#39;&lt;/code&gt; says what &lt;code&gt;WHERE attributes-&amp;gt;&amp;gt;&amp;#39;plan&amp;#39; = &amp;#39;pro&amp;#39;&lt;/code&gt; says, with one difference: containment also matches &lt;code&gt;{&amp;quot;plan&amp;quot;: [&amp;quot;pro&amp;quot;, &amp;quot;free&amp;quot;]}&lt;/code&gt;, because an array contains its elements. If your data never puts an array there, the rewrite is free and the existing index answers it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Add an expression index&lt;/strong&gt; when you cannot change the query, or when you need &lt;code&gt;&amp;lt;&lt;/code&gt;, &lt;code&gt;&amp;gt;&lt;/code&gt;, &lt;code&gt;LIKE&lt;/code&gt; or an &lt;code&gt;ORDER BY&lt;/code&gt; on the value, which no GIN class provides:&lt;/p&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-key&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;INDEX&lt;/span&gt; customers_plan_idx
  &lt;span class=&quot;tok-key&quot;&gt;ON&lt;/span&gt; crm.customers ((attributes-&amp;gt;&amp;gt;&lt;span class=&quot;tok-string&quot;&gt;&amp;#39;plan&amp;#39;&lt;/span&gt;));&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;A B-tree on the expression. From then on &lt;code&gt;attributes-&amp;gt;&amp;gt;&amp;#39;plan&amp;#39; = &amp;#39;pro&amp;#39;&lt;/code&gt; is an ordinary indexed equality, and the Plan tab shows an &lt;a class=&quot;guide-term&quot; href=&quot;/guide/index-scan/&quot; data-term-icon=&quot;lightning&quot; data-term-description=&quot;How an Index Scan fetches rows, why 206,880 cheap lookups add up, and what the table&amp;#39;s physical order does to each one.&quot;&gt;&lt;code&gt;Index Scan&lt;/code&gt;&lt;/a&gt; or a &lt;code&gt;Bitmap Index Scan&lt;/code&gt; on &lt;code&gt;customers_plan_idx&lt;/code&gt;. The double parentheses are required, and the expression has to be written exactly as the query writes it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Switch to &lt;code&gt;jsonb_path_ops&lt;/code&gt;&lt;/strong&gt; when every query on the column uses &lt;code&gt;@&amp;gt;&lt;/code&gt;, &lt;code&gt;@?&lt;/code&gt; or &lt;code&gt;@@&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-key&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;INDEX&lt;/span&gt; customers_attributes_idx
  &lt;span class=&quot;tok-key&quot;&gt;ON&lt;/span&gt; crm.customers &lt;span class=&quot;tok-key&quot;&gt;USING&lt;/span&gt; gin (attributes jsonb_path_ops);&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;It hashes each path together with its value instead of storing keys and values apart, so the index is smaller and &lt;code&gt;@&amp;gt;&lt;/code&gt; lookups are faster. It cannot answer &lt;code&gt;?&lt;/code&gt;, &lt;code&gt;?|&lt;/code&gt; or &lt;code&gt;?&amp;amp;&lt;/code&gt; at all. Choose it when you know that.&lt;/p&gt;
&lt;h2 id=&quot;reading-the-json-itself&quot;&gt;Reading the JSON itself&lt;a class=&quot;guide-anchor&quot; href=&quot;#reading-the-json-itself&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;To see what is in &lt;code&gt;attributes&lt;/code&gt; before you index it, open &lt;code&gt;crm.customers&lt;/code&gt;, select a cell in the column, and press Space. The inspector opens the value in &lt;code&gt;Tree&lt;/code&gt; view, with &lt;code&gt;Text&lt;/code&gt; for the raw document. Click a node in the tree and &lt;code&gt;Path to selected node&lt;/code&gt; offers two copies. &lt;code&gt;SQL path&lt;/code&gt;, which for a scalar leaf is &lt;code&gt;attributes-&amp;gt;&amp;gt;&amp;#39;plan&amp;#39;&lt;/code&gt;, is the exact expression the index above wants. &lt;code&gt;JSONPath&lt;/code&gt;, &lt;code&gt;$.plan&lt;/code&gt;, is for &lt;code&gt;@?&lt;/code&gt; and &lt;code&gt;@@&lt;/code&gt;.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/value-inspector-json.webp?v=39facb4567&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/value-inspector-json-800.webp?v=7b2c6770a3&quot; srcset=&quot;/guide/shots/value-inspector-json-800.webp?v=7b2c6770a3 800w, /guide/shots/value-inspector-json.webp?v=39facb4567 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;622&quot; alt=&quot;The value inspector on an attributes cell of crm.customers: a tree of plan, referrer and marketing_opt_in, with Tree and Text.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;/figure&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;About 6% of the sample&amp;#39;s customers carry &lt;code&gt;&amp;quot;plan&amp;quot;: &amp;quot;pro&amp;quot;&lt;/code&gt;. Your drain will show your share, and the finding only fires on an analyzed plan where the scan read at least 10,000 rows and a fifth or less survived.&lt;/li&gt;
&lt;li&gt;The planner will choose a &lt;code&gt;Seq Scan&lt;/code&gt; over a usable index when most rows match. &lt;code&gt;customers&lt;/code&gt; is 54 MB of heap, and a filter that keeps half of it is cheaper to scan. &lt;code&gt;not chosen&lt;/code&gt; with a small drain is the planner being right.&lt;/li&gt;
&lt;li&gt;There are no JSON-path filters in the grid&amp;#39;s &lt;code&gt;Filter rows&lt;/code&gt; box, on any engine. Filter on JSON in the SQL editor.&lt;/li&gt;
&lt;li&gt;MySQL, MariaDB and SQLite have JSON columns and no GIN. Of the three fixes, the expression index is the one that travels. See &lt;a href=&quot;/guide/other-engines/&quot;&gt;MySQL, MariaDB, SQLite and SQL Server&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
&lt;aside class=&quot;guide-why&quot; aria-label=&quot;Why Seqora does it this way&quot;&gt;
&lt;svg class=&quot;guide-icon guide-why-mark&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#quotes&quot; /&gt;&lt;/svg&gt;
&lt;p&gt;The inspector tags every index on the table, &lt;code&gt;✓ used&lt;/code&gt;, &lt;code&gt;not chosen&lt;/code&gt;, &lt;code&gt;not leading&lt;/code&gt;, &lt;code&gt;partial&lt;/code&gt;, not only the one that ran, because nobody opens a plan to ask which index was used. They open it to ask why theirs wasn&amp;#39;t. The tag next to your index answers the question you came with, and the plan around it is the evidence.&lt;/p&gt;
&lt;p class=&quot;guide-why-sign&quot;&gt;&lt;a class=&quot;guide-avatar-link&quot; href=&quot;/about/&quot; aria-label=&quot;About Ayushman&quot;&gt;&lt;img class=&quot;guide-avatar&quot; src=&quot;/avatars/ayushman.jpg&quot; alt=&quot;&quot; width=&quot;96&quot; height=&quot;96&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/a&gt;Ayushman&lt;/p&gt;
&lt;/aside&gt;
</content>
  </entry>
  <entry>
    <title>Value inspector</title>
    <link href="https://seqora.dev/guide/value-inspector/" />
    <id>https://seqora.dev/guide/value-inspector/</id>
    <published>2026-10-17T00:00:00Z</published>
    <updated>2026-10-17T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>What the value inspector shows for a JSON, timestamp, UUID, binary, enum or geometry cell, and the column facts it reads on each engine.</summary>
    <content type="html">&lt;p&gt;Space opens the value inspector beside the grid, and Space closes it. It follows the selection: one cell, a range of cells, a whole row, several rows compared, or a column. &lt;code&gt;Pin inspector&lt;/code&gt; keeps it open across tabs, and reads &lt;code&gt;Unpin inspector&lt;/code&gt; once it is.&lt;/p&gt;
&lt;h2 id=&quot;json&quot;&gt;JSON&lt;a class=&quot;guide-anchor&quot; href=&quot;#json&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Tree&lt;/code&gt; and &lt;code&gt;Text&lt;/code&gt; switch the view.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Path to selected node&lt;/code&gt; gives the clicked node as an &lt;code&gt;SQL path&lt;/code&gt; and as a &lt;code&gt;JSONPath&lt;/code&gt;, each with a copy button.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Shape&lt;/code&gt; and &lt;code&gt;Size&lt;/code&gt; describe the document.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Edit JSON&lt;/code&gt; opens the editor, with &lt;code&gt;Format JSON&lt;/code&gt; (&lt;kbd class=&quot;guide-keys&quot; data-os=&quot;other&quot;&gt;&lt;kbd&gt;Shift&lt;/kbd&gt;&lt;kbd&gt;Alt&lt;/kbd&gt;&lt;kbd&gt;F&lt;/kbd&gt;&lt;/kbd&gt;) and a valid-JSON check. Applying it stages the change like any other edit.&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/value-inspector-json.webp?v=39facb4567&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/value-inspector-json-800.webp?v=7b2c6770a3&quot; srcset=&quot;/guide/shots/value-inspector-json-800.webp?v=7b2c6770a3 800w, /guide/shots/value-inspector-json.webp?v=39facb4567 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;622&quot; alt=&quot;The value inspector beside the customers grid, showing an attributes cell as a tree with Shape, Size, how many loaded rows share the value, and the column&amp;#39;s definition.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;An &lt;code&gt;attributes&lt;/code&gt; cell in &lt;code&gt;crm.customers&lt;/code&gt;.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;other-types&quot;&gt;Other types&lt;a class=&quot;guide-anchor&quot; href=&quot;#other-types&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Timestamps: &lt;code&gt;UTC&lt;/code&gt;, &lt;code&gt;ISO 8601&lt;/code&gt;, &lt;code&gt;Unix&lt;/code&gt; seconds and &lt;code&gt;Unix ms&lt;/code&gt;, each copyable. A value without a zone says &lt;code&gt;No time zone stored&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;UUID: &lt;code&gt;Version&lt;/code&gt; and &lt;code&gt;No dashes&lt;/code&gt;, or &lt;code&gt;Not an RFC 9562 UUID.&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Binary: &lt;code&gt;Byte view&lt;/code&gt; in &lt;code&gt;Hex&lt;/code&gt; or &lt;code&gt;Base64&lt;/code&gt;, with &lt;code&gt;Length&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Enum: &lt;code&gt;Labels in declared order&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Geometry and geography (PostGIS, SQL Server): the shape drawn on a grid, or on a latitude and longitude graticule for geography, with the other loaded rows faint behind it. Then &lt;code&gt;Type&lt;/code&gt;, &lt;code&gt;Vertices&lt;/code&gt;, &lt;code&gt;Bounds&lt;/code&gt;, &lt;code&gt;Area&lt;/code&gt;, &lt;code&gt;Length&lt;/code&gt; or &lt;code&gt;Perimeter&lt;/code&gt;, &lt;code&gt;Nearest row&lt;/code&gt;, and &lt;code&gt;WKT&lt;/code&gt; and &lt;code&gt;GeoJSON&lt;/code&gt; to copy.&lt;/li&gt;
&lt;li&gt;Text, numbers, timestamps and UUIDs also give the value as a &lt;code&gt;SQL literal&lt;/code&gt; to copy.&lt;/li&gt;
&lt;li&gt;Foreign keys: the referenced row under &lt;code&gt;References&lt;/code&gt;, with &lt;code&gt;Open&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;In this table&lt;/code&gt;: how many loaded rows share the value. &lt;code&gt;Count in table&lt;/code&gt; counts the whole table.&lt;/li&gt;
&lt;li&gt;Filters: &lt;code&gt;Filter by this value&lt;/code&gt;, &lt;code&gt;≥ this&lt;/code&gt; and &lt;code&gt;≤ this&lt;/code&gt; on ordered types, &lt;code&gt;Exclude this value&lt;/code&gt;, and on a NULL cell &lt;code&gt;Filter: &amp;lt;column&amp;gt; is null&lt;/code&gt; and &lt;code&gt;Filter: &amp;lt;column&amp;gt; is not null&lt;/code&gt;. Spatial columns have no filters.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;column-facts&quot;&gt;Column facts&lt;a class=&quot;guide-anchor&quot; href=&quot;#column-facts&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Click a column header to select the column, and the inspector shows &lt;code&gt;Definition&lt;/code&gt;, then what the database keeps about the column: &lt;code&gt;Most common values&lt;/code&gt;, &lt;code&gt;NULL&lt;/code&gt;, &lt;code&gt;Distribution&lt;/code&gt;, &lt;code&gt;Avg width&lt;/code&gt; and &lt;code&gt;Correlation&lt;/code&gt;. &lt;code&gt;In the loaded page&lt;/code&gt; counts what is loaded. &lt;code&gt;Run exact&lt;/code&gt; builds an &lt;code&gt;Exact profile&lt;/code&gt; from the whole table.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/value-inspector-column.webp?v=418bb60069&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/value-inspector-column-800.webp?v=8c9bb23b12&quot; srcset=&quot;/guide/shots/value-inspector-column-800.webp?v=8c9bb23b12 800w, /guide/shots/value-inspector-column.webp?v=418bb60069 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;622&quot; alt=&quot;The value inspector showing the status column of orders: its definition and CHECK rule, most common values with shares, and NULL share, with Run exact at the bottom.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;&lt;code&gt;orders.status&lt;/code&gt;, as &lt;code&gt;pg_stats&lt;/code&gt; has it. &lt;code&gt;shipped&lt;/code&gt; holds 82% of the rows.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;div class=&quot;guide-table&quot;&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Engine&lt;/th&gt;
&lt;th&gt;Column facts from&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;PostgreSQL&lt;/td&gt;
&lt;td&gt;&lt;code&gt;pg_stats&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MySQL&lt;/td&gt;
&lt;td&gt;Histograms. Without one: &amp;quot;MySQL has no histogram for this column. ANALYZE TABLE … UPDATE HISTOGRAM builds one.&amp;quot;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MariaDB&lt;/td&gt;
&lt;td&gt;None. &amp;quot;MariaDB’s column statistics (mysql.column_stats) aren’t read here. Use Run exact to count the values.&amp;quot;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SQLite&lt;/td&gt;
&lt;td&gt;None. &amp;quot;SQLite keeps no column statistics. Use Run exact to count the values.&amp;quot;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SQL Server&lt;/td&gt;
&lt;td&gt;None. &amp;quot;SQL Server’s statistics histograms aren’t read here. Use Run exact to count the values.&amp;quot;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;Read: &lt;a href=&quot;/guide/reading-the-stats/&quot;&gt;Reading the stats&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Status bar</title>
    <link href="https://seqora.dev/guide/status-bar/" />
    <id>https://seqora.dev/guide/status-bar/</id>
    <published>2026-10-17T00:00:00Z</published>
    <updated>2026-10-17T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>What the status bar at the bottom of the window shows: the connection and its lock, row counts, selection sums, diagram zoom.</summary>
    <content type="html">&lt;p&gt;The status bar runs along the bottom of the window. Its left side is about the connection, its right side about what you are looking at.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/status-bar-table.webp?v=a10ba4a80f&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/status-bar-table-800.webp?v=fc0e82f809&quot; srcset=&quot;/guide/shots/status-bar-table-800.webp?v=fc0e82f809 800w, /guide/shots/status-bar-table.webp?v=a10ba4a80f 1920w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(960px, 46rem)&quot; width=&quot;960&quot; height=&quot;24&quot; alt=&quot;The status bar on a filtered table tab: rows 1 to 15 of 100 or more matching, Count, the load time, PK id, Encrypted, App ready and the version.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;On a filtered table tab, the left side reads &lt;code&gt;matching&lt;/code&gt;. On a table with no filter it reads the estimate, &lt;code&gt;of ~12M&lt;/code&gt;.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&quot;connection&quot;&gt;Connection&lt;a class=&quot;guide-anchor&quot; href=&quot;#connection&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;A dot for the state: connected, connecting or offline. Then the connection&amp;#39;s name, with &lt;code&gt;Connecting…&lt;/code&gt; or &lt;code&gt;Offline&lt;/code&gt; while it is not connected. Hovering spells it out, with the database when it has another name, as &lt;code&gt;Connected to commerce-primary (commerce) · prod · Commerce&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The environment and workspace, as &lt;code&gt;prod · Commerce&lt;/code&gt;. On a production environment the whole bar turns red and the environment name is set in red text.&lt;/li&gt;
&lt;li&gt;The lock chip: &lt;code&gt;Read-only&lt;/code&gt;, or &lt;code&gt;Writes enabled&lt;/code&gt; once unlocked.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When the window is narrow the bar drops items in this order: the version, then the primary key, the load time, &lt;code&gt;App ready&lt;/code&gt;, &lt;code&gt;Encrypted&lt;/code&gt;, the loaded count and the key hints. The connection, its environment and the lock always stay.&lt;/p&gt;
&lt;h2 id=&quot;rows&quot;&gt;Rows&lt;a class=&quot;guide-anchor&quot; href=&quot;#rows&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;On a table tab:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The visible range and total, such as &lt;code&gt;Rows 1–100 of ~12M · 100 loaded&lt;/code&gt;. A &lt;code&gt;~&lt;/code&gt; marks the catalog estimate.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Count&lt;/code&gt;: counts rows exactly. It gives up after 3 seconds and says so.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Top&lt;/code&gt;, with &lt;code&gt;Mod-ArrowUp&lt;/code&gt;, once you have scrolled past the first screen: back to the first row.&lt;/li&gt;
&lt;li&gt;The time the latest page took to load.&lt;/li&gt;
&lt;li&gt;The primary key the grid orders by, as &lt;code&gt;PK: id&lt;/code&gt;, or &lt;code&gt;Unordered&lt;/code&gt; when the table has none.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;On a query result it shows &lt;code&gt;N rows loaded&lt;/code&gt; instead.&lt;/p&gt;
&lt;h2 id=&quot;selection&quot;&gt;Selection&lt;a class=&quot;guide-anchor&quot; href=&quot;#selection&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;kbd class=&quot;guide-keys&quot;&gt;&lt;kbd&gt;Space&lt;/kbd&gt;&lt;/kbd&gt; with the next action: &lt;code&gt;Inspect value&lt;/code&gt;, &lt;code&gt;Summarize cells&lt;/code&gt;, &lt;code&gt;Inspect row&lt;/code&gt;, &lt;code&gt;Compare rows&lt;/code&gt;, &lt;code&gt;Profile column&lt;/code&gt;, or &lt;code&gt;Close inspector&lt;/code&gt;. Clicking it does the same as the key.&lt;/li&gt;
&lt;li&gt;With several cells selected, a chip shows statistics such as &lt;code&gt;Sum&lt;/code&gt; and &lt;code&gt;Average&lt;/code&gt;. Its menu picks which ones to show from &lt;code&gt;Sum&lt;/code&gt;, &lt;code&gt;Average&lt;/code&gt;, &lt;code&gt;Median&lt;/code&gt;, &lt;code&gt;Min&lt;/code&gt;, &lt;code&gt;Max&lt;/code&gt;, &lt;code&gt;Count&lt;/code&gt;, &lt;code&gt;Distinct&lt;/code&gt; and &lt;code&gt;NULL&lt;/code&gt;. Clicking a value copies it.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;diagrams&quot;&gt;Diagrams&lt;a class=&quot;guide-anchor&quot; href=&quot;#diagrams&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;On an ER diagram or a design: &lt;code&gt;Zoom out&lt;/code&gt; (&lt;code&gt;-&lt;/code&gt;), the zoom level, which fits the diagram when clicked, and &lt;code&gt;Zoom in&lt;/code&gt; (&lt;code&gt;+&lt;/code&gt;).&lt;/p&gt;
&lt;h2 id=&quot;always&quot;&gt;Always&lt;a class=&quot;guide-anchor&quot; href=&quot;#always&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;Activity&lt;/code&gt; while an export runs or after one finishes, with its progress, and the list of exports on click. &lt;code&gt;Encrypted&lt;/code&gt; when saved connections are encrypted, with the file, cipher and key on click. &lt;code&gt;App ready&lt;/code&gt; once Seqora&amp;#39;s native side has started, which says nothing about the connection or the last query, and the version, &lt;code&gt;Seqora v0.6.1&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Query status is not here. It sits in the SQL editor&amp;#39;s footer.&lt;/p&gt;
&lt;p&gt;Read: &lt;a href=&quot;/guide/connect/&quot;&gt;Connect&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Seq Scan</title>
    <link href="https://seqora.dev/guide/seq-scan/" />
    <id>https://seqora.dev/guide/seq-scan/</id>
    <published>2026-10-17T00:00:00Z</published>
    <updated>2026-10-17T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>What a Seq Scan reads, the kept-to-read ratio that tells you it is the problem, and the index that replaces it.</summary>
    <content type="html">&lt;p&gt;A Seq Scan reads a table from its first page to its last and tests every row against the
&lt;code&gt;WHERE&lt;/code&gt; clause. In the sample plan, &lt;code&gt;Seq Scan on commerce.orders&lt;/code&gt; reads all 12,000,000 orders
to find the 206,880 placed on the web in the last 30 days, and throws the other 11,793,120
away. That one node takes 1,640 ms of the query&amp;#39;s 4,581 ms.&lt;/p&gt;
&lt;h2 id=&quot;why-it-matters&quot;&gt;Why it matters&lt;a class=&quot;guide-anchor&quot; href=&quot;#why-it-matters&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A Seq Scan is right when the query needs most of the table. It is the problem when the table
is large and the filter keeps little. The ratio to look at is rows kept over rows read.
&lt;code&gt;orders&lt;/code&gt; keeps 1.7%. Seqora flags a scan that keeps 20% or less of 10,000 rows or more.
There is no index starting with &lt;code&gt;channel&lt;/code&gt;, so the planner had nothing better.&lt;/p&gt;
&lt;h2 id=&quot;what-to-do&quot;&gt;What to do&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-do&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Read the filter. Equality columns go first in the index, range columns after: &lt;code&gt;channel&lt;/code&gt;,
then &lt;code&gt;placed_at&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Create it:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-key&quot;&gt;CREATE&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;INDEX&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;CONCURRENTLY&lt;/span&gt; orders_channel_placed_idx
  &lt;span class=&quot;tok-key&quot;&gt;ON&lt;/span&gt; commerce.orders (channel, placed_at &lt;span class=&quot;tok-key&quot;&gt;DESC&lt;/span&gt;);&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;Run the query again and confirm the node is now an &lt;a href=&quot;/guide/index-scan/&quot;&gt;Index Scan&lt;/a&gt; or a
&lt;a href=&quot;/guide/bitmap-heap-scan/&quot;&gt;Bitmap Heap Scan&lt;/a&gt;. If it is still a Seq Scan, read
&lt;a href=&quot;/guide/will-this-index-help/&quot;&gt;Will this index help?&lt;/a&gt; before dropping anything.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;in-the-plan-tab&quot;&gt;In the Plan tab&lt;a class=&quot;guide-anchor&quot; href=&quot;#in-the-plan-tab&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;a href=&quot;/guide/plan-tab/&quot;&gt;wheel&lt;/a&gt; beside the node is the table. Double-click it for the &lt;code&gt;TABLE WHEEL&lt;/code&gt; guide, which
labels it the way the figure does.&lt;/p&gt;
&lt;figure class=&quot;guide-figure&quot;&gt;
&lt;div class=&quot;guide-figure-stage frame&quot; data-island=&quot;plan-wheel&quot;&gt;
&lt;div class=&quot;app-surface&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The wheel beside Seq Scan on orders, with the guide&amp;#39;s own labels.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;figcaption&gt;
&lt;p&gt;The wheel beside &lt;code&gt;Seq Scan on orders&lt;/code&gt;, with the guide&amp;#39;s own labels.&lt;/p&gt;
&lt;ol class=&quot;guide-legend&quot;&gt;
&lt;li&gt;&lt;code&gt;Blue · rows kept&lt;/code&gt; is where the 206,880 kept rows sit on the rim, &lt;code&gt;2% of rows read&lt;/code&gt;. The
wheel rounds to a whole percent above 1%; the exact share is 1.7%.
It is one stretch because &lt;code&gt;placed_at&lt;/code&gt; follows the order rows were written.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Rim · the table&lt;/code&gt; is every page of &lt;code&gt;orders&lt;/code&gt; in physical order, 183,000 of them.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Arrow · full scan&lt;/code&gt; means the scan read all of them to reach the blue. An index on
&lt;code&gt;channel, placed_at&lt;/code&gt; would enter the rim at the blue stretch and read little else.&lt;/li&gt;
&lt;/ol&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;In the flow, the &lt;a href=&quot;/guide/rows-removed-by-filter/&quot;&gt;rows the filter removed&lt;/a&gt; drain off below the band as &lt;code&gt;−11.8M&lt;/code&gt;. The finding
reads &lt;code&gt;Seq Scan on orders&lt;/code&gt;, &lt;code&gt;keeps 2% · 36% of time&lt;/code&gt;, with &lt;code&gt;Test index&lt;/code&gt; on PostgreSQL. On an
engine without hypothetical indexes the card offers &lt;code&gt;Copy CREATE INDEX&lt;/code&gt; instead.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;A Seq Scan of a table that sits in &lt;code&gt;shared_buffers&lt;/code&gt; is cheap. 181,796 of the 183,000 pages
of &lt;code&gt;orders&lt;/code&gt; &lt;a href=&quot;/guide/buffers/&quot;&gt;came from disk&lt;/a&gt;, which is why this one hurt.&lt;/li&gt;
&lt;li&gt;The Plan tab numbers come from a 12-million-row copy. Yours will be smaller.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry>
    <title>Index Scan</title>
    <link href="https://seqora.dev/guide/index-scan/" />
    <id>https://seqora.dev/guide/index-scan/</id>
    <published>2026-10-17T00:00:00Z</published>
    <updated>2026-10-17T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>How an Index Scan fetches rows, why 206,880 cheap lookups add up, and what the table&#39;s physical order does to each one.</summary>
    <content type="html">&lt;p&gt;An Index Scan walks a B-tree to the entries that match the &lt;code&gt;Index Cond&lt;/code&gt;, then fetches each
matching row from the table, in index order. In the sample, &lt;code&gt;Index Scan using order_items_order_idx on order_items&lt;/code&gt; finds one order&amp;#39;s items, 3 rows per lookup, and &lt;a href=&quot;/guide/loops/&quot;&gt;runs
206,880 times&lt;/a&gt; because a &lt;a href=&quot;/guide/nested-loop/&quot;&gt;Nested Loop&lt;/a&gt; sits above it. &lt;code&gt;Index Scan using customers_pkey on customers&lt;/code&gt; runs 620,640 times, one row each.&lt;/p&gt;
&lt;h2 id=&quot;why-it-matters&quot;&gt;Why it matters&lt;a class=&quot;guide-anchor&quot; href=&quot;#why-it-matters&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;It is the right plan for a few rows out of many: one customer&amp;#39;s orders, a primary key
lookup. It goes wrong in two ways. Too many rows, and fetching them one by one costs more
than a &lt;a href=&quot;/guide/seq-scan/&quot;&gt;Seq Scan&lt;/a&gt;. Too many loops, and a cheap lookup becomes expensive by
repetition: 3 rows × 206,880 loops is 620,640 fetches. Physical order matters too.
&lt;code&gt;order_items.order_id&lt;/code&gt; has a correlation of 0.97, so one order&amp;#39;s items share a page.
&lt;code&gt;customers.id&lt;/code&gt; has 0.01, so each of the 620,640 lookups lands on a page of its own.&lt;/p&gt;
&lt;h2 id=&quot;what-to-do&quot;&gt;What to do&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-do&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Look at the loop count before the row count. 206,880 loops is a planner decision: &lt;a href=&quot;/guide/estimated-rows/&quot;&gt;it
expected 612&lt;/a&gt;. &lt;code&gt;ANALYZE commerce.orders&lt;/code&gt; corrects that and the planner switches to a
&lt;a href=&quot;/guide/hash-join/&quot;&gt;Hash Join&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;A &lt;a href=&quot;/guide/rows-removed-by-filter/&quot;&gt;&lt;code&gt;Filter&lt;/code&gt; line&lt;/a&gt; under the &lt;code&gt;Index Cond&lt;/code&gt; means the index does not cover the whole &lt;code&gt;WHERE&lt;/code&gt;.
Add the filtered column, equality columns first.&lt;/li&gt;
&lt;li&gt;A scan returning a large share of the table is the planner&amp;#39;s call. With fresh statistics
it picks a &lt;a class=&quot;guide-term&quot; href=&quot;/guide/bitmap-heap-scan/&quot; data-term-icon=&quot;grid-four&quot; data-term-description=&quot;The two-node scan for the middle ground, what a lossy bitmap costs, and how to read the exact and lossy page counts.&quot;&gt;Bitmap Heap Scan&lt;/a&gt; or a &lt;a class=&quot;guide-term&quot; href=&quot;/guide/seq-scan/&quot; data-term-icon=&quot;list-dashes&quot; data-term-description=&quot;What a Seq Scan reads, the kept-to-read ratio that tells you it is the problem, and the index that replaces it.&quot;&gt;Seq Scan&lt;/a&gt; on its own.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;in-the-plan-tab&quot;&gt;In the Plan tab&lt;a class=&quot;guide-anchor&quot; href=&quot;#in-the-plan-tab&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The hub of the &lt;a href=&quot;/guide/plan-tab/&quot;&gt;table wheel&lt;/a&gt; is the index and the spokes are the lookups. The sample has one Index Scan of
each kind, and the &lt;code&gt;TABLE WHEEL&lt;/code&gt; guide shows all five ways a scan reaches a table so you can
match yours.&lt;/p&gt;
&lt;figure class=&quot;guide-figure&quot;&gt;
&lt;div class=&quot;guide-figure-stage frame&quot; data-island=&quot;plan-wheels&quot;&gt;
&lt;div class=&quot;app-surface&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The five ways a scan reaches a table, as the TABLE WHEEL guide draws them.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;figcaption&gt;
&lt;p&gt;The five ways a scan reaches a table, as the &lt;code&gt;TABLE WHEEL&lt;/code&gt; guide draws them.&lt;/p&gt;
&lt;ol class=&quot;guide-legend&quot;&gt;
&lt;li&gt;&lt;code&gt;Seq Scan&lt;/code&gt; reads the whole rim. It is here for contrast: no hub, no spokes.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Index Scan · in order&lt;/code&gt; is the wheel of &lt;code&gt;order_items&lt;/code&gt;. The spokes land in one short arc
because &lt;code&gt;order_id&lt;/code&gt; has a correlation of 0.97, so one order&amp;#39;s items share a page.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Index Scan · scattered&lt;/code&gt; is the wheel of &lt;code&gt;customers&lt;/code&gt;. The same lookups fan out across the
rim because &lt;code&gt;customers.id&lt;/code&gt; has 0.01, so each of the 620,640 lookups costs a page of its own.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Index Only Scan&lt;/code&gt; answers from the hub and leaves the rim dark.
&lt;a href=&quot;/guide/index-only-scan/&quot;&gt;Index Only Scan&lt;/a&gt; is that page.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Bitmap Heap Scan&lt;/code&gt; collects the pages first and reads each once, in order.
&lt;a href=&quot;/guide/bitmap-heap-scan/&quot;&gt;Bitmap Heap Scan&lt;/a&gt; is that page.&lt;/li&gt;
&lt;/ol&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Under the bands, &lt;code&gt;↻ ×207K ┅ ×612&lt;/code&gt; and &lt;code&gt;↻ ×621K ┅ ×1,836&lt;/code&gt; are the loops against the loops the
planner expected, and the inspector&amp;#39;s &lt;code&gt;Rows per loop&lt;/code&gt; ruler reads 3 and 1, &lt;code&gt;on target&lt;/code&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Index Only Scan</title>
    <link href="https://seqora.dev/guide/index-only-scan/" />
    <id>https://seqora.dev/guide/index-only-scan/</id>
    <published>2026-10-17T00:00:00Z</published>
    <updated>2026-10-17T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>When an index answers the query alone, what Heap Fetches means, and why VACUUM is the fix.</summary>
    <content type="html">&lt;p&gt;An Index Only Scan answers the query from the index and never opens the table. It is
possible when every column the query needs is in the index, as a key or in its &lt;code&gt;INCLUDE&lt;/code&gt;
list. &lt;code&gt;invoices_customer_created_idx&lt;/code&gt; is &lt;code&gt;(customer_id, created_at DESC) INCLUDE (status)&lt;/code&gt;,
so &lt;code&gt;SELECT created_at, status FROM billing.invoices WHERE customer_id = $1&lt;/code&gt; can be answered
by it without touching the heap.&lt;/p&gt;
&lt;h2 id=&quot;why-it-matters&quot;&gt;Why it matters&lt;a class=&quot;guide-anchor&quot; href=&quot;#why-it-matters&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The catch is visibility. An index does not know which transactions can see a row, so
PostgreSQL checks the visibility map. That is one bit per page, set when every row on it is
visible to everyone. Pages with the bit are skipped. Pages without it force a heap fetch, the read
the scan was meant to avoid. &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt; prints &lt;code&gt;Heap Fetches: N&lt;/code&gt;. Zero is the goal. A
count near the rows returned means you are paying for an &lt;a href=&quot;/guide/index-scan/&quot;&gt;Index Scan&lt;/a&gt;.
&lt;code&gt;invoices&lt;/code&gt; has had 1,000,000 updates, and each one clears the bit on its page until the next
&lt;code&gt;VACUUM&lt;/code&gt; sets it again.&lt;/p&gt;
&lt;h2 id=&quot;what-to-do&quot;&gt;What to do&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-do&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;VACUUM billing.invoices&lt;/code&gt;. Only vacuum sets visibility map bits. &lt;code&gt;ANALYZE&lt;/code&gt; does not.&lt;/li&gt;
&lt;li&gt;If the fetches come back, the table changes faster than autovacuum keeps up. Lower its
threshold:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-key&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;TABLE&lt;/span&gt; billing.invoices &lt;span class=&quot;tok-key&quot;&gt;SET&lt;/span&gt; (autovacuum_vacuum_scale_factor = &lt;span class=&quot;tok-number&quot;&gt;0.02&lt;/span&gt;);&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;ol start=&quot;3&quot;&gt;
&lt;li&gt;An &lt;a class=&quot;guide-term&quot; href=&quot;/guide/index-scan/&quot; data-term-icon=&quot;lightning&quot; data-term-description=&quot;How an Index Scan fetches rows, why 206,880 cheap lookups add up, and what the table&amp;#39;s physical order does to each one.&quot;&gt;Index Scan&lt;/a&gt; where you expected an Index Only Scan means a column is missing from the
index. &lt;code&gt;INCLUDE&lt;/code&gt; adds it without making it part of the key.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;in-the-plan-tab&quot;&gt;In the Plan tab&lt;a class=&quot;guide-anchor&quot; href=&quot;#in-the-plan-tab&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;a href=&quot;/guide/plan-tab/&quot;&gt;table wheel&lt;/a&gt; matches the &lt;code&gt;Index Only Scan&lt;/code&gt; pattern, the fourth of the five the &lt;code&gt;TABLE WHEEL&lt;/code&gt;
guide draws.&lt;/p&gt;
&lt;figure class=&quot;guide-figure&quot;&gt;
&lt;div class=&quot;guide-figure-stage frame&quot; data-island=&quot;plan-wheels&quot;&gt;
&lt;div class=&quot;app-surface&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The five ways a scan reaches a table, as the TABLE WHEEL guide draws them.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;figcaption&gt;
&lt;p&gt;The five ways a scan reaches a table, as the &lt;code&gt;TABLE WHEEL&lt;/code&gt; guide draws them.&lt;/p&gt;
&lt;ol class=&quot;guide-legend&quot;&gt;
&lt;li&gt;&lt;code&gt;Seq Scan&lt;/code&gt; reads the whole rim: every page, whatever the query needed.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Index Scan · in order&lt;/code&gt; fetches every row from the table through the spokes, in a short
arc. Each spoke is a page read the Index Only Scan avoids.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Index Scan · scattered&lt;/code&gt; fetches the same way, across the whole rim. The cost the Index
Only Scan saves is largest here.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Index Only Scan&lt;/code&gt; is this node: the hub answers the query and the rim stays dark. The lit
segments are heap fetches, pages the visibility map could not vouch for, and each one is
the read the scan was meant to avoid.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Bitmap Heap Scan&lt;/code&gt; collects the pages first and reads each once. It still reads the heap.&lt;/li&gt;
&lt;/ol&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;In the guide for a real wheel the fetches are labelled &lt;code&gt;Lit · heap fetches&lt;/code&gt;. The count itself
is not in the inspector. Hover the wheel&amp;#39;s spokes for an &lt;code&gt;Index lookups&lt;/code&gt; card with
&lt;code&gt;Heap fetches&lt;/code&gt; and the number, or the rim for &lt;code&gt;Heap visited&lt;/code&gt; as a share of the table. The raw
figure is in &lt;code&gt;Raw plan JSON&lt;/code&gt; as &lt;code&gt;Heap Fetches&lt;/code&gt;.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;An Index Only Scan can carry a &lt;code&gt;Filter&lt;/code&gt; on a column the index lacks. The heap is fetched
for it anyway, and the node is an Index Scan in all but name.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry>
    <title>Bitmap Heap Scan</title>
    <link href="https://seqora.dev/guide/bitmap-heap-scan/" />
    <id>https://seqora.dev/guide/bitmap-heap-scan/</id>
    <published>2026-10-17T00:00:00Z</published>
    <updated>2026-10-17T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>The two-node scan for the middle ground, what a lossy bitmap costs, and how to read the exact and lossy page counts.</summary>
    <content type="html">&lt;p&gt;A Bitmap Heap Scan is two nodes. The &lt;code&gt;Bitmap Index Scan&lt;/code&gt; under it walks the index and, instead
of fetching rows as it goes, marks every matching page in a bitmap. The Bitmap Heap Scan
then reads those pages once each, in physical order, and rechecks the condition on every row.
It is the planner&amp;#39;s middle ground: too many rows for an &lt;a href=&quot;/guide/index-scan/&quot;&gt;Index Scan&lt;/a&gt; to
fetch one at a time, too few for a &lt;a href=&quot;/guide/seq-scan/&quot;&gt;Seq Scan&lt;/a&gt;. &lt;code&gt;SELECT * FROM commerce.orders WHERE status = &amp;#39;cancelled&amp;#39;&lt;/code&gt; on &lt;code&gt;orders_status_placed_idx&lt;/code&gt; is the shape, where
&lt;code&gt;status&lt;/code&gt; has a correlation of 0.04.&lt;/p&gt;
&lt;h2 id=&quot;why-it-matters&quot;&gt;Why it matters&lt;a class=&quot;guide-anchor&quot; href=&quot;#why-it-matters&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Fine while the bitmap stays exact. It lives in &lt;code&gt;work_mem&lt;/code&gt;, and when it outgrows that
PostgreSQL stops tracking rows and tracks whole pages. The scan then reads every row on those
pages, counting the ones that fail as &lt;a href=&quot;/guide/rows-removed-by-filter/&quot;&gt;&lt;code&gt;Rows Removed by Index Recheck&lt;/code&gt;&lt;/a&gt;. &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt;
prints &lt;code&gt;Heap Blocks: exact=N lossy=M&lt;/code&gt;, and any &lt;code&gt;lossy&lt;/code&gt; above zero means the bitmap
overflowed.&lt;/p&gt;
&lt;h2 id=&quot;what-to-do&quot;&gt;What to do&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-do&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;If &lt;code&gt;lossy&lt;/code&gt; is above zero, raise &lt;code&gt;work_mem&lt;/code&gt; for the session and run again.&lt;/li&gt;
&lt;li&gt;If the recheck removes most rows and the bitmap was exact, the index condition is weaker
than the filter. Add the filtered column to the index.&lt;/li&gt;
&lt;li&gt;If the scan keeps most of the table, it is a &lt;a class=&quot;guide-term&quot; href=&quot;/guide/seq-scan/&quot; data-term-icon=&quot;list-dashes&quot; data-term-description=&quot;What a Seq Scan reads, the kept-to-read ratio that tells you it is the problem, and the index that replaces it.&quot;&gt;Seq Scan&lt;/a&gt; with extra steps. Check the
estimate first. &lt;a href=&quot;/guide/estimated-rows/&quot;&gt;Estimated rows&lt;/a&gt; explains the &lt;code&gt;≈N&lt;/code&gt; label.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;in-the-plan-tab&quot;&gt;In the Plan tab&lt;a class=&quot;guide-anchor&quot; href=&quot;#in-the-plan-tab&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;Bitmap Index Scan&lt;/code&gt; is folded into its Bitmap Heap Scan, so the &lt;a href=&quot;/guide/plan-tab/&quot;&gt;Plan tab&lt;/a&gt;
draws one node. Its wheel
matches the last of the five patterns the &lt;code&gt;TABLE WHEEL&lt;/code&gt; guide draws.&lt;/p&gt;
&lt;figure class=&quot;guide-figure&quot;&gt;
&lt;div class=&quot;guide-figure-stage frame&quot; data-island=&quot;plan-wheels&quot;&gt;
&lt;div class=&quot;app-surface&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The five ways a scan reaches a table, as the TABLE WHEEL guide draws them.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;figcaption&gt;
&lt;p&gt;The five ways a scan reaches a table, as the &lt;code&gt;TABLE WHEEL&lt;/code&gt; guide draws them.&lt;/p&gt;
&lt;ol class=&quot;guide-legend&quot;&gt;
&lt;li&gt;&lt;code&gt;Seq Scan&lt;/code&gt; reads the whole rim. A bitmap scan that keeps most of the table ends up here
with extra steps.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Index Scan · in order&lt;/code&gt; fetches rows one at a time through the spokes, in a short arc.
When the rows sit together like this, the bitmap buys little.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Index Scan · scattered&lt;/code&gt; fetches rows one at a time across the whole rim, in index order.
This is the case the bitmap is for: too many rows to fetch one by one.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Index Only Scan&lt;/code&gt; answers from the hub and never opens the table.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Bitmap Heap Scan&lt;/code&gt; is this node: the spokes are the page bitmap, not lookups, and the rim is
read once, in page order. Lossy pages are drawn as their own rim segments, each read whole
and rechecked row by row.&lt;/li&gt;
&lt;/ol&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The finding reads &lt;code&gt;Bitmap went lossy&lt;/code&gt;, &lt;code&gt;N lossy pages rechecked&lt;/code&gt;, with a &lt;code&gt;Retry ·&lt;/code&gt; button
carrying the next &lt;code&gt;work_mem&lt;/code&gt; to try.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;A GIN index like &lt;code&gt;customers_attributes_idx&lt;/code&gt; is always used through a bitmap. That one is
not a sign of anything.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry>
    <title>Nested Loop</title>
    <link href="https://seqora.dev/guide/nested-loop/" />
    <id>https://seqora.dev/guide/nested-loop/</id>
    <published>2026-10-17T00:00:00Z</published>
    <updated>2026-10-17T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>The join that runs its inner side once per outer row, why it was right for 612 rows and wrong for 206,880, and the one fix.</summary>
    <content type="html">&lt;p&gt;A Nested Loop takes each row from its outer input and runs the inner input once for it. The
inner side is usually an &lt;a href=&quot;/guide/index-scan/&quot;&gt;Index Scan&lt;/a&gt; that looks up the matching rows. In
the sample, the outer is the &lt;a class=&quot;guide-term&quot; href=&quot;/guide/seq-scan/&quot; data-term-icon=&quot;list-dashes&quot; data-term-description=&quot;What a Seq Scan reads, the kept-to-read ratio that tells you it is the problem, and the index that replaces it.&quot;&gt;Seq Scan&lt;/a&gt; on &lt;code&gt;orders&lt;/code&gt;, 206,880 rows, so the inner &lt;a class=&quot;guide-term&quot; href=&quot;/guide/index-scan/&quot; data-term-icon=&quot;lightning&quot; data-term-description=&quot;How an Index Scan fetches rows, why 206,880 cheap lookups add up, and what the table&amp;#39;s physical order does to each one.&quot;&gt;&lt;code&gt;Index Scan using order_items_order_idx&lt;/code&gt;&lt;/a&gt; &lt;a href=&quot;/guide/loops/&quot;&gt;runs 206,880 times&lt;/a&gt;. The loop above takes the 620,640 items and
looks up &lt;code&gt;customers&lt;/code&gt; 620,640 times.&lt;/p&gt;
&lt;h2 id=&quot;why-it-matters&quot;&gt;Why it matters&lt;a class=&quot;guide-anchor&quot; href=&quot;#why-it-matters&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;It is the best join when the outer side is small and the inner lookup is indexed: ten
orders, ten lookups. It is the worst when the outer side is big, because the cost is outer
rows times one lookup. The planner chose it here because it expected 612 web orders. 206,880
was 338× more, and 620,640 lookups on &lt;code&gt;customers&lt;/code&gt; at a correlation of 0.01 is 620,640 random
pages. Check the outer row count against &lt;a href=&quot;/guide/estimated-rows/&quot;&gt;its estimate&lt;/a&gt;. When that is right, the join choice
usually is too.&lt;/p&gt;
&lt;h2 id=&quot;what-to-do&quot;&gt;What to do&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-do&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Fix the estimate first. &lt;code&gt;ANALYZE commerce.orders&lt;/code&gt;, and the planner switches to
&lt;a href=&quot;/guide/hash-join/&quot;&gt;Hash Joins&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;If the estimate is right and the loop still slow, make each lookup cheaper: an index
covering the join column and the filter, so a loop reads one page.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SET enable_nestloop = off&lt;/code&gt; for one run shows whether the alternative is faster. Use it to
learn, not as the fix.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;in-the-plan-tab&quot;&gt;In the Plan tab&lt;a class=&quot;guide-anchor&quot; href=&quot;#in-the-plan-tab&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In the &lt;a href=&quot;/guide/plan-tab/&quot;&gt;row flow&lt;/a&gt;, the band out of the inner node carries &lt;code&gt;↻ ×207K ┅ ×612&lt;/code&gt;,
the loops against the planner&amp;#39;s, drawn red when the two are 10× or more apart. The inspector&amp;#39;s &lt;code&gt;Loops&lt;/code&gt; ruler reads &lt;code&gt;338× more&lt;/code&gt;. The time
strip shows both index scans as their own segments, so you can see that the lookups, not the
join, took the time.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/plan-nested-loop.webp?v=eca31c9f6c&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/plan-nested-loop-800.webp?v=49e956b347&quot; srcset=&quot;/guide/shots/plan-nested-loop-800.webp?v=49e956b347 800w, /guide/shots/plan-nested-loop.webp?v=eca31c9f6c 1872w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(936px, 46rem)&quot; width=&quot;936&quot; height=&quot;919&quot; alt=&quot;The Plan tab for a join on one customer&amp;#39;s orders: Index Scans on orders and order_items feeding a Nested Loop, the inner one marked as 37 loops, with the Nested Loop selected.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;One customer&amp;#39;s orders and their items: 37 orders, so &lt;code&gt;order_items&lt;/code&gt; is scanned 37 times. The outer side is small and each lookup is indexed, which is this join at its best, and there are no findings.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
</content>
  </entry>
  <entry>
    <title>Hash Join</title>
    <link href="https://seqora.dev/guide/hash-join/" />
    <id>https://seqora.dev/guide/hash-join/</id>
    <published>2026-10-17T00:00:00Z</published>
    <updated>2026-10-17T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>The join that reads each side once, what Batches above 1 means, and when to raise work_mem for it.</summary>
    <content type="html">&lt;p&gt;A Hash Join reads its inner input once and builds a hash table in memory, keyed on the join
column. Then it reads the outer input once and probes the table for each row. Each side is
read once, which is why it wins when both are large. In the sample, after &lt;code&gt;ANALYZE commerce.orders&lt;/code&gt; corrects the estimate from 612 to 206,880, the planner drops the
&lt;a href=&quot;/guide/nested-loop/&quot;&gt;Nested Loops&lt;/a&gt; and joins &lt;code&gt;orders&lt;/code&gt;, &lt;code&gt;order_items&lt;/code&gt; and &lt;code&gt;customers&lt;/code&gt; with Hash
Joins instead.&lt;/p&gt;
&lt;h2 id=&quot;why-it-matters&quot;&gt;Why it matters&lt;a class=&quot;guide-anchor&quot; href=&quot;#why-it-matters&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The hash table has to fit in &lt;code&gt;work_mem&lt;/code&gt;. When it does not, PostgreSQL splits both inputs into
batches and writes all but the current one to &lt;a href=&quot;/guide/buffers/&quot;&gt;temp files&lt;/a&gt;. The &lt;code&gt;Hash&lt;/code&gt; node prints &lt;code&gt;Buckets: N Batches: M Memory Usage: NkB&lt;/code&gt;. &lt;code&gt;Batches: 1&lt;/code&gt; is the good case. Anything above 1 means the join
went to disk. The sample runs at &lt;code&gt;work_mem = 4MB&lt;/code&gt;, enough for 206,880 orders, not for
37,200,000 &lt;code&gt;order_items&lt;/code&gt;. The planner hashes the smaller side, so a huge hash table is
usually &lt;a href=&quot;/guide/estimated-rows/&quot;&gt;an estimate problem&lt;/a&gt; first.&lt;/p&gt;
&lt;h2 id=&quot;what-to-do&quot;&gt;What to do&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-do&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;If &lt;code&gt;Batches&lt;/code&gt; is above 1, check which side was hashed. The &lt;code&gt;Hash&lt;/code&gt; node&amp;#39;s rows are the inner
input. If that is the bigger table, the planner misjudged the sizes: &lt;code&gt;ANALYZE&lt;/code&gt; both.&lt;/li&gt;
&lt;li&gt;If the sizes are right, raise &lt;code&gt;work_mem&lt;/code&gt; for that session, &lt;code&gt;SET work_mem = &amp;#39;16MB&amp;#39;&lt;/code&gt;, and run
again. Not globally: every &lt;a href=&quot;/guide/sort/&quot;&gt;sort&lt;/a&gt; and hash in every connection can take that much.&lt;/li&gt;
&lt;li&gt;A filter that cuts the inner side before the join shrinks the hash table too.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;in-the-plan-tab&quot;&gt;In the Plan tab&lt;a class=&quot;guide-anchor&quot; href=&quot;#in-the-plan-tab&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;Hash&lt;/code&gt; node is folded into its Hash Join, so one node in the &lt;a href=&quot;/guide/plan-tab/&quot;&gt;Plan tab&lt;/a&gt;
carries both. A join that batched
shows a spill label on the node, &lt;code&gt;N MB disk&lt;/code&gt;, and the finding &lt;code&gt;Hash Join spilled to disk&lt;/code&gt;
with &lt;code&gt;work_mem 4MB&lt;/code&gt; and a &lt;code&gt;Retry ·&lt;/code&gt; button. The inspector&amp;#39;s &lt;code&gt;Memory&lt;/code&gt; bar marks where
&lt;code&gt;work_mem&lt;/code&gt; sits against what the join used.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/plan-hash-join.webp?v=a7a10e8a58&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/plan-hash-join-800.webp?v=64d355db6f&quot; srcset=&quot;/guide/shots/plan-hash-join-800.webp?v=64d355db6f 800w, /guide/shots/plan-hash-join.webp?v=a7a10e8a58 1872w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(936px, 46rem)&quot; width=&quot;936&quot; height=&quot;919&quot; alt=&quot;The Plan tab for a report joining orders and customers: Seq Scans feeding a Hash Join and a HashAggregate, spill labels under both, and findings for the scan and the spill.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;Web orders from the last 30 days joined to &lt;code&gt;customers&lt;/code&gt;. The join is selected, its &lt;code&gt;Memory&lt;/code&gt; bar sets what it used against &lt;code&gt;work_mem&lt;/code&gt;, and the finding offers a &lt;code&gt;Retry ·&lt;/code&gt; at more memory.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
</content>
  </entry>
  <entry>
    <title>Merge Join</title>
    <link href="https://seqora.dev/guide/merge-join/" />
    <id>https://seqora.dev/guide/merge-join/</id>
    <published>2026-10-17T00:00:00Z</published>
    <updated>2026-10-17T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>The join that walks two sorted inputs together, when the order comes free, and when it is paying for a Sort it did not need.</summary>
    <content type="html">&lt;p&gt;A Merge Join reads two inputs already sorted on the join key and walks them together. Each
side is read once and the output comes out sorted. The plan has either a &lt;a href=&quot;/guide/sort/&quot;&gt;Sort&lt;/a&gt;
under each side or an index scan that delivers rows in key order. Joining all of
&lt;code&gt;commerce.orders&lt;/code&gt; to all of &lt;code&gt;commerce.order_items&lt;/code&gt; on &lt;code&gt;order_id&lt;/code&gt; is the shape. &lt;code&gt;orders_pkey&lt;/code&gt;
gives orders in &lt;code&gt;id&lt;/code&gt; order and &lt;code&gt;order_items_order_idx&lt;/code&gt; gives items in &lt;code&gt;order_id&lt;/code&gt; order, so no
Sort is needed.&lt;/p&gt;
&lt;h2 id=&quot;why-it-matters&quot;&gt;Why it matters&lt;a class=&quot;guide-anchor&quot; href=&quot;#why-it-matters&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Fine when the order comes free from an index, or when the query needs sorted output anyway.
The problem is a Merge Join that needs a Sort of a large input, because that Sort costs more
than hashing would. At &lt;code&gt;work_mem = 4MB&lt;/code&gt; a sort of 12,000,000 orders goes to disk. Look
under the join. Index scans in key order: cheap. A &lt;code&gt;Sort&lt;/code&gt; with &lt;code&gt;external merge&lt;/code&gt;: the join is
paying for its ordering.&lt;/p&gt;
&lt;h2 id=&quot;what-to-do&quot;&gt;What to do&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-do&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;If a &lt;code&gt;Sort&lt;/code&gt; feeds the join, see whether an index on the join column would hand the rows
over in order.&lt;/li&gt;
&lt;li&gt;If that sort spilled, raise &lt;code&gt;work_mem&lt;/code&gt; for the session, or test &lt;code&gt;SET enable_mergejoin = off&lt;/code&gt; for one run and compare against the &lt;a href=&quot;/guide/hash-join/&quot;&gt;Hash Join&lt;/a&gt; you get.&lt;/li&gt;
&lt;li&gt;Check the estimates on both inputs. Two small sorted inputs that turned out large is an
estimate problem, not a join problem. &lt;a href=&quot;/guide/estimated-rows/&quot;&gt;Estimated rows&lt;/a&gt; explains
the &lt;code&gt;≈N&lt;/code&gt; label.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;in-the-plan-tab&quot;&gt;In the Plan tab&lt;a class=&quot;guide-anchor&quot; href=&quot;#in-the-plan-tab&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A Merge Join is &lt;a href=&quot;/guide/plan-tab/&quot;&gt;drawn like any join&lt;/a&gt;, with two bands in. A Sort under it that went to disk
carries its own spill label and finding. The wheel on an index scan feeding the join matches
&lt;code&gt;Index Scan · in order&lt;/code&gt; when the heap order agrees with the index, as &lt;code&gt;order_items.order_id&lt;/code&gt;
does at 0.97.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/plan-merge-join.webp?v=a476dc2ccf&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/plan-merge-join-800.webp?v=d934dccf15&quot; srcset=&quot;/guide/shots/plan-merge-join-800.webp?v=d934dccf15 800w, /guide/shots/plan-merge-join.webp?v=a476dc2ccf 1872w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(936px, 46rem)&quot; width=&quot;936&quot; height=&quot;919&quot; alt=&quot;The Plan tab for a join ordered by order id: an Index Only Scan and an Index Scan feeding a Merge Join and a Limit, with no findings.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;&lt;code&gt;orders&lt;/code&gt; joined to &lt;code&gt;order_items&lt;/code&gt;, &lt;code&gt;ORDER BY o.id LIMIT 200000&lt;/code&gt;. Both inputs come out of an index in join order, so no Sort is needed. The &lt;code&gt;Limit&lt;/code&gt; stopped the scans early, so their rows fall short of the estimate without a finding, and a selected scan&amp;#39;s &lt;code&gt;Rows per loop&lt;/code&gt; reads &lt;code&gt;stopped early&lt;/code&gt;.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Merge Join handles equality only. A join on &lt;code&gt;&amp;gt;=&lt;/code&gt; or &lt;code&gt;BETWEEN&lt;/code&gt; cannot be merged.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry>
    <title>Sort</title>
    <link href="https://seqora.dev/guide/sort/" />
    <id>https://seqora.dev/guide/sort/</id>
    <published>2026-10-17T00:00:00Z</published>
    <updated>2026-10-17T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>The three sort methods EXPLAIN prints, what Disk against work_mem tells you, and the index that removes the Sort altogether.</summary>
    <content type="html">&lt;p&gt;A Sort orders its input on one or more columns, for an &lt;code&gt;ORDER BY&lt;/code&gt;, a &lt;a href=&quot;/guide/merge-join/&quot;&gt;Merge Join&lt;/a&gt;,
a &lt;a href=&quot;/guide/hash-aggregate/&quot;&gt;&lt;code&gt;GroupAggregate&lt;/code&gt;&lt;/a&gt; or a &lt;a href=&quot;/guide/window-agg/&quot;&gt;WindowAgg&lt;/a&gt;. The sample&amp;#39;s &lt;code&gt;ORDER BY revenue DESC&lt;/code&gt; sorts the 24 country rows that come out of the aggregate, which is nothing. The same
node sorting 12,000,000 orders is not.&lt;/p&gt;
&lt;h2 id=&quot;why-it-matters&quot;&gt;Why it matters&lt;a class=&quot;guide-anchor&quot; href=&quot;#why-it-matters&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt; prints the &lt;code&gt;Sort Method&lt;/code&gt;. &lt;code&gt;quicksort&lt;/code&gt; with &lt;code&gt;Memory: NkB&lt;/code&gt;: the input fit in
&lt;code&gt;work_mem&lt;/code&gt;. &lt;code&gt;top-N heapsort&lt;/code&gt;: a &lt;a href=&quot;/guide/limit/&quot;&gt;&lt;code&gt;LIMIT&lt;/code&gt;&lt;/a&gt; above the sort let it keep only the top N rows.
&lt;code&gt;external merge&lt;/code&gt; with &lt;code&gt;Disk: NkB&lt;/code&gt;: the input did not fit, so PostgreSQL wrote sorted runs to
&lt;a href=&quot;/guide/buffers/&quot;&gt;temp files&lt;/a&gt; and merged them back. Compare &lt;code&gt;Disk&lt;/code&gt; with &lt;code&gt;work_mem&lt;/code&gt;. The sample runs at &lt;code&gt;work_mem = 4MB&lt;/code&gt;, and any sort larger than that goes to disk. Since PostgreSQL 13 an &lt;code&gt;Incremental Sort&lt;/code&gt;
appears when the input is already sorted on a leading column and only the rest needs
ordering.&lt;/p&gt;
&lt;h2 id=&quot;what-to-do&quot;&gt;What to do&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-do&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;For an &lt;code&gt;ORDER BY&lt;/code&gt; with a &lt;code&gt;LIMIT&lt;/code&gt;, an index on the sort columns removes the Sort.
&lt;code&gt;orders_customer_placed_idx&lt;/code&gt; is &lt;code&gt;(customer_id, placed_at DESC)&lt;/code&gt;: a customer&amp;#39;s latest
orders come out of the index in order.&lt;/li&gt;
&lt;li&gt;For a one-off report, raise &lt;code&gt;work_mem&lt;/code&gt; for the session and run again. The &lt;code&gt;Disk&lt;/code&gt; figure,
rounded up, is the number.&lt;/li&gt;
&lt;li&gt;If the rows are wider than they need to be, sort fewer columns: select the keys, sort and
limit, then join the rest back.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;in-the-plan-tab&quot;&gt;In the Plan tab&lt;a class=&quot;guide-anchor&quot; href=&quot;#in-the-plan-tab&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A sort that went to disk carries a &lt;a href=&quot;/guide/plan-tab/&quot;&gt;spill label&lt;/a&gt;, &lt;code&gt;N MB disk&lt;/code&gt;, and the finding &lt;code&gt;Sort spilled to disk&lt;/code&gt; with &lt;code&gt;work_mem 4MB&lt;/code&gt; and a &lt;code&gt;Retry ·&lt;/code&gt; button with the next size. The inspector&amp;#39;s &lt;code&gt;Memory&lt;/code&gt;
bar marks &lt;code&gt;work_mem&lt;/code&gt; against what the sort needed.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/plan-sort.webp?v=accb4916d2&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/plan-sort-800.webp?v=75e951b9a8&quot; srcset=&quot;/guide/shots/plan-sort-800.webp?v=75e951b9a8 800w, /guide/shots/plan-sort.webp?v=accb4916d2 1872w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(936px, 46rem)&quot; width=&quot;936&quot; height=&quot;919&quot; alt=&quot;The Plan tab for an ORDER BY over 2.2 million orders: a Seq Scan feeding a Sort with a disk spill label, the Sort selected, and the finding Sort spilled to disk with a Retry button.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;2.2 million orders sorted by &lt;code&gt;total_cents&lt;/code&gt;, at &lt;code&gt;work_mem = 4MB&lt;/code&gt;. The spill label sits under the node, and the &lt;code&gt;Memory&lt;/code&gt; bar shows how far past &lt;code&gt;work_mem&lt;/code&gt; it went.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;Retry ·&lt;/code&gt; button is offered for read statements on PostgreSQL only.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry>
    <title>HashAggregate</title>
    <link href="https://seqora.dev/guide/hash-aggregate/" />
    <id>https://seqora.dev/guide/hash-aggregate/</id>
    <published>2026-10-17T00:00:00Z</published>
    <updated>2026-10-17T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>How GROUP BY is computed by hashing, why the number of groups is what matters, and when GroupAggregate is the cheaper plan.</summary>
    <content type="html">&lt;p&gt;A HashAggregate computes &lt;code&gt;GROUP BY&lt;/code&gt; by building a hash table keyed on the grouping columns and
updating each group&amp;#39;s &lt;code&gt;count&lt;/code&gt; or &lt;code&gt;sum&lt;/code&gt; as rows arrive, in any order. The sample&amp;#39;s &lt;code&gt;GROUP BY c.country&lt;/code&gt; is a HashAggregate: 620,640 rows in, one per country out, 24 at most.
A &lt;code&gt;GroupAggregate&lt;/code&gt; does the same on input sorted by the grouping columns, so it needs a
&lt;a href=&quot;/guide/sort/&quot;&gt;Sort&lt;/a&gt; or an ordered index scan underneath, but holds one group at a time. A
plain &lt;code&gt;Aggregate&lt;/code&gt; has no &lt;code&gt;GROUP BY&lt;/code&gt;: one row out, &lt;code&gt;SELECT count(*) FROM commerce.orders&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;why-it-matters&quot;&gt;Why it matters&lt;a class=&quot;guide-anchor&quot; href=&quot;#why-it-matters&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The hash table holds one entry per group, so the number of groups is what counts. 24
countries fit anywhere. 398,000 customers, the &lt;code&gt;n_distinct&lt;/code&gt; of &lt;code&gt;orders.customer_id&lt;/code&gt;, are
another matter at &lt;code&gt;work_mem = 4MB&lt;/code&gt;, and since PostgreSQL 13 a HashAggregate that outgrows
&lt;code&gt;work_mem&lt;/code&gt; spills to disk. The planner chooses hashing or grouping on its estimate of the
group count, so a wrong &lt;code&gt;n_distinct&lt;/code&gt; gets you the wrong one. Either a HashAggregate that
spills, or a GroupAggregate paying for a sort it did not need. Look for &lt;code&gt;Disk Usage&lt;/code&gt; on the node.&lt;/p&gt;
&lt;h2 id=&quot;what-to-do&quot;&gt;What to do&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-do&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;If the aggregate spilled, compare &lt;a href=&quot;/guide/estimated-rows/&quot;&gt;estimated rows&lt;/a&gt; out with actual. Far apart means
&lt;code&gt;n_distinct&lt;/code&gt; is wrong. &lt;code&gt;ANALYZE&lt;/code&gt; the table, or pin the value:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;guide-code-block&quot;&gt;
&lt;div class=&quot;guide-code-tools&quot;&gt;&lt;span class=&quot;guide-code-lang&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#file-sql&quot; /&gt;&lt;/svg&gt;SQL&lt;/span&gt;&lt;button class=&quot;guide-code-copy&quot; type=&quot;button&quot; data-code-copy hidden&gt;&lt;svg class=&quot;guide-icon guide-code-copy-idle&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#copy&quot; /&gt;&lt;/svg&gt;&lt;svg class=&quot;guide-icon guide-code-copy-done&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#check&quot; /&gt;&lt;/svg&gt;&lt;span data-code-copy-label aria-live=&quot;polite&quot;&gt;Copy&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;
&lt;pre class=&quot;guide-code&quot; data-lang=&quot;sql&quot;&gt;&lt;code&gt;&lt;span class=&quot;tok-key&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;TABLE&lt;/span&gt; commerce.orders &lt;span class=&quot;tok-key&quot;&gt;ALTER&lt;/span&gt; &lt;span class=&quot;tok-key&quot;&gt;COLUMN&lt;/span&gt; customer_id &lt;span class=&quot;tok-key&quot;&gt;SET&lt;/span&gt; (n_distinct = &lt;span class=&quot;tok-number&quot;&gt;398000&lt;/span&gt;);
&lt;span class=&quot;tok-key&quot;&gt;ANALYZE&lt;/span&gt; commerce.orders;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;ol start=&quot;2&quot;&gt;
&lt;li&gt;If the estimate is right, raise &lt;code&gt;work_mem&lt;/code&gt; for the session and run again.&lt;/li&gt;
&lt;li&gt;If an index delivers the input in group order, the GroupAggregate is the cheaper plan.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;in-the-plan-tab&quot;&gt;In the Plan tab&lt;a class=&quot;guide-anchor&quot; href=&quot;#in-the-plan-tab&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;a href=&quot;/guide/plan-tab/&quot;&gt;Plan tab&lt;/a&gt; labels the node &lt;code&gt;HashAggregate&lt;/code&gt;, &lt;code&gt;GroupAggregate&lt;/code&gt; or
&lt;code&gt;Aggregate&lt;/code&gt; by its strategy. An
aggregate that went to disk carries the spill label and the finding &lt;code&gt;HashAggregate spilled to disk&lt;/code&gt;, with a &lt;code&gt;Retry ·&lt;/code&gt; button.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/plan-hash-aggregate.webp?v=343b41de79&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/plan-hash-aggregate-800.webp?v=44a616c2e0&quot; srcset=&quot;/guide/shots/plan-hash-aggregate-800.webp?v=44a616c2e0 800w, /guide/shots/plan-hash-aggregate.webp?v=343b41de79 1872w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(936px, 46rem)&quot; width=&quot;936&quot; height=&quot;919&quot; alt=&quot;The Plan tab for a GROUP BY on orders: a Seq Scan of 12 million rows feeding a HashAggregate that returns 20 groups, with the HashAggregate selected.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;&lt;code&gt;GROUP BY status, channel&lt;/code&gt;: 12 million rows in, 20 groups out. Twenty groups fit in memory, so nothing spills.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
</content>
  </entry>
  <entry>
    <title>Limit</title>
    <link href="https://seqora.dev/guide/limit/" />
    <id>https://seqora.dev/guide/limit/</id>
    <published>2026-10-17T00:00:00Z</published>
    <updated>2026-10-17T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>When a Limit stops the work early and when the work happens anyway, with the index and the paging pattern that make it cheap.</summary>
    <content type="html">&lt;p&gt;A Limit passes through the first N rows from the node below it and then stops asking.
Everything underneath stops with it. &lt;code&gt;SELECT * FROM commerce.orders WHERE customer_id = $1 ORDER BY placed_at DESC LIMIT 20&lt;/code&gt; is a Limit over an &lt;a href=&quot;/guide/index-scan/&quot;&gt;Index Scan&lt;/a&gt; on
&lt;code&gt;orders_customer_placed_idx&lt;/code&gt;: the index delivers that customer&amp;#39;s orders newest first, the Limit
takes 20, and the scan stops at 20.&lt;/p&gt;
&lt;h2 id=&quot;why-it-matters&quot;&gt;Why it matters&lt;a class=&quot;guide-anchor&quot; href=&quot;#why-it-matters&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A Limit is only cheap when the node below produces rows one at a time in the order you asked
for. Above a &lt;a href=&quot;/guide/sort/&quot;&gt;Sort&lt;/a&gt; of the whole table it saves nothing but output: the Sort has
to see every row before it knows which 20 come first. Compare the rows the Limit emitted with
the rows its child produced. 20 and 20: it did its job. 20 and 12,000,000: the work happened
anyway. &lt;code&gt;OFFSET&lt;/code&gt; counts too. &lt;code&gt;LIMIT 20 OFFSET 100000&lt;/code&gt; reads and discards 100,000 rows each
time.&lt;/p&gt;
&lt;h2 id=&quot;what-to-do&quot;&gt;What to do&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-do&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Give the Limit an ordered source: an index on the &lt;code&gt;ORDER BY&lt;/code&gt; columns, with the &lt;code&gt;WHERE&lt;/code&gt;
columns in front.&lt;/li&gt;
&lt;li&gt;Replace deep &lt;code&gt;OFFSET&lt;/code&gt; paging with keyset paging: &lt;code&gt;WHERE (placed_at, id) &amp;lt; ($1, $2) ORDER BY placed_at DESC, id DESC LIMIT 20&lt;/code&gt;. Each page then starts from the index, not from row one.&lt;/li&gt;
&lt;li&gt;Check the estimate on the node below. The planner costs a Limit assuming matches turn up
early. When they are rare and sit at the end, that reads most of the table before the
first row. &lt;a href=&quot;/guide/estimated-rows/&quot;&gt;Estimated rows&lt;/a&gt; explains the assumption.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;in-the-plan-tab&quot;&gt;In the Plan tab&lt;a class=&quot;guide-anchor&quot; href=&quot;#in-the-plan-tab&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The Limit&amp;#39;s &lt;a href=&quot;/guide/plan-tab/&quot;&gt;band&lt;/a&gt; narrows to its row count. Compare its width with the band
coming in, then look at the time strip. When the segment for the node under the Limit is the
wide one, the Limit arrived too late to help. A node the Limit stopped early gets no dashed
estimate lines and no &lt;code&gt;Estimate off&lt;/code&gt; finding, and its &lt;code&gt;Rows per loop&lt;/code&gt; reads &lt;code&gt;stopped early&lt;/code&gt;.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/plan-limit.webp?v=2239937814&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/plan-limit-800.webp?v=06c995bb53&quot; srcset=&quot;/guide/shots/plan-limit-800.webp?v=06c995bb53 800w, /guide/shots/plan-limit.webp?v=2239937814 1872w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(936px, 46rem)&quot; width=&quot;936&quot; height=&quot;919&quot; alt=&quot;The Plan tab for one customer&amp;#39;s latest 20 orders: an Index Scan feeding a Limit, with 20 rows on both bands, the Limit selected, and no findings.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;A customer&amp;#39;s latest 20 orders. The band doesn&amp;#39;t narrow, because the index stops at 20 and the &lt;code&gt;Limit&lt;/code&gt; never throws anything away.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
</content>
  </entry>
  <entry>
    <title>CTE Scan</title>
    <link href="https://seqora.dev/guide/cte-scan/" />
    <id>https://seqora.dev/guide/cte-scan/</id>
    <published>2026-10-17T00:00:00Z</published>
    <updated>2026-10-17T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>When a WITH query is computed once and kept, when it is folded into the main query instead, and why the sample&#39;s web_orders has no node at all.</summary>
    <content type="html">&lt;p&gt;A CTE Scan reads the rows of a &lt;code&gt;WITH&lt;/code&gt; query that PostgreSQL computed once and kept, in memory
or in temp files. Since PostgreSQL 12 that only happens when the planner cannot fold the CTE
into the main query. A CTE is inlined, and has no node of its own, when it is referenced
once, only selects, and is not marked &lt;code&gt;MATERIALIZED&lt;/code&gt;. The sample&amp;#39;s &lt;code&gt;web_orders&lt;/code&gt; meets all
three, so its plan has no CTE Scan: the &lt;code&gt;WHERE channel = &amp;#39;web&amp;#39; AND placed_at &amp;gt;= ...&lt;/code&gt; runs as
a plain &lt;a href=&quot;/guide/seq-scan/&quot;&gt;Seq Scan&lt;/a&gt; on &lt;code&gt;commerce.orders&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;why-it-matters&quot;&gt;Why it matters&lt;a class=&quot;guide-anchor&quot; href=&quot;#why-it-matters&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Materializing is right when the CTE is expensive and used twice or more, when it is
recursive, or when it writes. An &lt;code&gt;INSERT ... RETURNING&lt;/code&gt; inside a &lt;code&gt;WITH&lt;/code&gt; is the last case. It is the
problem when it stops an outer &lt;code&gt;WHERE&lt;/code&gt; being pushed into the CTE. A materialized &lt;code&gt;web_orders&lt;/code&gt;
with &lt;code&gt;WHERE w.customer_id = $1&lt;/code&gt; outside it would compute all 206,880 web orders, keep them,
then read them back to find one customer&amp;#39;s. Compare the CTE Scan&amp;#39;s rows out with the rows the
CTE produced. A wide gap is &lt;a href=&quot;/guide/rows-removed-by-filter/&quot;&gt;a filter&lt;/a&gt; that belonged inside.&lt;/p&gt;
&lt;h2 id=&quot;what-to-do&quot;&gt;What to do&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-do&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;If a query changed speed at the PostgreSQL 12 upgrade, look here first: before 12 every
CTE was materialized.&lt;/li&gt;
&lt;li&gt;If a CTE used twice is materialized and you want it folded anyway, &lt;code&gt;WITH web_orders AS NOT MATERIALIZED (...)&lt;/code&gt;. The planner then computes it at each reference.&lt;/li&gt;
&lt;li&gt;If a folded CTE lands in a bad plan, &lt;code&gt;WITH web_orders AS MATERIALIZED (...)&lt;/code&gt; computes it
once and keeps the result.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;in-the-plan-tab&quot;&gt;In the Plan tab&lt;a class=&quot;guide-anchor&quot; href=&quot;#in-the-plan-tab&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A CTE Scan is &lt;a href=&quot;/guide/plan-tab/&quot;&gt;drawn&lt;/a&gt; with the CTE&amp;#39;s name where other scans show a table, and has no wheel,
since there is no table behind it. For the sample&amp;#39;s &lt;code&gt;web_orders&lt;/code&gt; there is nothing to find.
Look at the &lt;a class=&quot;guide-term&quot; href=&quot;/guide/seq-scan/&quot; data-term-icon=&quot;list-dashes&quot; data-term-description=&quot;What a Seq Scan reads, the kept-to-read ratio that tells you it is the problem, and the index that replaces it.&quot;&gt;&lt;code&gt;Seq Scan on commerce.orders&lt;/code&gt;&lt;/a&gt; instead.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/plan-cte-scan.webp?v=c60b288b19&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/plan-cte-scan-800.webp?v=bb0d433a15&quot; srcset=&quot;/guide/shots/plan-cte-scan-800.webp?v=bb0d433a15 800w, /guide/shots/plan-cte-scan.webp?v=c60b288b19 1872w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(936px, 46rem)&quot; width=&quot;936&quot; height=&quot;919&quot; alt=&quot;The Plan tab for a materialized CTE read twice: a Seq Scan on orders, two CTE Scan nodes on recent feeding a Hash Join, and a HashAggregate.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;&lt;code&gt;WITH recent AS MATERIALIZED&lt;/code&gt;, read twice. The scan of &lt;code&gt;orders&lt;/code&gt; happens once, and each reference is its own &lt;code&gt;CTE Scan&lt;/code&gt; node.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
</content>
  </entry>
  <entry>
    <title>Gather</title>
    <link href="https://seqora.dev/guide/gather/" />
    <id>https://seqora.dev/guide/gather/</id>
    <published>2026-10-17T00:00:00Z</published>
    <updated>2026-10-17T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>Where parallel workers hand their rows back, Workers Planned against Workers Launched, and when a parallel plan is slower than the serial one.</summary>
    <content type="html">&lt;p&gt;A Gather sits above the parallel part of a plan, starts the workers, and collects their rows
into one stream. &lt;code&gt;Gather Merge&lt;/code&gt; does the same for sorted input, so the order survives. Under
a Gather the leader and each worker run their own copy of the nodes below. The sample ran
with &lt;code&gt;max_parallel_workers_per_gather = 0&lt;/code&gt;, so its plan has no Gather. At the default of 2,
the &lt;a href=&quot;/guide/seq-scan/&quot;&gt;Seq Scan&lt;/a&gt; on &lt;code&gt;commerce.orders&lt;/code&gt; would become a &lt;code&gt;Parallel Seq Scan&lt;/code&gt;
under a Gather, with three processes sharing the 183,000 pages.&lt;/p&gt;
&lt;h2 id=&quot;why-it-matters&quot;&gt;Why it matters&lt;a class=&quot;guide-anchor&quot; href=&quot;#why-it-matters&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Parallelism helps a big scan or aggregate that is bound by CPU. It helps less when the scan is
bound by disk, as the sample&amp;#39;s was, with 181,796 of 183,000 &lt;a href=&quot;/guide/buffers/&quot;&gt;pages read from outside the cache&lt;/a&gt;.
Check &lt;code&gt;Workers Planned&lt;/code&gt; against &lt;code&gt;Workers Launched&lt;/code&gt;. Workers come from a pool shared by the
whole server, &lt;code&gt;max_parallel_workers&lt;/code&gt;, and when other queries hold them the Gather starts with
fewer than planned, or none. A plan costed for three processes then runs on one, slower than
the serial plan the planner would have chosen. Rows under a Gather are per process.
&lt;a href=&quot;/guide/loops/&quot;&gt;Loops&lt;/a&gt; has the arithmetic.&lt;/p&gt;
&lt;h2 id=&quot;what-to-do&quot;&gt;What to do&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-do&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;If &lt;code&gt;Workers Launched&lt;/code&gt; is below &lt;code&gt;Workers Planned&lt;/code&gt;, look at what else was running.
&lt;code&gt;max_worker_processes&lt;/code&gt; and &lt;code&gt;max_parallel_workers&lt;/code&gt; cap the pool.&lt;/li&gt;
&lt;li&gt;If the parallel plan is slower than the serial one, &lt;code&gt;SET max_parallel_workers_per_gather = 0&lt;/code&gt; for one run gives you the serial plan to compare.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;min_parallel_table_scan_size&lt;/code&gt; is 8MB by default. Smaller tables never get a Gather, on
purpose.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;in-the-plan-tab&quot;&gt;In the Plan tab&lt;a class=&quot;guide-anchor&quot; href=&quot;#in-the-plan-tab&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In the &lt;a href=&quot;/guide/plan-tab/&quot;&gt;Plan tab&lt;/a&gt;, parallel-aware nodes are labelled &lt;code&gt;Parallel Seq Scan&lt;/code&gt;, and
the Gather joins their bands into one. The finding &lt;code&gt;Fewer workers launched&lt;/code&gt;,
&lt;code&gt;N of M parallel workers&lt;/code&gt;, fires when the launch fell short.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/plan-gather.webp?v=85491d1db2&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/plan-gather-800.webp?v=fe9cab77eb&quot; srcset=&quot;/guide/shots/plan-gather-800.webp?v=fe9cab77eb 800w, /guide/shots/plan-gather.webp?v=85491d1db2 1872w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(936px, 46rem)&quot; width=&quot;936&quot; height=&quot;919&quot; alt=&quot;The Plan tab for a parallel count: a Parallel Seq Scan and an Aggregate marked three processes, joined by a Gather that returns three rows, with the Gather selected.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;A count over &lt;code&gt;orders&lt;/code&gt;, with &lt;code&gt;max_parallel_workers_per_gather&lt;/code&gt; back at 2. The band under the scan is marked &lt;code&gt;↻ ×3&lt;/code&gt; for the leader and two workers, and the Gather joins them.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
</content>
  </entry>
  <entry>
    <title>WindowAgg</title>
    <link href="https://seqora.dev/guide/window-agg/" />
    <id>https://seqora.dev/guide/window-agg/</id>
    <published>2026-10-17T00:00:00Z</published>
    <updated>2026-10-17T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>How rank() and its relatives are computed, why each window ordering costs a sort, and how to make windows share one.</summary>
    <content type="html">&lt;p&gt;A WindowAgg computes window functions over its input without collapsing rows. One row in, one
row out, with the window&amp;#39;s value attached. It needs the rows in the order the window asks
for, so a &lt;a href=&quot;/guide/sort/&quot;&gt;Sort&lt;/a&gt; usually sits under it, on the &lt;code&gt;PARTITION BY&lt;/code&gt; columns and then
the &lt;code&gt;ORDER BY&lt;/code&gt; columns. The sample&amp;#39;s &lt;code&gt;rank() OVER (ORDER BY sum(oi.line_total) DESC)&lt;/code&gt; runs
above the aggregate: 24 country rows in, sorted by revenue, 24 out with a rank.&lt;/p&gt;
&lt;h2 id=&quot;why-it-matters&quot;&gt;Why it matters&lt;a class=&quot;guide-anchor&quot; href=&quot;#why-it-matters&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A WindowAgg over 24 rows costs nothing. The expense is the sort it needs, and the number of
WindowAggs in the query. Every window with a different &lt;code&gt;PARTITION BY&lt;/code&gt; or &lt;code&gt;ORDER BY&lt;/code&gt; is its
own node with its own sort of the whole input, so three windows on three orderings of
12,000,000 rows is three full sorts. Look at the rows going into the WindowAgg and at whether
a &lt;code&gt;WHERE&lt;/code&gt; in an outer query discards most of what it computed. The WindowAgg computes every
row before an outer filter sees one.&lt;/p&gt;
&lt;h2 id=&quot;what-to-do&quot;&gt;What to do&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-do&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Let windows share a sort. Windows with the same &lt;code&gt;PARTITION BY&lt;/code&gt; and &lt;code&gt;ORDER BY&lt;/code&gt; share one
WindowAgg and one Sort. Matching the query&amp;#39;s final &lt;code&gt;ORDER BY&lt;/code&gt; to the window&amp;#39;s lets the
planner reuse that sort for the output, as the sample&amp;#39;s &lt;code&gt;ORDER BY revenue DESC&lt;/code&gt; does.&lt;/li&gt;
&lt;li&gt;Cut the input before the window. A &lt;code&gt;WHERE placed_at &amp;gt;= ...&lt;/code&gt; in the subquery under the
window runs before the sort.&lt;/li&gt;
&lt;li&gt;If the sort under the window spills, treat it as a Sort problem: &lt;code&gt;work_mem&lt;/code&gt; for the
session, or an index in the window&amp;#39;s order.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;in-the-plan-tab&quot;&gt;In the Plan tab&lt;a class=&quot;guide-anchor&quot; href=&quot;#in-the-plan-tab&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;a href=&quot;/guide/plan-tab/&quot;&gt;Plan tab&lt;/a&gt; labels the node &lt;code&gt;WindowAgg&lt;/code&gt;, and its band keeps the width of
its input. The Sort under it is
where to look, and if that sort went to disk it carries the spill label and the &lt;code&gt;Sort spilled to disk&lt;/code&gt; finding.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/plan-window-agg.webp?v=0a6f7ef9fd&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/plan-window-agg-800.webp?v=c5e35bfc8d&quot; srcset=&quot;/guide/shots/plan-window-agg-800.webp?v=c5e35bfc8d 800w, /guide/shots/plan-window-agg.webp?v=0a6f7ef9fd 1872w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(936px, 46rem)&quot; width=&quot;936&quot; height=&quot;919&quot; alt=&quot;The Plan tab for a rank over the last 30 days of orders: a Seq Scan, a Sort and a WindowAgg, with the WindowAgg selected and findings for the spills.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;&lt;code&gt;rank() OVER (PARTITION BY status ORDER BY total_cents DESC)&lt;/code&gt;. The &lt;code&gt;Sort&lt;/code&gt; under the &lt;code&gt;WindowAgg&lt;/code&gt; is the window&amp;#39;s ordering, and both spill at &lt;code&gt;work_mem = 4MB&lt;/code&gt;.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
</content>
  </entry>
  <entry>
    <title>Materialize</title>
    <link href="https://seqora.dev/guide/materialize/" />
    <id>https://seqora.dev/guide/materialize/</id>
    <published>2026-10-17T00:00:00Z</published>
    <updated>2026-10-17T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>The node that keeps its input for rescanning, when it is doing its job under a Nested Loop, and when the loop count makes it the problem.</summary>
    <content type="html">&lt;p&gt;A Materialize reads its input once and keeps the rows, in memory or in a &lt;a href=&quot;/guide/buffers/&quot;&gt;temp file&lt;/a&gt; when they
outgrow &lt;code&gt;work_mem&lt;/code&gt;, for the node above to read again. It appears most often as the inner
side of a &lt;a href=&quot;/guide/nested-loop/&quot;&gt;Nested Loop&lt;/a&gt; when there is no index to look rows up with. The
loop rescans the inner input once per outer row, and a buffer rescans faster than a
&lt;a href=&quot;/guide/seq-scan/&quot;&gt;Seq Scan&lt;/a&gt;. &lt;code&gt;JOIN commerce.stores s ON s.country = c.country&lt;/code&gt;, with 40 stores
and no index on &lt;code&gt;country&lt;/code&gt;, is the shape when the planner expects a handful of customers on
the outer side.&lt;/p&gt;
&lt;h2 id=&quot;why-it-matters&quot;&gt;Why it matters&lt;a class=&quot;guide-anchor&quot; href=&quot;#why-it-matters&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Fine when the inner set is small, as 40 stores is, and the loops are few. It is the problem
when the loops are many, because every outer row scans the whole kept set. The figure is rows
out of the Materialize, &lt;a href=&quot;/guide/loops/&quot;&gt;reported per loop&lt;/a&gt;, times the loops. 40 rows × 412,000 customers is
16,480,000 comparisons for a join returning 412,000 rows. A set that outgrows &lt;code&gt;work_mem&lt;/code&gt; goes
to a temp file. Since PostgreSQL 14 &lt;code&gt;Memoize&lt;/code&gt; caches inner results per key instead of the
whole set.&lt;/p&gt;
&lt;h2 id=&quot;what-to-do&quot;&gt;What to do&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-do&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Check whether the join condition can use an index. &lt;code&gt;CREATE INDEX ON commerce.stores (country)&lt;/code&gt; turns the rescans into &lt;a href=&quot;/guide/index-scan/&quot;&gt;Index Scans&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Check the &lt;a href=&quot;/guide/estimated-rows/&quot;&gt;outer row estimate&lt;/a&gt;. If the loops ran 338× more than planned, &lt;code&gt;ANALYZE&lt;/code&gt; the outer
table and the planner moves to a &lt;a href=&quot;/guide/hash-join/&quot;&gt;Hash Join&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;If the set is large and the loops few, it is doing its job. Leave it.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;in-the-plan-tab&quot;&gt;In the Plan tab&lt;a class=&quot;guide-anchor&quot; href=&quot;#in-the-plan-tab&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Materialize is &lt;a href=&quot;/guide/plan-tab/&quot;&gt;drawn as its own node&lt;/a&gt; between the loop and its input, with &lt;code&gt;↻ ×N&lt;/code&gt; under its
band for the loops it was rescanned in. A set that outgrew &lt;code&gt;work_mem&lt;/code&gt; carries the spill label
and the finding &lt;code&gt;Materialize spilled to disk&lt;/code&gt;.&lt;/p&gt;
&lt;figure class=&quot;guide-shot&quot;&gt;
&lt;a class=&quot;guide-shot-frame&quot; href=&quot;/guide/shots/plan-materialize.webp?v=e64226f0d1&quot; data-shot&gt;
&lt;img src=&quot;/guide/shots/plan-materialize-800.webp?v=566fb40a74&quot; srcset=&quot;/guide/shots/plan-materialize-800.webp?v=566fb40a74 800w, /guide/shots/plan-materialize.webp?v=e64226f0d1 1872w&quot; sizes=&quot;(max-width: 46rem) 100vw, min(936px, 46rem)&quot; width=&quot;936&quot; height=&quot;919&quot; alt=&quot;The Plan tab for a join on an inequality: a Seq Scan of categories feeding Materialize, the inner side of a Nested Loop over stores, with 40 loops and the Materialize selected.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;
&lt;/a&gt;
&lt;figcaption&gt;
&lt;p&gt;The inner side of a Nested Loop on an inequality. &lt;code&gt;Materialize&lt;/code&gt; reads &lt;code&gt;categories&lt;/code&gt; once, 10 rows, and the loop reads those 10 back 40 times.&lt;/p&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
</content>
  </entry>
  <entry>
    <title>Rows Removed by Filter</title>
    <link href="https://seqora.dev/guide/rows-removed-by-filter/" />
    <id>https://seqora.dev/guide/rows-removed-by-filter/</id>
    <published>2026-10-17T00:00:00Z</published>
    <updated>2026-10-17T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>The line that counts rows read and then thrown away, what it says under a Seq Scan and an Index Scan, and how to make it zero.</summary>
    <content type="html">&lt;p&gt;&lt;code&gt;Rows Removed by Filter&lt;/code&gt; is not a node. It is a line under a scan in &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt; output,
counting the rows the node read and then rejected because they failed its &lt;code&gt;Filter&lt;/code&gt;. The
sample&amp;#39;s &lt;a class=&quot;guide-term&quot; href=&quot;/guide/seq-scan/&quot; data-term-icon=&quot;list-dashes&quot; data-term-description=&quot;What a Seq Scan reads, the kept-to-read ratio that tells you it is the problem, and the index that replaces it.&quot;&gt;&lt;code&gt;Seq Scan on commerce.orders&lt;/code&gt;&lt;/a&gt; reads 12,000,000 rows, keeps 206,880 and prints &lt;code&gt;Rows Removed by Filter: 11793120&lt;/code&gt;. Those 11,793,120 rows were fetched, tested against &lt;code&gt;channel = &amp;#39;web&amp;#39; AND placed_at &amp;gt;= ...&lt;/code&gt;, and dropped.&lt;/p&gt;
&lt;h2 id=&quot;why-it-matters&quot;&gt;Why it matters&lt;a class=&quot;guide-anchor&quot; href=&quot;#why-it-matters&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;It is the clearest measure of wasted work in a plan. Rows kept over rows read says how well
the access path fits the query. &lt;code&gt;orders&lt;/code&gt; keeps 1.7%. Under an &lt;a href=&quot;/guide/index-scan/&quot;&gt;Index Scan&lt;/a&gt;,
a &lt;code&gt;Filter&lt;/code&gt; line beneath the &lt;code&gt;Index Cond&lt;/code&gt; means the index found rows the query then rejected.
The rest of the &lt;code&gt;WHERE&lt;/code&gt; is checked after the fetch, and a large count there is a missing
column. The figure is per loop, so a scan with &lt;code&gt;loops=206880&lt;/code&gt; and &lt;code&gt;Rows Removed by Filter: 2&lt;/code&gt;
removed 413,760 rows. &lt;a href=&quot;/guide/loops/&quot;&gt;Loops&lt;/a&gt; has the arithmetic.&lt;/p&gt;
&lt;h2 id=&quot;what-to-do&quot;&gt;What to do&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-do&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;On a &lt;a href=&quot;/guide/seq-scan/&quot;&gt;Seq Scan&lt;/a&gt; removing most of the table, index the filter columns,
equality first. The sample&amp;#39;s fix is &lt;code&gt;CREATE INDEX orders_channel_placed_idx ON commerce.orders (channel, placed_at DESC)&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;On an &lt;a class=&quot;guide-term&quot; href=&quot;/guide/index-scan/&quot; data-term-icon=&quot;lightning&quot; data-term-description=&quot;How an Index Scan fetches rows, why 206,880 cheap lookups add up, and what the table&amp;#39;s physical order does to each one.&quot;&gt;Index Scan&lt;/a&gt; with a &lt;code&gt;Filter&lt;/code&gt;, add the filtered column to the index so the check moves
into the &lt;code&gt;Index Cond&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;If the filter is an expression, &lt;code&gt;lower(email) = $1&lt;/code&gt;, index the expression: &lt;code&gt;CREATE INDEX ON crm.customers (lower(email))&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;in-the-plan-tab&quot;&gt;In the Plan tab&lt;a class=&quot;guide-anchor&quot; href=&quot;#in-the-plan-tab&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In the &lt;a href=&quot;/guide/plan-tab/&quot;&gt;row flow&lt;/a&gt;, the removed rows drain off below the scan&amp;#39;s band. The drain is marker 3. The rest of the
flow is there so you can see what the drain took from.&lt;/p&gt;
&lt;figure class=&quot;guide-figure&quot;&gt;
&lt;div class=&quot;guide-figure-stage frame&quot; data-island=&quot;plan-flow&quot;&gt;
&lt;div class=&quot;app-surface&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The row flow of the sample, with the filter&amp;#39;s drain under Seq Scan on orders.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;figcaption&gt;
&lt;p&gt;The row flow of the sample, with the filter&amp;#39;s drain under &lt;code&gt;Seq Scan on orders&lt;/code&gt;.&lt;/p&gt;
&lt;ol class=&quot;guide-legend&quot;&gt;
&lt;li&gt;The band into the scan is the 12,000,000 rows it read, every one of them tested against the
filter.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;207K ┅ 612&lt;/code&gt; is what survived, 206,880 rows, beside the planner&amp;#39;s guess of 612. The band that
continues to the right is the 1.7% kept.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;−11.8M&lt;/code&gt; is &lt;code&gt;Rows Removed by Filter&lt;/code&gt;, drained off below the scan: 11,793,120 rows fetched,
tested and dropped. A drain this wide against a band this thin is the shape of a missing
index.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;↻ ×207K ┅ ×612&lt;/code&gt; is how many times the &lt;code&gt;order_items&lt;/code&gt; scan ran. A &lt;code&gt;Rows Removed by Filter&lt;/code&gt;
on a looped scan is per run, so it would be multiplied by this.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;1.64 s&lt;/code&gt; is the scan&amp;#39;s self time, most of it spent on rows it then threw away.&lt;/li&gt;
&lt;li&gt;The result end, off to the right, is where the rows that survived every filter leave the
plan.&lt;/li&gt;
&lt;/ol&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The inspector&amp;#39;s &lt;code&gt;Rows&lt;/code&gt; bar draws read against kept with &lt;code&gt;2% kept&lt;/code&gt;, and the table wheel&amp;#39;s
guide lists &lt;code&gt;Rows read&lt;/code&gt; and &lt;code&gt;Rows kept&lt;/code&gt;.&lt;/p&gt;
&lt;section class=&quot;guide-caveats&quot;&gt;&lt;h2 id=&quot;caveats&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#warning&quot; /&gt;&lt;/svg&gt;Caveats&lt;a class=&quot;guide-anchor&quot; href=&quot;#caveats&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;On a &lt;a href=&quot;/guide/bitmap-heap-scan/&quot;&gt;Bitmap Heap Scan&lt;/a&gt; the drain adds &lt;code&gt;Rows Removed by Index Recheck&lt;/code&gt; to the count.&lt;/li&gt;
&lt;/ul&gt;
&lt;/section&gt;
</content>
  </entry>
  <entry>
    <title>Buffers</title>
    <link href="https://seqora.dev/guide/buffers/" />
    <id>https://seqora.dev/guide/buffers/</id>
    <published>2026-10-17T00:00:00Z</published>
    <updated>2026-10-17T00:00:00Z</updated>
    <author><name>Ayushman</name></author>
    <summary>The page counts under each node, hit against read, what temp means, and why they are the figure to compare between two runs.</summary>
    <content type="html">&lt;p&gt;&lt;code&gt;Buffers&lt;/code&gt; is the line &lt;code&gt;EXPLAIN (ANALYZE, BUFFERS)&lt;/code&gt; adds under each node, counting 8 kB pages.
&lt;code&gt;shared hit&lt;/code&gt; is pages found in &lt;code&gt;shared_buffers&lt;/code&gt;, PostgreSQL&amp;#39;s own cache. &lt;code&gt;shared read&lt;/code&gt; is
pages fetched from the operating system. &lt;code&gt;dirtied&lt;/code&gt; and &lt;code&gt;written&lt;/code&gt; are pages the query changed
and pages it wrote out to make room. &lt;code&gt;temp read&lt;/code&gt; and &lt;code&gt;temp written&lt;/code&gt; are the temp files a
&lt;a href=&quot;/guide/sort/&quot;&gt;Sort&lt;/a&gt; or &lt;a href=&quot;/guide/hash-join/&quot;&gt;Hash Join&lt;/a&gt; spilled to. The sample&amp;#39;s &lt;a class=&quot;guide-term&quot; href=&quot;/guide/seq-scan/&quot; data-term-icon=&quot;list-dashes&quot; data-term-description=&quot;What a Seq Scan reads, the kept-to-read ratio that tells you it is the problem, and the index that replaces it.&quot;&gt;&lt;code&gt;Seq Scan on commerce.orders&lt;/code&gt;&lt;/a&gt; prints &lt;code&gt;Buffers: shared hit=1204 read=181796&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;why-it-matters&quot;&gt;Why it matters&lt;a class=&quot;guide-anchor&quot; href=&quot;#why-it-matters&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Time varies with what else the server is doing. Buffers do not, which makes them the figure
to compare between two runs of a query. The ratio is &lt;code&gt;read&lt;/code&gt; against &lt;code&gt;hit&lt;/code&gt;. &lt;code&gt;orders&lt;/code&gt; had
181,796 of its 183,000 pages come from outside &lt;code&gt;shared_buffers&lt;/code&gt;, which is why the scan took
1,640 ms, and why it is faster the second time. Few rows and many buffers is &lt;a href=&quot;/guide/index-scan/&quot;&gt;an index on a
low-correlation column&lt;/a&gt;, a new page per row. Any &lt;code&gt;temp&lt;/code&gt; above zero means &lt;code&gt;work_mem&lt;/code&gt; ran out
somewhere below. &lt;code&gt;written&lt;/code&gt; on a &lt;code&gt;SELECT&lt;/code&gt; is not a bug: a read evicts dirty pages and sets
hint bits.&lt;/p&gt;
&lt;h2 id=&quot;what-to-do&quot;&gt;What to do&lt;a class=&quot;guide-anchor&quot; href=&quot;#what-to-do&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Touch fewer pages before caching more. Reaching 206,880 rows through an index touches the
pages those rows are on, not all 183,000. &lt;a href=&quot;/guide/will-this-index-help/&quot;&gt;Will this index help?&lt;/a&gt;
shows how to test one.&lt;/li&gt;
&lt;li&gt;If &lt;code&gt;read&lt;/code&gt; dominates on a table queried all day, &lt;code&gt;shared_buffers&lt;/code&gt; may be too small for the
working set. &lt;code&gt;orders&lt;/code&gt; alone is 1.5 GB.&lt;/li&gt;
&lt;li&gt;If &lt;code&gt;temp&lt;/code&gt; is above zero, find the node that spilled. Its finding names it.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;in-the-plan-tab&quot;&gt;In the Plan tab&lt;a class=&quot;guide-anchor&quot; href=&quot;#in-the-plan-tab&quot; aria-label=&quot;Link to this section&quot;&gt;&lt;svg class=&quot;guide-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/guide-icons.svg#hash&quot; /&gt;&lt;/svg&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The inspector&amp;#39;s &lt;code&gt;Pages&lt;/code&gt; section in the &lt;a href=&quot;/guide/plan-tab/&quot;&gt;Plan tab&lt;/a&gt; is the &lt;code&gt;Buffers&lt;/code&gt; line drawn. Marker 3 is the one this page is
about.&lt;/p&gt;
&lt;figure class=&quot;guide-figure&quot;&gt;
&lt;div class=&quot;guide-figure-stage frame&quot; data-island=&quot;plan-inspector&quot;&gt;
&lt;div class=&quot;app-surface&quot;&gt;
&lt;p class=&quot;app-fallback&quot;&gt;The inspector for Seq Scan on orders, with Pages third from the top.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;figcaption&gt;
&lt;p&gt;The inspector for &lt;code&gt;Seq Scan on orders&lt;/code&gt;, with &lt;code&gt;Pages&lt;/code&gt; third from the top.&lt;/p&gt;
&lt;ol class=&quot;guide-legend&quot;&gt;
&lt;li&gt;&lt;code&gt;Rows&lt;/code&gt; is read against kept, &lt;code&gt;2% kept&lt;/code&gt;. Rows and pages tell the same story from two
sides: 12,000,000 rows is 183,000 pages.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Rows per loop&lt;/code&gt; is actual against estimated, &lt;code&gt;338× more&lt;/code&gt;. Pages are not estimated, so there
is no ruler for them.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Pages&lt;/code&gt; is &lt;code&gt;shared hit&lt;/code&gt; against &lt;code&gt;shared read&lt;/code&gt;, drawn as &lt;code&gt;cache 1,204&lt;/code&gt; against &lt;code&gt;disk 182K&lt;/code&gt;,
&lt;code&gt;99% from disk&lt;/code&gt;. The table was not in &lt;code&gt;shared_buffers&lt;/code&gt;, and &lt;code&gt;temp&lt;/code&gt; would appear beside them
if the node had spilled.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Indexes · orders&lt;/code&gt; is the way to touch fewer pages: an index that starts with &lt;code&gt;channel&lt;/code&gt;
would reach the kept rows&amp;#39; pages and skip the rest.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;suggested&lt;/code&gt; is that index, with &lt;code&gt;Test index&lt;/code&gt;. The cost &lt;code&gt;Test index&lt;/code&gt; prints counts pages in
units of one sequential read, so fewer pages touched is what a lower cost means.&lt;/li&gt;
&lt;/ol&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;all cached&lt;/code&gt; replaces the percentage when nothing came from disk. Dirtied and written pages
are not drawn. They are in &lt;code&gt;Raw plan JSON&lt;/code&gt;.&lt;/p&gt;
</content>
  </entry>
</feed>
