Search Results
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 |
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.
5
votes
Accepted
Is there any point with a combined index on all columns in a table?
The index is a sorted structure - if you need only a sufficiently small portion of the data in the table, it could be fetched from the index more efficiently. … This needs a few prerequisites, though:
PostgreSQL version 9.2 or newer, as index-only scans appeared in this version
the index supports the query (the order of the columns of the index decides this) …
3
votes
Benefits of BTREE in MySQL
From the documentation:
index_type
Some storage engines permit you to specify an index type when creating
an index. … Where multiple index
types are listed, the first one is the default when no index type
specifier is given. …
1
vote
1
answer
1k
views
slow index scan on postgresql 9.1
Index Cond: (munkalap_id = ml.munkalap_id)
Filter: ((NOT lezarva) AND (NOT torolve))
-> Index Scan using pk_munkalap_statusz on munkalap_statusz ms (cost=0.00..0.27 rows=1 … =4) (actual time=0.008..0.113 rows=1027 loops=1)
Total runtime: 18725.001 ms
The index definition is:
CREATE INDEX idx_munkalap_lepes_aktualis ON hibabejelentes.munkalap_lepes
USING btree (aktualis …
2
votes
Accepted
slow index scan on postgresql 9.1
So the index scan and the whole query run quite fast as one would expect. …
2
votes
Accepted
How to store values of all columns in an index in PostgreSQL?
Of course, you can create an index which would contain all columns from the rows. … The difference between the 'raw' table and this index will only show if the query picks only a part of all rows, based on the first column(s) of the index. …
2
votes
Are these extra Index fields needed?
Provided you have an index on user_id (or a compound index with user_id as the first column) and a user does not have to many rows, you don't have to index final_point and total_rank. …
6
votes
Accepted
Is the speed of a PostgreSQL SELECT adversely affected by too many indexes on the table?
No, the query performance will not be affected, or not very much. Indexes are updated on DML statements (and TRUNCATE) while they may or may not be used when executing a query.
The decision whether …
2
votes
Run query faster, what index to use
Furthermore, an index like
CREATE INDEX idx_emissions_totales_residentiel
ON emissions_totales (schema_source, numreg, annee_ref, type_source_n1, unites)
WHERE schema_source = 'residentiel';
will also … As edze suggested, going to PostgreSQL 9.2 and including 'emi' in the index (as the last column) could also help. …
3
votes
Avoiding a sort on an already clustered index for group by
Once it has all the data, it is much easier to sort them directly than to go to an index and match the rows and return them in order. … If you were on PostgreSQL 9.2 (or above) and you had an index on (pid, did) then the optimizer might have chosen an index scan instead. …
3
votes
Accepted
postgres composite index design
I would try making two composite partial indexes like
CREATE INDEX idx1 ON tw_schedules (scenario_id, type_well_id) WHERE type_well_id IS NOT NULL;
CREATE INDEX idx2 ON tw_schedules (scenario_id, tw_import_id …
4
votes
Was using `set datcollate='C'` a mistake?
I would expect that doing a
SET enable_indexscan TO off;
would help you finding the user by username, because it would do a sequential scan instead of an index scan, so not trying to use the unusable … index. …
3
votes
Accepted
Using a GIN index on an integer array to model sets of tags
While a GIN index can speed up searching inside an array quite significantly, you have to be aware that relational database engines are designed to do joins very efficiently. …
3
votes
How to make this query use my multicolumn index?
There are factors which point towards not using an index. … If you create the following index:
CREATE INDEX ON crm_customer ((lower(name::text) text_pattern_ops, rating, address_id); -- thanks, Erwin
there are chances it would be used. …
10
votes
2
answers
765
views
Huge mismatch between reported index size and number of buffers in execution plan
So let's see the index definition:
CREATE INDEX reservation_r_article_id_idx1
ON reservation USING btree (r_article_id)
WHERE (r_status <> ALL (ARRAY['FULFILLED', 'CLOSED', 'CANCELED']));
Sizes … The number of reservations that are not yet closed is about 170,000 (the exact number is reported in the index scan node above). …
7
votes
Optimize simple query using ORDER BY date and text
This index could look like
CREATE INDEX factura_venta_orden
ON factura_venta USING btree (fcv_fecha_comprobante, fcv_numero_comprobante, fcv_id);
But the biggest problem is that this still will be relatively … slow as 1 million rows of this index eat up 100 MB. …