A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.
1

It is not surprising that temp tables would come into play. Why ??? According to the MySQL 5.5 Documentation on join_buffer_size (Italics mine): The minimum size of the buffer that is used for plain index scans, range index scans, and joins that do not use indexes and thus perform full table scans. Normally, the best way to get fast joins is to add ...


1

This below worked for me: SELECT count(*) INTO @exist FROM information_schema.columns WHERE table_schema = 'mydatabase' and COLUMN_NAME = 'mycolumn' AND table_name = 'mytable' LIMIT 1; set @query = IF(@exist <= 0, 'ALTER TABLE mydatabase.`mytable` ADD COLUMN `mycolumn` MEDIUMTEXT NULL', 'select \'Column Exists\' status');...


Only top voted, non community-wiki answers of a minimum length are eligible