MySQL Forums
Forum List  »  MyISAM

Re: Memory Problem with 1 DB. Other DB ok
Posted by: Rick James
Date: January 26, 2015 12:14PM

This is probably getting into the implementation of ODBC, about which I know nothing.

> select top 1 ID from MYSQL_WEB_PROD...wp_users order by id desc

That sound like MySQL's
SELECT ID FROM wp_users ORDER BY id DESC LIMIT 1;

If ODBC were smart enough to do the translation, then there should be no problem. Instead, I suspect they are doing the "top 1" in ODBC after fetching
SELECT ID FROM wp_users ORDER BY id DESC
That is, I suspect they are fetching the entire column, then doing "top 1".

This suspect this would get the same answer:
select max(ID) from MYSQL_WEB_PROD...wp_users
But that may not be your ultimate goal. If you want the row that that represents, then try
select * from MYSQL_WEB_PROD...wp_users where ID = ( select max(ID) from MYSQL_WEB_PROD...wp_users )

Beyond that, I can't think of any workarounds.

Suggest you look for an ODBC forum and present my hypothesis to them.

Options: ReplyQuote


Subject
Views
Written By
Posted
3420
January 22, 2015 11:15PM
Re: Memory Problem with 1 DB. Other DB ok
1789
January 26, 2015 12:14PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.