Select query on information_schema is too slow SELECT * 
FROM information_schema.TABLE_CONSTRAINTS 
WHERE CONSTRAINT_SCHEMA = DATABASE() 
  AND CONSTRAINT_NAME   = 'FK_FOLDER_FILTER_CONTRACT_CATEGORY_CONTRACT_CATEGORY' 
  AND CONSTRAINT_TYPE   = 'FOREIGN KEY';


The above query takes around 2 mins to execute 
is there any other alternate query or how can we optimize this query
information_schema isn't a real database. To preform this query it needs to open tables.

The internal code for information_schema isn't optimized and it will frequently generate the data for the entire table requested without consideration of the query. As such your query could be opening every table regardless of the current table.