Android Question MySQL slow download queries

bashka_abdyli

Member
Licensed User
Longtime User
Hi there,

I am using PHP Script and ExecuteRemoteQueryMySQL to download some date from remote MySQL DB. This is working slow because there is big data and we have here EDGE connections (which is slow).

Can someone show me how to implement compressing on server side/ uncompressing in android client?

I am open to provide any information you need.

Thanks in advance.
 

eps

Expert
Licensed User
Longtime User
Okay, first of all, how much data are you requesting, is there the possibility to lessen the number of rows or the amount of columns returned?

As for compression, I'm not too sure about that, but it could be done, but you'd have to compress whatever you've got on the Server..
 
Upvote 0

bashka_abdyli

Member
Licensed User
Longtime User
Well I am limiting the rows as much as I can, but with EDGE still slow. I really need a compressing solution. Trying to figure this out since three days :-(
 
Upvote 0

bashka_abdyli

Member
Licensed User
Longtime User
What I learned from my experience is that while we are working with mobile devices every byte counts.
We should try to reduce the amount of data to minimum. One of best practice that I found out is to shorten the names of columns.

So instead of having queries like:

Select ProductCode, ProductName, ProductPrice from Products

it is much better to use in this way

Select ProductCode as [C], ProductName as [N], ProductPrice as [P] from Products

This in my scenario took the download time from MySQL to device for almost half of the time. This because JSON repeats the header row for every row.
So insted of ProductCode name now I use C (like code). This for a single row saves me 10 bytes, for 2000 rows saves me 20,000 bytes.

Works amazing now.
 
Last edited:
Upvote 0
Top