<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Gurupreet Bhatia on Medium]]></title>
        <description><![CDATA[Stories by Gurupreet Bhatia on Medium]]></description>
        <link>https://medium.com/@bhatia.gurupreet?source=rss-109d699d9b0f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*SsltWcSWYEQ5mBkl.jpg</url>
            <title>Stories by Gurupreet Bhatia on Medium</title>
            <link>https://medium.com/@bhatia.gurupreet?source=rss-109d699d9b0f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 04:05:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bhatia.gurupreet/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Uncovering Unnecessary Credit Usage in Snowflake: A Case Study on Warehouse Resizing]]></title>
            <link>https://medium.com/@bhatia.gurupreet/uncovering-unnecessary-credit-usage-in-snowflake-a-case-study-on-warehouse-resizing-0f17d8d64a9e?source=rss-109d699d9b0f------2</link>
            <guid isPermaLink="false">https://medium.com/p/0f17d8d64a9e</guid>
            <category><![CDATA[snowflake-data-cloud]]></category>
            <category><![CDATA[snowflakedb]]></category>
            <category><![CDATA[cloud-data-warehouse]]></category>
            <category><![CDATA[snowflake-computing]]></category>
            <category><![CDATA[snowflake]]></category>
            <dc:creator><![CDATA[Gurupreet Bhatia]]></dc:creator>
            <pubDate>Tue, 05 Aug 2025 10:06:20 GMT</pubDate>
            <atom:updated>2025-08-05T13:22:50.456Z</atom:updated>
            <content:encoded><![CDATA[<p>#Snowflake-Warehouse-Resizing-Details</p><p>While working on a Snowflake warehouse utilization report for one of our customers, I stumbled upon something quite revealing — a silent cost leak that was draining credits unnecessarily. This post outlines how I identified the issue using a simple yet powerful Snowflake query and how you can avoid the same pitfall in your environment.</p><p><strong>📌 The Ask</strong></p><p>The customer wanted <strong>insights into Snowflake warehouse utilization</strong>. The objective was to understand how effectively their virtual warehouses were being used — from size configurations to execution patterns and credits consumed.<br>As part of the engagement, I prepared some reports that covered:<br>(**I will share these reports in separate post)</p><ol><li>Warehouse Details<br>**Details of Warehouses’ Size, Type, min, max cluster, auto suspend, auto resume</li><li>Last 6 Month Usage History<br>a) Credit Usage Monthly Trend — Total and Average credit<br>****Helps identify peak usage periods, seasonal patterns, or anomalies in consumption, useful for cost optimization and forecasting.<br>b) Query/Jobs Monthly Trend — Total and Average Jobs/Queries<br>**Useful for understanding workload distribution, identifying underutilized resources, and planning capacity.</li><li>Warehouse IDLE Time<br>**insight into underutilized periods that may indicate optimization opportunities</li><li>User Wise Credit Usage(Last 6 Month Trend)<br>** provides insights into how individual users have consumed Snowflake credits over the past six months.</li><li>Heavy Queries by Execution Time<br>**highlights the most resource-intensive queries executed in Snowflake, based on their execution duration. Can be a good candidate for optimization</li><li>Spilling queries &amp; Long running queries<br>**Queries that exceed memory limits and spill intermediate data to local or remote storage. or Queries that take an unusually long time to complete, often due to large data scans, inefficient SQL, or resource contention.</li><li>and many more……….</li></ol><p>But while I was analyzing warehouse history, something unusual caught my attention.</p><p><strong>⚠️ What I Discovered</strong></p><p>While digging into query execution trends, I noticed a pattern:<br><strong><em>**Many small, sub-minute queries were now being executed on larger warehouses.</em></strong><br>These queries were earlier being handled efficiently by a Small or Medium warehouse, but now they were suddenly running on a Large or even XLarge.</p><p>Why does this matter?<br>Because Snowflake charges credits based on warehouse size, not query complexity.<br>So running a simple query on an XLarge warehouse is like using a truck to deliver a letter. Overkill — and expensive.</p><p><strong>🕵️ The Investigation</strong></p><p>To confirm my suspicion, I wrote a query to fetch the warehouse resize history and correlate it with query performance.</p><p>Here’s a simplified version of the query that helped uncover the truth:</p><blockquote>/*Query to Fetch WH Resize History */<br>/*Filter can be added if you want to fetch data for only particular warehouse or specific date range*/</blockquote><blockquote>WITH WEH<br>AS<br>(<br> SELECT<br> TIMESTAMP<br> WAREHOUSE_ID,<br> WAREHOUSE_NAME,<br> EVENT_NAME,<br> EVENT_STATE,<br> USER_NAME, <br> ROLE_NAME,<br> QUERY_ID<br> FROM <br> SNOWFLAKE.ACCOUNT_USAGE.WAREHOUSE_EVENTS_HISTORY <br> WHERE <br> event_name=’RESIZE_WAREHOUSE’<br>),<br>QH <br>AS<br>(<br> SELECT<br> USER_NAME, <br> ROLE_NAME,<br> QUERY_ID,<br> QUERY_TEXT,<br> START_TIME,<br> END_TIME<br> FROM<br> SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY <br> WHERE<br> EXECUTION_STATUS=’SUCCESS’ <br> and QUERY_TYPE=’ALTER’ <br> and QUERY_TEXT ilike ‘ALTER WAREHOUSE%’<br>)<br>Select <br> WEH.TIMESTAMP as ALTER_DATE,<br> — WEH.WAREHOUSE_ID,<br> WEH.WAREHOUSE_NAME,<br> WEH.EVENT_NAME,<br> WEH.EVENT_STATE,<br> WEH.USER_NAME, WEH.ROLE_NAME, — QH.USER_NAME, QH.ROLE_NAME,<br> — WEH.QUERY_ID, — QH.QUERY_ID,<br> — UPPER(QH.QUERY_TEXT),<br> REGEXP_SUBSTR(UPPER(QH.QUERY_TEXT), ‘WAREHOUSE_SIZE\\s*=\\s*’’([A-Z-]+)’’’, 1, 1, ‘e’, 1) AS WAREHOUSE_SIZE,<br> — REGEXP_SUBSTR(LOWER(query_text), ‘warehouse_size\\s*=\\s*’’([a-z-]+)’’’, 1, 1, ‘e’, 1)<br> REGEXP_SUBSTR(UPPER(QH.QUERY_TEXT), ‘WAREHOUSE_TYPE\\s*=\\s*’’(\\w+)’’’, 1, 1, ‘e’, 1) AS WAREHOUSE_TYPE,<br> QH.START_TIME, QH.END_TIME<br>FROM <br> WEH <br>LEFT JOIN <br> QH <br>on <br> WEH.QUERY_ID=QH.QUERY_ID<br>order by <br> WEH.WAREHOUSE_NAME, <br> WEH.TIMESTAMP DESC;</blockquote><p><strong>Expected Output:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/438/1*KcuUudok15HOY1efETwGgg.png" /></figure><p>Finally fetched query details for same query which executed before and after WH size changed. Required details can be prepared based on requirement from <em>QUERY_HISTORY </em>view.</p><p>One of the query for quick reference<br>(same can be tweaked based on requirement)</p><blockquote>/*Same Queries Before and After WH Size Changed*/<br>/*Data can filter based on Particular WH or specific date*/<br>SELECT<br> DISTINCT<br> QUERY_HASH,<br> any_value(left(query_text,100)) as sample_query_text_start,<br> WAREHOUSE_NAME,<br> — listagg(distinct WAREHOUSE_SIZE,’,’) as WAREHOUSE_SIZE,<br> WAREHOUSE_SIZE,<br> COUNT(*) AS query_count,<br> MIN(START_TIME) AS first_seen,<br> MAX(START_TIME) AS last_seen,<br> min(execution_time),max(execution_time)<br>FROM <br> SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY<br>WHERE 1=1<br> — AND START_TIME &gt;= DATEADD(DAY, -30, CURRENT_TIMESTAMP) — adjust time range<br> — AND EXECUTION_STATUS = ‘SUCCESS’<br> AND EXECUTION_TIME &gt; 0 — ensures compute was used<br> AND WAREHOUSE_NAME IS NOT NULL — excludes metadata-only queries<br> AND WAREHOUSE_NAME in(‘WH-1_LOAD’)<br> AND WAREHOUSE_SIZE is not null<br> — AND EXECUTION_TIME &lt;60000<br> — AND YEAR(start_time)=’2024&#39;<br> — AND USER_NAME in(‘USER1’, ‘USER2’) — Usually queries executed from Users can be good candidate<br> — AND USER_NAME in(‘SERVICE_ACCOUNT’) — Verify Application queries must get benefit after WH size changed<br>GROUP BY All<br>HAVING COUNT(*) &gt; 1 — Only Fetch queries which executed multiple times<br>ORDER BY <br> sample_query_text_start;</blockquote><p><strong>🎯 The Insight</strong></p><p>After analyzing the data:<br>✅ The same short queries used to run perfectly on Small/Medium warehouses<br>❌ After the warehouse was resized (to cater to heavier loads), these small queries also started executing on larger warehouses<br>💸 <strong>Result?</strong> <br>Wasted credits, without any performance benefit</p><p>🔄 <strong>Some of the Solutions</strong></p><p>Dynamic warehouse resizing or using separate warehouses for different workloads would help.</p><p>Suggestions I gave to the customer:<br>a) Split short-running queries into a dedicated smaller warehouse<br>b) Schedule heavy-load jobs to run on separate, on-demand scalable warehouses<br>c) Consider auto-suspend and auto-resume options to optimize cost<br>d) Use Resource Monitors to alert or control excessive credit usage</p><p><strong>🧠 Final Thoughts</strong></p><p>Snowflake is incredibly powerful — but with great power comes great responsibility (to monitor credit usage!).<br>Even small changes in warehouse configuration can have hidden cost implications if not reviewed regularly. Hopefully, this post helps you take a fresh look at your own setup.</p><p>💬 Have you audited your warehouse usage lately? Let me know if you’ve encountered similar issues — I’d love to hear how others are managing warehouse configurations and credit optimization.</p><p>🔁 Feel free to copy the query above and adapt it to your environment. If you need help customizing it, drop a comment or connect with me on LinkedIn.</p><p>#Snowflake #SnowflakeDB #CloudData #CostOptimization #DataEngineering #SQLTips #WarehouseInsights #SnowflakeQueryHistory #WarehouseResizeHistory #SnowflakeCredit</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0f17d8d64a9e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PostgreSQL incremental backups]]></title>
            <link>https://medium.com/@bhatia.gurupreet/postgresql-incremental-backups-60accd675337?source=rss-109d699d9b0f------2</link>
            <guid isPermaLink="false">https://medium.com/p/60accd675337</guid>
            <category><![CDATA[postgresql-database]]></category>
            <category><![CDATA[postgres]]></category>
            <category><![CDATA[backup-and-restore]]></category>
            <category><![CDATA[postgresql-tutorials]]></category>
            <category><![CDATA[postgresql]]></category>
            <dc:creator><![CDATA[Gurupreet Bhatia]]></dc:creator>
            <pubDate>Mon, 30 Jun 2025 12:14:02 GMT</pubDate>
            <atom:updated>2025-06-30T12:14:02.963Z</atom:updated>
            <content:encoded><![CDATA[<p>PostgreSQL 17 introduces native support for incremental backups, a major enhancement that significantly improves backup efficiency and storage management.</p><h3>Incremental Backups Working in PostgreSQL 17</h3><ol><li><strong>Baseline Full Backup Required</strong>:</li></ol><ul><li>You must start with a <strong>full backup</strong> using pg_basebackup without the incremental flag.</li><li>This backup includes a <strong>manifest file</strong> that tracks the state of all data blocks.</li></ul><p><strong>2. Incremental Mode in pg_basebackup</strong>:</p><ul><li>PostgreSQL 17 adds a new — incremental=PATH_TO_MANIFEST option to pg_basebackup.</li><li>This tells PostgreSQL to back up <strong>only the data blocks that have changed</strong> since the last backup (full or incremental).</li></ul><p><strong>3. Manifest Files</strong>:</p><ul><li>Each backup (full or incremental) generates a <strong>manifest file</strong>.</li><li>These files are used to track changes and ensure consistency across backup chains.</li></ul><p><strong>4. New WAL Summarizer</strong>:</p><ul><li>A new feature called summarize_wal helps reduce unnecessary WAL (Write-Ahead Logging) data, optimizing incremental backups further</li></ul><p><strong>5. Restoration with pg_combinebackup</strong>:</p><ul><li>PostgreSQL 17 introduces pg_combinebackup, a tool to <strong>reconstruct a full data directory</strong> from a full backup and a series of incremental backups</li></ul><h3>Benefits</h3><ul><li><strong>Faster Backups</strong>: Only changed data is processed.</li><li><strong>Reduced Storage</strong>: Less data to store, especially useful for large databases.</li><li><strong>Simplified Recovery</strong>: Easier to manage and restore from a chain of backups.</li></ul><h3>Example Workflow</h3><ol><li>Enable WAL summarization:</li></ol><pre>ALTER SYSTEM SET summarize_wal TO &#39;on&#39;;<br>SELECT pg_reload_conf();</pre><p>2. Take a full backup:</p><pre>pg_basebackup -D /path/to/full_backup</pre><p>3. Make changes to the database.</p><p>4. Take an incremental backup:</p><pre>pg_basebackup --incremental=/path/to/full_backup/backup_manifest -D /path/to/incremental_backup</pre><p>5. Restore using pg_combinebackup:</p><pre>pg_combinebackup --base=/path/to/full_backup --incremental=/path/to/incremental_backup -D /path/to/restore_dir</pre><h3><strong>Here’s a visual timeline illustrating my PostgreSQL 17 backup strategy:</strong></h3><p>Step-by-Step Standard Operating Procedure for managing PostgreSQL 17 backups using a full backup on Sunday and incremental backups for the rest of the week:</p><p>Objective here : To ensure efficient and reliable backups using PostgreSQL 17’s native incremental backup feature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*msy6P-D3FO5KaRVEBnTD8w.jpeg" /></figure><ul><li><strong>Sunday</strong>: Full Backup (highlighted in blue)</li><li><strong>Monday to Saturday</strong>: Incremental Backups (highlighted in green)</li></ul><h3>Step 1: Take a Full Backup on Sunday</h3><pre>pg_basebackup -D /backups/full/Sunday -F tar --write-recovery-conf</pre><h3>Step 2: Take Incremental Backups from Monday to Saturday</h3><p>For each day (e.g., Monday):</p><pre>pg_basebackup --incremental=/backups/full/Sunday/backup_manifest \<br>              -D /backups/incremental/Monday -F tar</pre><ul><li>Replace Monday with the appropriate day.</li><li>Each incremental backup will only store changed data blocks since the last backup.</li></ul><h3>Step 3: Verify Backups</h3><p>After each backup, verify the presence of:</p><ul><li>backup_manifest</li><li>WAL files (if applicable)</li><li>No errors in logs</li></ul><h3>Step 4: Restore from Backups (When Needed)</h3><p>Use pg_combinebackup to reconstruct the full data directory:</p><pre>pg_combinebackup --base=/backups/full/Sunday \<br>                 --incremental=/backups/incremental/Monday \<br>                 --incremental=/backups/incremental/Tuesday \<br>                 ... \<br>                 -D /restore_directory</pre><p>**Include all incremental backups in order.</p><h3>Additional Suggestion:</h3><ul><li>Always monitor disk usage and backup logs.</li><li>Automate this process using cron jobs or a backup scheduler.</li><li>Test restore procedures regularly to ensure data integrity.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60accd675337" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Query Optimization features in Snowflake]]></title>
            <link>https://medium.com/@bhatia.gurupreet/query-optimization-features-in-snowflake-bb4bc58c9940?source=rss-109d699d9b0f------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb4bc58c9940</guid>
            <category><![CDATA[cloud-data-warehouse]]></category>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[query-optimization]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[optimization]]></category>
            <dc:creator><![CDATA[Gurupreet Bhatia]]></dc:creator>
            <pubDate>Fri, 20 Jun 2025 11:39:26 GMT</pubDate>
            <atom:updated>2025-06-20T11:39:26.941Z</atom:updated>
            <content:encoded><![CDATA[<p>Snowflake is one of the most powerful and scalable data warehousing platforms available today. As your data footprint grows, optimizing query performance becomes increasingly critical. Fortunately, Snowflake offers several built-in services and features that can drastically improve performance when used effectively.</p><p>This article compares <strong>essential Snowflake services/features</strong> designed to boost query performance. These include both automatic optimizations and manual controls that data teams can apply strategically.</p><h3>1. Auto-Clustering Services</h3><p><em>Automatically manages clustering on designated tables without manual intervention.</em></p><h4>✅ Best Fit Use Cases:</h4><ul><li>Large tables with heavy read workloads</li><li>Frequently queried columns that are not clustered well</li><li>Balancing between important DML operations and performance</li></ul><h4>🚫 When not to use:</h4><ul><li>Queried filters not focused on a few columns</li><li>Frequent DML operations destroy clustering efficiency</li></ul><h4>💰 Cost and Difference:</h4><ul><li><strong>Compute cost only</strong>, no additional storage</li></ul><h4>🔍 Query Characteristics:</h4><ul><li>Local filter (most effective)</li><li>Join, aggregation, sorting, etc.</li></ul><p>More details available in Snowflake Documentation — <a href="https://docs.snowflake.com/en/user-guide/tables-auto-reclustering">here</a></p><h3>2. Materialized Views Services</h3><p><em>Precomputes and stores the result of a query for faster access to expensive operations.</em></p><h4>✅ Best Fit Use Cases:</h4><ul><li>Small result sets from large tables</li><li>Expensive queries like sorting, joining, or aggregations</li><li>Base data is relatively static</li></ul><h4>🚫 When not to use:</h4><ul><li>Simple queries on large tables without expensive logic</li><li>High data churn in the base table</li></ul><h4>💰 Cost and Difference:</h4><ul><li><strong>Compute and storage cost</strong></li><li>Base table change triggers view refresh</li></ul><h4>🔍 Query Characteristics:</h4><ul><li>Semi-structured data</li><li>External table data</li><li>Expensive aggregation operations</li></ul><p>More details available in Snowflake Documentation — <a href="https://docs.snowflake.com/en/user-guide/views-materialized#label-limitations-on-creating-materialized-views">here</a></p><h3>3. Search Optimization Service (SOS)</h3><p><em>Improves performance on filters over high-NDV (number of distinct values) columns across many micro-partitions.</em></p><h4>✅ Best Fit Use Cases:</h4><ul><li>Very small subset of data scattered across micro-partitions</li><li>Equality filters on high NDV columns (100K+)</li></ul><h4>🚫 When not to use:</h4><ul><li>Filters that don’t reduce much data</li><li>Queries using inequality conditions</li></ul><h4>💰 Cost and Difference:</h4><ul><li><strong>Compute + storage cost</strong></li><li>Implemented like an internal MV but optimized for indexing/filtering</li></ul><h4>🔍 Query Characteristics:</h4><ul><li>Semi-structured data</li><li>Substring search</li><li>Geo search</li></ul><p>More details available in Snowflake Documentation — <a href="https://docs.snowflake.com/en/user-guide/search-optimization-service">here</a></p><h3>4. Query Acceleration Service (QAS)</h3><p><em>Dynamically accelerates long-running queries using additional compute resources.</em></p><h4>✅ Best Fit Use Cases:</h4><ul><li>Large scans and ad-hoc queries</li><li>Mixed workloads with outliers</li><li>Unpredictable query durations</li></ul><h4>🚫 When not to use:</h4><ul><li>Enabled without tuning warehouse size or cluster count</li></ul><h4>💰 Cost and Difference:</h4><ul><li><strong>Snowflake-managed compute</strong>, no storage cost</li><li>Minimal setup time, plug-and-play flexibility</li></ul><h3>🔍 Query Characteristics:</h3><ul><li>SELECT/INSERT/CTAS</li><li>Long-running scans</li><li>Small cardinality group-bys</li></ul><p>More details available in Snowflake Documentation — <a href="https://docs.snowflake.com/en/user-guide/query-acceleration-service">here</a></p><h3>5. Result Caching</h3><p><em>Caches and reuses query results when nothing has changed in the underlying data.</em></p><h4>✅ Best Fit Use Cases:</h4><ul><li>BI tools with repeated queries</li><li>Static dashboards</li></ul><h4>🚫 When not to use:</h4><ul><li>Changing source tables frequently</li><li>Non-deterministic queries (e.g., CURRENT_DATE())</li></ul><h4>💰 Cost and Difference:</h4><ul><li><strong>No cost</strong> — zero compute or storage</li></ul><h4>🔍 Query Characteristics:</h4><ul><li>Identical queries on unchanged data</li><li>Great for repeated user-facing reports</li></ul><p>More details available in Snowflake Documentation — <a href="https://docs.snowflake.com/en/user-guide/querying-persisted-results">here</a></p><h3>6. Metadata Caching</h3><p><em>Caches metadata such as table schemas and statistics to speed up query planning.</em></p><h4>✅ Best Fit Use Cases:</h4><ul><li>Query workloads that hit the same metadata frequently</li><li>Complex joins with many tables</li></ul><h4>🚫 When not to use:</h4><ul><li>Simple, one-time queries</li><li>Metadata changing frequently</li></ul><h4>💰 Cost and Difference:</h4><ul><li><strong>Free and automatic</strong></li><li>Reduces planning latency, not execution time</li></ul><h4>🔍 Query Characteristics:</h4><ul><li>Large scale concurrent workloads</li><li>High query planning overhead</li></ul><h3>7. Clustering Keys (Manual)</h3><p><em>Manually define clustering keys to optimize micro-partition pruning.</em></p><h4>✅ Best Fit Use Cases:</h4><ul><li>Huge fact tables (billions of rows)</li><li>Filters using ranges or narrow column values</li></ul><h4>🚫 When not to use:</h4><ul><li>Overuse on small or volatile tables</li><li>Non-selective columns as cluster keys</li></ul><h4>💰 Cost and Difference:</h4><ul><li><strong>Compute-intensive during reclustering</strong></li><li>Can lead to faster scans and filter performance</li></ul><h4>🔍 Query Characteristics:</h4><ul><li>Filtering on sorted/range-based data</li><li>Partition pruning benefit</li></ul><h3>8. Materialized Columns (Expression-Based Clustering)</h3><p><em>Precompute and persist derived column values frequently used in queries.</em></p><h4>✅ Best Fit Use Cases:</h4><ul><li>Repeated transformations like DATE_TRUNC, UPPER, or type casting</li><li>Joins or filters on derived expressions</li></ul><h4>🚫 When not to use:</h4><ul><li>Expressions that change too frequently</li><li>Low-impact expressions on large datasets</li></ul><h4>💰 Cost and Difference:</h4><ul><li>Adds <strong>compute/storage during load/refresh</strong></li><li>Removes runtime computation overhead</li></ul><h4>🔍 Query Characteristics:</h4><ul><li>Complex filters/joins on derived columns</li><li>Query pipelines and frequent expressions</li></ul><h3>✅ Final Thoughts</h3><p>Snowflake offers a broad toolkit for optimizing performance. Selecting the right service depends on:</p><ul><li><strong>Data size</strong></li><li><strong>Query pattern</strong></li><li><strong>DML frequency</strong></li><li><strong>Latency or cost sensitivity</strong></li></ul><p>Here is quick reference:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TzZIo9B8C2VT2kaqHyQ5pQ.png" /></figure><p>💬 <strong>Have you used these features in production?</strong> Share your experience or tips in the comments!</p><p>🔔 <em>Follow for more content on Snowflake performance, data architecture, and cloud best practices.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb4bc58c9940" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Snowflake — Some Unavailable features]]></title>
            <link>https://medium.com/@bhatia.gurupreet/snowflake-some-unavailable-features-4a65ac70516b?source=rss-109d699d9b0f------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a65ac70516b</guid>
            <category><![CDATA[snowflake-data-cloud]]></category>
            <category><![CDATA[snowflake]]></category>
            <dc:creator><![CDATA[Gurupreet Bhatia]]></dc:creator>
            <pubDate>Wed, 18 Jun 2025 16:37:39 GMT</pubDate>
            <atom:updated>2025-06-18T16:45:08.973Z</atom:updated>
            <content:encoded><![CDATA[<h3>Snowflake: A Feature-Rich Platform with Room for Practical Enhancements</h3><p>**Some Unavailable Features</p><p>In my internal trainings and townhall sessions, I often begin with a bold statement:<br>“Whatever feature you’ve heard of, worked with, or imagined in any database — Snowflake likely has it.”<br>Snowflake is indeed one of the most feature-rich data platforms available today.</p><p>However, through hands-on experience, I’ve encountered certain scenarios where specific features — though not necessarily missing — could significantly enhance day-to-day operations if they were available. These are not gaps, but opportunities for Snowflake to become even more flexible and user-friendly.</p><p>Coming from a strong background in Greenplum and PostgreSQL, I’m well-versed in a wide range of commands, utilities, and features. This made my transition to Snowflake relatively smooth, and I believe it’s an easy platform to adopt for most users. That said, my PostgreSQL experience also highlighted a few areas where Snowflake could evolve further.</p><p>Below, I’ve outlined some of these features based on real-world usage and practical needs — not AI-generated insights, but genuine observations from working extensively with Snowflake.</p><h4>1. Case Conversion in Snowflake Editor</h4><p>Most modern editors support quick case transformation using shortcuts like Ctrl+U or Ctrl+Shift+U. In Snowflake, I often work with object names and SQL keywords in uppercase. However, when copying DDLs from other databases (especially PostgreSQL), object names often appear in lowercase with double quotes.<br>To convert these, I currently rely on external editors like Notepad++ before pasting the script back into Snowflake.<br>Suggestion: Snowflake should introduce built-in case conversion shortcuts in the Snowflake editor to streamline this process.</p><h4>2. Print Variable Values for Debugging</h4><p>Debugging stored procedures in Snowflake is not straightforward. Unlike other platforms (e.g., RAISE NOTICE in PostgreSQL, DBMS_OUTPUT.PUT_LINE in Oracle), Snowflake lacks a direct way to print variable values during execution.<br>Current workarounds include:</p><ul><li>Using RETURN statements</li><li>Logging to a table and querying it post-execution</li><li>Aggregating variables into arrays and returning them</li></ul><p>Suggestion: Snowflake should provide a native utility or function to print/log variable values during procedure execution for easier debugging.</p><h4>3. Appending IPs to Network Policies</h4><p>Currently, to add new IPs to a network policy, I must:</p><ol><li>Query existing IPs</li><li>Manually append new IPs</li><li>Reconstruct the full list and run an ALTER NETWORK RULE command</li></ol><p>This manual process is error-prone.<br>Suggestion: Snowflake should introduce a SQL-based method to append or remove IPs from existing network policies without reconstructing the entire list.</p><h4>4. Warehouse History in Account Usage</h4><p>There is no direct view in ACCOUNT_USAGE to track historical changes to warehouse configurations (e.g., size changes).<br>While alternative methods exist, they are not straightforward.<br>Suggestion: Snowflake should add a dedicated view in ACCOUNT_USAGE to track warehouse size changes, suspensions, resumptions, and other operational metadata.</p><h4>5. Dashboard Tab Support for Reports</h4><p>Snowflake dashboards are visually appealing, but when multiple reports are added, they can become cluttered.<br>In one use case, I created a dashboard showing:</p><ul><li>Credit usage by warehouse over time</li><li>Query execution trends</li><li>Storage utilization</li><li>User-level activity</li></ul><p>All reports were relevant but crowded into a single view.<br>Suggestion: Snowflake should enable tabbed dashboards (like ServiceNow) to organize reports by category (e.g., Storage, Queries, Warehouses) for better interactivity and readability.</p><h4>6. Error Tracking for External Tables</h4><p>When querying external tables, bad rows in files can cause issues. Unlike Greenplum’s error tables or Oracle’s badfile, Snowflake lacks a direct mechanism to capture these rows.<br>The workaround using VALIDATION_MODE = &#39;RETURN_ERRORS&#39; is helpful but manual.<br>Suggestion: Snowflake should introduce a native error table or logging mechanism for external tables to automatically capture and store bad rows for review.</p><p>Thanks.<br>I’m in the learning phase — there may be more features that Snowflake users require for their day-to-day operations. I’ll continue to share such insights based on my experience.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a65ac70516b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>