Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 13425

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.

30 votes
4 answers
18k views

Is there a way to show the creation statement for an index in PostgreSQL

I need to recreate an index in PostgreSQL which has suffered index bloat. Since I need the index to be usable while it's being created, I can't use REINDEX. … I am going to recreate the index with a new name and then drop the old one. Is there any way to see the SQL statement that was used to create an index so I can just copy that? …
Amandasaurus's user avatar
4 votes
0 answers
760 views

Postgres: CREATE INDEX, but very slowly, to reduce performance hit on rest of database?

However there is another use I need later, and I will need to create a large (hundreds of gigabyte) index. … Is there anyway to create an index in postgres, but at a very low priority? So that it'll take longer to create the index, but the performance hit will be less. …
Amandasaurus's user avatar
26 votes
2 answers
19k views

Detect when a CREATE INDEX CONCURRENTLY is finished in PostgreSQL

If I create an index CONCURRENTLY in PostgreSQL, how can I see when it is finished? … I am attempting to rebuild indexes to solve index bloat, and I need to keep the old index around for a while until the new one has finished, so I need to know when it's finished. …
Amandasaurus's user avatar
3 votes
1 answer
9k views

Why does MySQL (InnoDB) table get faster after OPTIMIZE TABLE, but then don't work?

EXPLAIN on the same query gave a different, and much more sensible result, showing that it can use an index on each one, and that it doesn't have to scan the whole lot. … How can I "rebuild secondary index"? I tried doing ALTER TABLE A ENGINE=InnoDB (and the same for B & C) and there was no change. …
Amandasaurus's user avatar
4 votes
1 answer
913 views

In PostgreSQL, can you read from an index during a ALTER INDEX ... SET TABLESPACE operation?

However this is a production system, and the index is useful for making read performance acceptable, so I want the index to be usable as an index while it is being moved from one tablespace to another. … To change the tablespace of an index, you must own the index and have CREATE privilege on the new tablespace. …
Amandasaurus's user avatar
1 vote
1 answer
3k views

Is my postgres index being used?

There is a large index, and I'm unsure if it's being used. … The index is about 130G and the table 50G. …
Amandasaurus's user avatar
1 vote
1 answer
373 views

Will this SQL snippet REINDEX my GIN index? Why is it renaming an old index onto another?

However it would not reindex that large index, since it's a GIN index. It suggested this SQL snippet as a way to reindex this index. … index bloat? …
Amandasaurus's user avatar