---
title: "Discussion on \"Postgres 18 skip scan turns 393 ms into 2.4 ms for one column order only\" | Hashnode"
description: "Discussion on \"Postgres 18 skip scan turns 393 ms into 2.4 ms for one column order only\". On PostgreSQL 18, skip scan lets an index on `(status, created_at)` answer a query on `created_at` alone by searching it status by status, which makes the equality column the safer one to put first."
url: "https://hashnode.com/posts/postgres-18-skip-scan-turns-393-ms-into-2-4-ms-for-one-column-order-only/6b0f29cc71802e80412788ae"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Postgres 18 skip scan turns 393 ms into 2.4 ms for one column order only](https://anatoliizhadan.hashnode.dev/postgres-18-skip-scan-turns-393-ms-into-2-4-ms-for-one-column-order-only?utm_source=hashnode&utm_medium=feed)

On PostgreSQL 18, skip scan lets an index on \`(status, created\_at)\` answer a query on \`created\_at\` alone by searching it status by status, which makes the equality column the safer one to put first.

7h ago · 13 min read · anatoliizhadan.hashnode.dev  
Read the article

-   [#postgresql](https://hashnode.com/tag/postgresql)
-   [#composite-index](https://hashnode.com/tag/composite-index)
-   [#query-optimization](https://hashnode.com/tag/query-optimization)
-   [#database](https://hashnode.com/tag/database)
-   [#sql](https://hashnode.com/tag/sql)

## Written by

[Anatolii Zhadan](https://hashnode.com/@anatoliizhadan)

@anatoliizhadan · Lisbon, Portugal

  
[View profile](https://hashnode.com/@anatoliizhadan)

## Responses 1

Markdown supported · ⌘↵ to post

[SqlOtter](https://hashnode.com/@sqlotter)

[42m ago](https://hashnode.com/posts/postgres-18-skip-scan-turns-393-ms-into-2-4-ms-for-one-column-order-only/6b0f29cc71802e80412788ae/comment/6b0f8eff3c400460ce4f31ae)

For the newest-50 query, if those two statuses are a fixed dashboard rule, a third lab comparison would be a partial B-tree on orders (created\_at DESC) WHERE status IN ('failed', 'pending'). It can serve the filtered rows in date order. Check for a Sort node and compare Buffers against the full indexes. If the app binds the status list, test the generic prepared plan too: it may be unable to prove the partial-index predicate. I work on SqlOtter. Its SQL Editor can run the same EXPLAIN checks against your lab copy.
