CARVIEW |
Select Language
HTTP/2 200
date: Wed, 30 Jul 2025 21:20:44 GMT
content-type: text/html; charset=utf-8
cf-ray: 9677e6d089e6c1b3-BLR
cf-cache-status: DYNAMIC
cache-control: private
set-cookie: prov=80487775-d347-492c-9ce1-0213b2ee7678; expires=Thu, 30 Jul 2026 21:20:43 GMT; domain=.stackexchange.com; path=/; secure; httponly
strict-transport-security: max-age=31536000; includeSubDomains
vary: Accept-Encoding
content-security-policy: upgrade-insecure-requests; frame-ancestors 'self' https://stackexchange.com
x-clacks-overhead: GNU Terry Pratchett
x-frame-options: SAMEORIGIN
x-request-guid: f85d3a38-a453-47ef-a06b-0f593c5d05a8
x-worker-origin-response-time: 454000000
x-dns-prefetch-control: off
set-cookie: prov=80487775-d347-492c-9ce1-0213b2ee7678; Path=/; HttpOnly; Domain=stackexchange.com
set-cookie: __cf_bm=uautoRFhU3A3ixljey1iSzqXmPAxUh59OEVFvaDnWig-1753910444-1.0.1.1-g_prMjDKGPH.aDpsEfD7v9M48CKcajqdUDA7IrHX7kPiaCYwPEzLDyDhx0_XxQokIZapiwWjOP1COoZVvWK.Fw7iU0CpOZLVejsaC3rvKOQ; path=/; expires=Wed, 30-Jul-25 21:50:44 GMT; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
set-cookie: _cfuvid=mpG3EuuFyA_KkU17048rEX9w_sc5_aGEQgDr3FOqKVc-1753910444076-0.0.1.1-604800000; path=/; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
server: cloudflare
content-encoding: gzip
Newest 'index' Questions - Database Administrators Stack Exchange
Skip to main content
Stack Exchange Network
Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange
The 2025 Developer Survey results are in. Explore insights into technology and tools, careers, community and more.
View results.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about TeamsQuestions 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,408 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
2
votes
0
answers
25
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 ...
1
vote
1
answer
36
views
working of index in join query
My question is regarding the Explain output. Please refer the below query and its Explain command output
Explain
update
test.table1 t1
join test.table2 t2
on t1.field1=t2.field1
and t1.field2=t2....
0
votes
2
answers
79
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 ...
1
vote
2
answers
148
views
Efficient approach for filtering, paging and sorting across multiple tables with multiple key columns
I have a query that retrieves data from a complex data structure involving multiple tables. The data can be filtered using a tree component that allows selection of different keys from different ...
3
votes
3
answers
76
views
Ensure only one association record with future expiry date in Postgres
The Schema
Say I have the following:
table user
id bigint
table promo_codes
user_id bigint
code string
expires_at datetime NOT NULL
invalidated_at datetime
The Need
Each user can have only one promo ...
6
votes
4
answers
719
views
If all of the indexes of a table are partitioned with the same function and scheme but on different columns, is it still considered aligned?
The documentation says the following
Aligned index
An index that is built on the same partition scheme as its corresponding table. When a table and its indexes are in alignment, the database engine ...
0
votes
0
answers
22
views
Can I use r-tree indexes to find MAX(), MIN() values in arbitrary intervals quickly?
As far I can see, r-tree indexes are used today mostly for geographic systems, for spatial searches.
I need some very similar, but not in space, but in 1-D time series.
Imagine a huge time series, for ...
3
votes
2
answers
192
views
Same leading key column in unique constraint and nonclustered index - duplicate
These are two indexes on the table with the same leading key column.
First is a unique constraint with additional keys:
ALTER TABLE dbo.MyTable ADD CONSTRAINT ...
1
vote
1
answer
74
views
How can low selectivity filters elicit seek rather than table scan?
Values that are low selectivity can elicit a seek operation which is typically more efficient by directly seeking out only the data pages of the rows needed to serve the query.
https://dba....
1
vote
1
answer
67
views
For two oracle tables is it possible to keep their primary keys in separate integer ranges?
For two Oracle database tables in the same schema,
is it possible to keep their primary keys totally separate, so that an integer representing a primary key would appear in at most one of these tables?...
1
vote
3
answers
371
views
is worth an index on subset keys or distinct? [closed]
I have a huge table with the following fields:
Table dbo.Event:
Day
Event_id
Event_type
Description
...
Index IX_Event: unique clustered (Day , Event_id )
About data, for each day there are ...
1
vote
2
answers
186
views
with composite keys, do I still need index for all columns separately?
If I have a composite key made from 3 columns, like
constraint some_index unique (parent_store_id, store_type, store_name),
AND I also need to be able to make select queries with where store_type = .....
1
vote
1
answer
40
views
Greenplum/Postgres - Why not backward index scan?
I have this query running on Greenplum 6(Postgres 9.4) too slow as it performing a sequential scan. But I am thinking why it's not performing an index backward scan to fetch the records since there is ...
0
votes
1
answer
52
views
How does PostgreSQL Use my composite index without the middle column in the query?
I have the following table:
CREATE TABLE transactions
(
id NUMERIC(20, 0) NOT NULL DEFAULT NEXTVAL('transactions_sequence') PRIMARY KEY,...
0
votes
0
answers
41
views
Why does Postgres use filter instead of index scan when there are non-negligible number of null records?
This is my table:
learning_postgres=# create table r(id serial primary key, x int not null, y int);
CREATE TABLE
learning_postgres=# create index r_x_btree_idx on r using btree (x);
CREATE INDEX
...
- The Overflow Blog
-
-
- Featured on Meta
-
-
Related Tags
sql-server × 977
postgresql × 929
mysql × 815
performance × 620
index-tuning × 364
query-performance × 307
optimization × 217
oracle × 176
postgresql-performance × 168
innodb × 148
database-design × 146
execution-plan × 126
sql-server-2008 × 125
sql-server-2008-r2 × 111
clustered-index × 104
mariadb × 94
partitioning × 92
sql-server-2012 × 86
mongodb × 85
primary-key × 80
full-text-search × 75
join × 69
unique-constraint × 69
nonclustered-index × 67
sql-server-2014 × 60
more related tags
Hot Network Questions
- Is Spock performing a mind meld in Dagger of the Mind?
- Has the similarity between diagrams of the expanding universe and of vapour pressure in mixtures been noted by others? Is this just coincidence?
- I have made a darligton pair circuit to amplify +/- 10mA to +/- 10 A . But it showing only postive swing. i need negative swing too. what should i do
- Can Trump sue South Park?
- Filled \infty symbol
- Golden-section optimization with complication
- How to test whether a secondary inet address exists on an eth interface?
- Uniqueness of multiple unnamed namespaces within translation unit
- EU/USA trade deal - is it really a done deal?
- Wolf and sheep probability
- What are the consequences of allowing breaking/returning from every statement?
- Proving a number of base 2 non-recurring if converted to base 10 having the same decimal point position from the right of the number
- How can I secure an old iron gate with a padlock?
- Integral with multiple variables
- Is it common practice to run neutral and ground to the same bar?
- When using Da Capo, does that normally include a pick up?
- QuantLib `RangeAccrualFloatersCoupon` instanciation fails
- What constitutes a 'structure' made of Force for the purposes of a Forcebreaker Weapon?
- What are ways to prevent overly long ballots?
- Short story about a scientific rivalry that leads to madness
- Looking for a piece of writing that describes the head of Michelangelo's David floating in space
- Hill Estimator for SkewStudentT is Biased
- Pokémon movie where Team Rocket is floating in calming water
- If Satan is not omnipresent, how can he tempt or test multiple people at the same time in different places?