Query on information-schema
-
Hi There,
Just to suggest a modification in the following query for better performance :
SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = ‘wp534_hsa_plugin’ AND column_name = ‘hsa_options’by adding table_schema= DATABASE() in the where clause :
The final version should be :
SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema=DATABASE() and table_name = ‘wp534_hsa_plugin’ AND column_name = ‘hsa_options’;
This is because, quering against information_schema when there are a lot of databases and tables could be a heavy operation when table_schema is missing.
Thanks
Stofa.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Query on information-schema’ is closed to new replies.