0

How to give optimizer hints on DDL query ?

I have a use case to set lock_wait_timeout in an alter query. I do prefer to give it for that statement alone. Is it possible to give optimizer hint in the same statement itself?

PS : I do not prefer setting lock_wait_timeout for that entire session.

  • I am not sure what you mean by _"for that entire session"_. Just set it before you run your alter query and then revert it afterwards. – user1191247 Feb 16 '23 at 09:29
  • Which DDL query? – Rick James Feb 17 '23 at 02:51
  • I need to do it for Alter Query (add column/ delete column/ modify column). @RickJames. – INDIAN DECODER Feb 17 '23 at 06:17
  • @nnichols I am looking for a way to set in the statement itself, instead of running before and after the alter query. – INDIAN DECODER Feb 17 '23 at 06:18
  • AFAIK there is no way to do it within your ALTER statement. Why would you want to? – user1191247 Feb 17 '23 at 10:38
  • What version of MySQL? There have been significant changes in recent versions. Some of the changes depend on the specifics of the column changes; so we need more details. If necessary, obfuscate the names and leave out other columns. But do not leave out datatypes, nor the Primary key nor other indexes. – Rick James Feb 17 '23 at 19:02

0 Answers0