<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/postgres-rls-index-traps-duckdb-runs-inside-mysql-9-7-ped5cjbw7" -->

---
title: Postgres RLS index traps, DuckDB runs inside MySQL 9.7
description: Two deep Postgres posts today cover RLS gotchas that silently kill index usage and the real behavior of enable_seqscan. An experimental MySQL 9.7 build...
canonical: https://daily.dev/posts/postgres-rls-index-traps-duckdb-runs-inside-mysql-9-7-ped5cjbw7
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Postgres RLS index traps, DuckDB runs inside MySQL 9.7 | daily.dev
og:description: Two deep Postgres posts today cover RLS gotchas that silently kill index usage and the real behavior of enable_seqscan. An experimental MySQL 9.7 build...
og:url: https://daily.dev/posts/postgres-rls-index-traps-duckdb-runs-inside-mysql-9-7-ped5cjbw7
og:image: https://api.daily.dev/og/posts/ped5CJbW7.png
og:image:alt: Postgres RLS index traps, DuckDB runs inside MySQL 9.7
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Postgres RLS index traps, DuckDB runs inside MySQL 9.7

**[Databases Digest](https://daily.dev/sources/databases_digest)** · 5 min read · 0 upvotes · 0 comments

## Summary

Two deep Postgres posts today cover RLS gotchas that silently kill index usage and the real behavior of enable_seqscan. An experimental MySQL 9.7 build integrates DuckDB as a storage engine, completing all 22 TPC-H queries in ~15 seconds where InnoDB timed out on 6. Datadog published how they migrated a critical metrics pipeline from FoundationDB to Postgres using AI-assisted TDD, cutting operation times from 45 minutes to ~1 second and database costs by 90%. Doltgres hits 99% SQL Logic Test compliance with a 1.0 release targeted for August 6th.

## Content

**TLDR:** Two deep Postgres posts today cover RLS gotchas that silently kill index usage and the real behavior of enable_seqscan. An experimental MySQL 9.7 build integrates DuckDB as a storage engine, completing all 22 TPC-H queries in ~15 seconds where InnoDB timed out on 6. Datadog published how they migrated a critical metrics pipeline from FoundationDB to Postgres using AI-assisted TDD, cutting operation times from 45 minutes to ~1 second and database costs by 90%. Doltgres hits 99% SQL Logic Test compliance with a 1.0 release targeted for August 6th.

---

## Postgres RLS silently breaks indexes when leakproof is missing

Five concrete RLS gotchas worth knowing. The most dangerous: omitting LEAKPROOF on functions prevents the planner from using btree, gin, and gist indexes entirely — and this applies to common operators like text LIKE, enum comparisons, jsonb queries, and tsvector. Multiple permissive policies create OR conditions that also break index usage. The fix for constant expressions is wrapping them in a subquery to force an InitPlan. For multi-tenant schemas, redundant columns plus multi-column indexes are the recommended pattern. None of this is well-documented, which makes it easy to ship RLS thinking you're protected while quietly doing full table scans. [Read more](https://daily.dev/posts/3mm5GanQQ)

## DuckDB as a MySQL 9.7 storage engine: InnoDB times out, DuckDB finishes in 15 seconds

An experimental open-source project (ducksdb-mysql-engine, GPLv2) plugs DuckDB in as a MySQL storage engine via a custom pushdown_select hook. Tables marked ENGINE=DuckDB route qualifying queries to DuckDB's columnar engine transparently, falling back to the row path otherwise. TPC-H at scale factor 10: InnoDB timed out on 6 of 22 queries and took 1,317 seconds on the rest; the DuckDB engine completed all 22 in ~15 seconds. At SF100 (600M rows) it stays correct on all 22 queries and loads data roughly 4x faster than MariaDB's DuckDB integration. Explicitly experimental — not production-ready — but the benchmark gap is hard to ignore. [Read more](https://daily.dev/posts/hhXnvB0s1)

## Datadog migrates FoundationDB metrics pipeline to Postgres: 45-minute ops drop to ~1 second

Datadog's Stream Router API moved from a key-value FoundationDB backend to Postgres using Claude and Cursor in a test-driven workflow. The AI tools weren't autonomous — each method refactor was guided by providing the old implementation, new schema, and a failing test. Results: operation times from 45 minutes to ~1 second, latency from hundreds of milliseconds to a few, storage shrunk up to 40x, and database costs down 90%. The three enablers were strong modularity, a comprehensive test suite, and a blue/green validator comparing responses in parallel. Limitations worth noting: AI couldn't independently discover query optimizations like batching and CTEs, and unfiltered test output dumps burned tokens fast. [Read more](https://daily.dev/posts/fkPp9yv7O)

## Doltgres hits 99% SQL Logic Test compliance, 1.0 release set for August 6th

Doltgres, the version-controlled Postgres-compatible database, cleared 99% on its SQL Logic Test suite. Getting there required fixing integer/float type differences, empty result set handling, Postgres-specific type names, and filtering out SQLite/MySQL assumptions baked into the test runner itself. The one real bug found was in COALESCE(), which was using incorrect type conversion for mixed numeric types instead of Postgres assignment cast rules. Parallelizing the test runner also cut iteration time significantly. The 1.0 release is on track for August 6th. [Read more](https://daily.dev/posts/HHNyMGooh)

---

## Also notable

- **enable_seqscan = off doesn't disable sequential scans, it just penalizes them:** If no usable index exists, Postgres still picks a seq scan — PostgreSQL 18's EXPLAIN output now labels it 'Disabled: true' to make this visible. The real levers are effective_cache_size, setting random_page_cost to ~1.1 for SSD/NVMe, and running ANALYZE; enable_seqscan = off belongs in per-session diagnostics only, never postgresql.conf. [Read more](https://daily.dev/posts/ope0ha3wx)
- **ClickHouse stores 16.2 billion tick rows at 19x compression for under $2/month:** A walkthrough loading Binance futures data into ClickHouse Cloud shows 191 GiB of raw CSV compressing to ~10 GiB using DoubleDelta and LowCardinality codecs, with a primary index on (symbol, ts) skipping 99.999% of data on VWAP and ASOF JOIN queries across the full 16-billion-row dataset. [Read more](https://daily.dev/posts/sy7cmudmc)
- **SOFTSWISS replaces SIEM with ClickHouse, saves $300K/year handling 700K events/sec:** Their stack: Vector for collection, Kafka for ingestion, ClickHouse with tiered SSD/HDD/S3 storage, and Sigma+SQL for detection-as-code — retaining 100TB+ of security data with analysts pivoting from token search to analytical correlation in a single dataset. [Read more](https://daily.dev/posts/u22175hat)
- **Confluent Tableflow materializes Kafka topics as Iceberg or Delta Lake tables automatically:** Tableflow converts Avro/JSON Schema/Protobuf topic data to Parquet, generates Iceberg/Delta metadata, and publishes to AWS Glue or Unity Catalog — tables are then queryable from Snowflake, Databricks, Athena, Trino, and BigQuery with schema evolution handled via Schema Registry. [Read more](https://daily.dev/posts/pOFBfqmWZ)
- **Django 6.0.7 and 5.2.16 patch three CVEs, upgrade immediately:** Three new CVEs are addressed in these security releases; all Django users should upgrade, with the 2026 Django Developer Survey closing July 13th. [Read more](https://daily.dev/posts/d1ndAh8bX)

## Similar posts on daily.dev

- [Doltgres Reaches 99% Compliance on SQL Logic Tests](https://daily.dev/posts/doltgres-reaches-99-compliance-on-sql-logic-tests-hhnymgooh) · DoltHub Blog · 0 upvotes · 0 comments
- [DuckDB Ecosystem Newsletter : April 2026](https://daily.dev/posts/duckdb-ecosystem-newsletter-april-2026-cow8bcbct) · MotherDuck · 0 upvotes · 0 comments

---

Tags: [#backend](https://daily.dev/tags/backend), [#postgresql](https://daily.dev/tags/postgresql), [#clickhouse](https://daily.dev/tags/clickhouse), [#duckdb](https://daily.dev/tags/duckdb)

[View this post on daily.dev](https://daily.dev/posts/postgres-rls-index-traps-duckdb-runs-inside-mysql-9-7-ped5cjbw7)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/postgres-rls-index-traps-duckdb-runs-inside-mysql-9-7-ped5cjbw7","headline":"Postgres RLS index traps, DuckDB runs inside MySQL 9.7","text":"Two deep Postgres posts today cover RLS gotchas that silently kill index usage and the real behavior of enable_seqscan. An experimental MySQL 9.7 build integrates DuckDB as a storage engine, completing all 22 TPC-H queries in ~15 seconds where InnoDB timed out on 6. Datadog published how they migrated a critical metrics pipeline from FoundationDB to Postgres using AI-assisted TDD, cutting operation times from 45 minutes to ~1 second and database costs by 90%. Doltgres hits 99% SQL Logic Test compliance with a 1.0 release targeted for August 6th.","url":"https://daily.dev/posts/postgres-rls-index-traps-duckdb-runs-inside-mysql-9-7-ped5cjbw7","datePublished":"2026-07-11T04:18:00.359Z","dateModified":"2026-07-11T04:18:19.925Z","author":{"@type":"Organization","name":"Databases Digest","logo":"https://media.daily.dev/image/upload/s--ir1hdV8b--/f_auto,q_auto/v1773839400/logos/databases_digest?_a=BAMAMiiu0","url":"https://daily.dev/sources/databases_digest"},"interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/sources/databases_digest","name":"Databases Digest"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Databases Digest","item":"https://daily.dev/sources/databases_digest"},{"@type":"ListItem","position":3,"name":"Postgres RLS index traps, DuckDB runs inside MySQL 9.7"}]}
```

