New answers tagged index-tuning
First, if email_id and delivery_id together are a unique key, please add a primary -composite- key on both tables for (email_id, delivery_id) Second, the concat is not necessary and will prevent the previous key from being used. Try: SELECT ol.* FROM open_log ol JOIN sent_log sl ON (ol.email_id, ol.delivery_id) = (sl.email_id, sl.delivery_id)
As per followed practice you can rebuild index when fragmentation is >30 % and can reorganize when fragmentation is between 10 and 30 %. You should also include page_count value in your query. If page_count value( which is there in DMV sys.dm_db_index_physical_stats) is <1000 you don't need to rebuild or reorganize such indexes even though they show large ...
Use BST where returning ordered records by the indexed column(s) is a typical use case. Use HT otherwise.
Matching index After re-reading your question I realized you are not running Amazon Redshift, but Amazon RDS, which seems to be running unsullied Postgres, at least according to the documentation: Amazon RDS supports DB instances running several versions of PostgreSQL. Currently we support PostgreSQL versions 9.3.1, 9.3.2, and 9.3.3. This would mean ...
Top 50 recent answers are included