Hot answers tagged mysql-5.5
PROBLEM #1 Your major problem is having at least 10000 tables Here is the issue I see RDS Instance was All InnoDB How many file handles are open if you have 10000 InnoDB tables ? One file handle for the .frm file One file handle for the .ibd file This would be a maximum of 20000 open file handles RDS Instance was All MyISAM How many file handles ...
Remove this clause: --database=securities
select * from Table1 t where not exists( select 1 from Table1 p where p.FD = t.FD and p.FA != t.FA and p.FA = 1 ); Or as a LEFT JOIN (might be better optimized on 5.5) select t.* from Table1 t left join Table1 p on p.FD = t.FD and p.FA != t.FA and p.FA = 1 where p.`Key` is null; http://sqlfiddle.com/#!9/39664/4
What database? Does your database support row_number(). And you changed the query. In the first max(scanTime), max(scanId) are not necessarily on the same row. Those are two independent max. The scanTime of the row with the max(scanID) is different and what you got with the second. It is faster as scanID is indexed (PK) and scanTime is not. Since ...
Only top voted, non community-wiki answers of a minimum length are eligible