Postgresql – After Rackspace server creation, PostgreSQL query planner doesn’t work as expected

indexindex-tuningperformancepostgresql

We created an image of one of our database servers in Rackspace. Then, we created a new server using that image, expecting things to work. However, the index performance we have seen seems to be bad, and even the query plans, when comparing the explain analyze outputs from the first server to the second one, have been different. Basically, the second server – the one that was restored from a saved image – does not seem to rely on indexes as it should.

Is there something related to image restore that would cause this behavior? If so, what may need to be done to fix the issue? Should I look somewhere else?

Thanks very much! I can provide more information if needed, so let me know if that would be useful.

Best Answer

I work for Rackspace and would like to help. Can you please post some details on exactly how the image was created? Are these both listed in your control panel as "next-gen servers" or is one "first-gen"? Differences here may explain some of the performance discrepancies you're experiencing.

It would be extremely helpful if you could provide query plans from both servers (http://www.postgresql.org/docs/current/static/performance-tips.html#using-explain).

A tool like explain.depesz (http://explain.depesz.com/help) may also help you to identify whether the queries are performing the same way on both machines.  

Feel free to post your answers here for the community to help (if you are comfortable) - or drop me a line at shaggy@rackspace.com with details and I'll be happy to coordinate with your support team.