Hi,
we’re hosting our discourse-based forum on azure with a “Azure Database for PostgreSQL” instance. One of the advantages of this service are the performance recommendations based on “database characteristics” and usage.
Since migrating to azure we’ve received some hints about missing and presumably redundant indexes I like to share with you.
We’ve seen a slight (not much) overall performance increment after creating these missing indexes but couldn’t apply the DROP INDEX
- recommendations as it would/will potentially break upcoming updates/db-migrations. Anyway, we can’t tell if these indexes are save to be deleted or if it will have a negative effect on performance.
Here are the indexes azure suggested us to create (impact “low” and “moderate”):
create-indexes.csv (1.5 KB)
These are the recommendations for “already covered” indexes:
Summary
Drop index
index_optimized_images_on_upload_id
on tablepublic.optimized_images
.
Reason: Index is covered byindex_optimized_images_on_upload_id_and_width_and_height
Drop index
index_post_revisions_on_post_id
on tablepublic.post_revisions
.
Reason: Index is covered byindex_post_revisions_on_post_id_and_number
.
Drop index
post_timings_summary
on tablepublic.post_timings
.
Reason: Index is covered bypost_timings_unique
.
Drop index
index_topic_links_on_topic_id
on tablepublic.topic_links
.
Reason: Index is covered byunique_post_links
.
Drop index
index_post_uploads_on_post_id
on tablepublic.post_uploads
.
Reason: Index is covered byidx_unique_post_uploads
.
You should take these “DROP” recommendations with a grain of salt as I think it will only affect the overall DB size instead of increasing performance. For example: Our whole DB uses ~120GB and all of these recommendations will free 422MB. Azure itself defines the impact as “low”. So it seems it’s nothing more than a cleanup.
As said above I just wanted to share this with you as it may help to tune the performance a little bit. Besides these indexes there where no other recommendations azure provided for the time we’re using their services.
Kind Regards
Sascha