Monday, December 7, 2015

[google-cloud-sql-discuss] Foreign Key Indexes not getting used during query execution

I have a situation where i built some foreign keys in my tables, and executed an explain plan on some of my "uglier" queries. By ugly, I mean they have nested sub queries, and we are starting to normalize our database.


When I run the queries on my local MySQL DB, the explain plan shows a nice performance increase, as well as the correct FK's getting used.


When I set the same thing up on the Google Cloud MySQL DB, the explain plan does not show the execution using any of the FK's?


Does anyone have any idea of why the MySQL instances would be acting differently like that? The DB is the same version, I ran the optimize command on the tables with no luck?

Thanks Dave

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/61d95407-0c68-46d0-ac4f-7caf6e8ee394%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment