Questions tagged [index]
A database structure that can improve the speed of queries at the cost of disk space and slower inserts/updates. It stores a copy of one or more columns sorted but structures the data differently to allow faster access.
3,415 questions
3 votes
1 answer
76 views
What is the maintenance on the index caused by insert, update, or delete operations?
Follow up question for this answer regarding the excerpt of the sys.dm_db_index_usage_stats doc: The user_updates column is a counter of maintenance on the index caused by insert, update, or delete ...
0 votes
0 answers
65 views
Removing Text Columns to Alleviate Indexing Issues
I have a couple of tables in a database which I inherited which have NVARCHAR(MAX) columns. Now that the data is several million rows, adding an index takes a long time and because of those columns, I ...
0 votes
0 answers
23 views
GridDB Cloud: is CREATE INDEX on a TimeSeries container an online (non-blocking) operation?
I run GridDB on GridDB Cloud (Free plan) with a single TimeSeries container that’s actively ingesting data. I need to add a secondary index on deviceid to speed up point/range lookups. Environment: ...
1 vote
0 answers
32 views
Do I need a secondary index on a non–row-key column for this query, and how do I create/verify it?
I’m testing GridDB Cloud with a 3-column Collection container: field type sensor_id STRING row key temperature FLOAT recorded_at TIMESTAMP I insert a row and then query by a non–row-key column: ...
0 votes
3 answers
99 views
Correct way to index a boolean column when used with other columns
When implementing soft delete on a table that can be searched by other columns, which is the correct way to index it? Let's say the table has an id field, and a couple of text fields, and finally a ...
0 votes
1 answer
74 views
MariaDB uses a unique index on one server, but not others
What makes MariaDB (10.6.22) use a unique index in queries on one server (production) but not on others (staging and dev, both of which are based on the production dumps). Namely I have a table ...
2 votes
0 answers
29 views
How can I use multicolumn indexes to efficiently find the most recent record for EACH unique id (Postgres)? [duplicate]
I have a large temporal table (>20 million rows) that contains data over time on about 15k unique objects. I can't figure out how to efficiently query "get the most recent record for each ...
0 votes
2 answers
100 views
Is it reasonable to use indexes that cover more than two columns?
Suppose I have a table file with four columns name, uploaded_at, size and mime_type. I want the user to be able to sort by these columns in any order and direction (ASC/DESC). So, as far as I know, I ...