<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>SQL on Artem Yegorov</title>
    <link>https://yegorov.github.io/tags/sql/</link>
    <description>Recent content in SQL on Artem Yegorov</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Mon, 16 Feb 2026 14:19:59 +0000</lastBuildDate>
    <atom:link href="https://yegorov.github.io/tags/sql/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Get database size</title>
      <link>https://yegorov.github.io/notes/get-database-size/</link>
      <pubDate>Mon, 16 Feb 2026 14:19:59 +0000</pubDate>
      <guid>https://yegorov.github.io/notes/get-database-size/</guid>
      <description>&lt;p&gt;When you are working on a fast-growing project, sooner or later you will have to watch the size of your main database increase. This information will be especially useful when you restore the backup to your staging server.&#xA;Also, periodically getting the size can help identify an anomaly in the database at an early stage. You will agree, but it will look strange if the size was 2.5 GB for a few hours, and now it is 1 GB and you did not do any manipulations in this database.&#xA;To find out the size of the database, you just need to run one SQL query:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rails runner: export tables row count</title>
      <link>https://yegorov.github.io/notes/rails-runner-export-tables-row-count/</link>
      <pubDate>Wed, 28 Jan 2026 05:15:01 +0000</pubDate>
      <guid>https://yegorov.github.io/notes/rails-runner-export-tables-row-count/</guid>
      <description>&lt;p&gt;Anyone who works with Rails has heard of and used the &lt;a href=&#34;https://guides.rubyonrails.org/command_line.html#bin-rails-runner&#34;  class=&#34;external-link&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;runner command&lt;/a&gt; with a single-line code argument that executes in the application context.&#xA;While working on my application the other day, I needed to list all tables with their row counts.&#xA;The code for listing the number of table rows on a single line looks rather ugly and unmaintainable.&#xA;If you read the runner help (&lt;code&gt;bin/rails runner -h&lt;/code&gt;), you&amp;rsquo;ll see that runner can also read code from stdin.&#xA;To pass multi-line code to runner, you can use a heredoc.&#xA;To me, this looks absolutely stunning!&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
