---
title: "Discussion on \"ClickHouse ORDER BY 排序优化 optimize_read_in_order 参数\" | Hashnode"
description: "Discussion on \"ClickHouse ORDER BY 排序优化 optimize_read_in_order 参数\". 起因\n排查到线上的一条 SQL 执行的非常慢，SQL 语句如下，其中 prewhere 的限制条件有许多，这里省略了：\nSELECT UUIDNumToString(info_id) as uid, * FROM people PREWHERE ((location_id = 111 AND capture_time >= 1632312295 AND capture_time <= 1632312415) \nname in (\"zhenng\",\"zheng\",\"zhang\") ORDER BY..."
url: "https://hashnode.com/posts/clickhouse-order-by-optimizereadinorder/62d4c7ac2f40e31decd8e78e"
---

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

Discussion

# [ClickHouse ORDER BY 排序优化 optimize\_read\_in\_order 参数](https://zhengsongling.com/clickhouse-order-by-optimizereadinorder?utm_source=hashnode&utm_medium=feed)

起因 排查到线上的一条 SQL 执行的非常慢，SQL 语句如下，其中 prewhere 的限制条件有许多，这里省略了： SELECT UUIDNumToString(info\_id) as uid, \* FROM people PREWHERE ((location\_id = 111 AND capture\_time >= 1632312295 AND capture\_time <= 1632312415) name in ("zhenng","zheng","zhang") ORDER BY...

Jul 18, 2022 · 1 min read · zhengsongling.com  
Read the article

-   [#sql](https://hashnode.com/tag/sql)
-   [#clikchouse](https://hashnode.com/tag/clikchouse)

## Written by

[zhengsl](https://hashnode.com/@zhengsl)

@zhengsl

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

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
