Database Indexing Performance

Cluster focuses on discussions about indexes in relational databases, particularly clustered and covering indexes in PostgreSQL vs MySQL/SQL Server, table scans, columnar vs row storage, and performance implications.

📉 Falling 0.3x Databases
4,027
Comments
20
Years Active
5
Top Authors
#2215
Topic ID

Activity Over Time

2007
10
2008
20
2009
46
2010
88
2011
72
2012
142
2013
121
2014
127
2015
142
2016
260
2017
276
2018
212
2019
227
2020
225
2021
421
2022
499
2023
428
2024
392
2025
284
2026
35

Keywords

RAM MS e.g CPU CREATEINDEX BigQuery SQL PG MSSQL JSONB index indexes table columns data disk rows row postgresql queries

Sample Comments

osigurdson Sep 15, 2024 View on HN

You absolutely need a covering index in a relational DB. This way the data is read entirely from the index. The table just essentially goes along for the ride. The extra storage is a little distasteful from a conceptual / academic perspective but it works ok below a certain scale (low B rows). Beyond that use ClickHouse (but understand how it works - don't treat it as a "magic data box").

polskibus May 22, 2021 View on HN

Postgresql does not have real, maintained with each change, clustered index. That itself makes it worse for many workloads than MySQL

VHRanger Jun 4, 2022 View on HN

unlikely - postgres stores data row-wise and this assumes sequentially stored columns. They even mention that issue in the blog post.It would be more likely to show up in something like Apache Arrow which is designed columnar to leverage these sort of tricks

manigandham Jul 2, 2018 View on HN

Columnstores don't use indexes, and many don't even support them (like BigQuery). You may be taking about clustering, which you can use to improve compression and scan speed by sorting data by commonly queried columns but it's unnecessary, and even table scans are fast in modern columnstores that can prune partitions and use sophisticated metadata to calculate your answers.Also it's SQL, what is preventing anyone from searching on any field they need? You don't need i

dominotw May 8, 2022 View on HN

what about db table scan vs index. that happens all the time.

polskibus Apr 3, 2020 View on HN

It would be if it had real clustered indexes like MS SQL, ie. Tables as btrees that are maintained with each update.

srcreigh Sep 3, 2021 View on HN

Is it? He doesn't mention aggregate queries, but seems to want to load a single row without unnecessary columns. Columnar DBs would spread a row out across the disk which would probably be less efficient.

hobs Nov 21, 2013 View on HN

Does pg have the concept of a clustered index? If so, for frequent inserts/updates it could actually matter.

superturkey650 Aug 30, 2019 View on HN

It is if your table is just a datastore with no foreign key links or indexes.See another reply in this thread: https://news.ycombinator.com/item?id=20841814

chrisbolt Oct 11, 2013 View on HN

Doesn't that make sense if data is clustered by the primary key, as InnoDB does?