View Full Version : Desktop app deployment on lan
abdulmojeb
2015-12-03, 01:31
hi lianja experts,
Is there any other way of deploying desktop app on LAN aside from the method discribed in lianja wiki (http://www.lianja.com/doc/index.php/Deploying_to_LAN_-_Desktop_and_Web_Clients) ?
The client PC connection to the database (DBF) is very slow. Lianja app center doesn't even responds sometime.
thanks.
barrymavin
2015-12-03, 01:43
The last time you asked about this I told you your LAN looked slow. Have you determined why even a file copy is slow yet?
There are some attributes you can set to disable the slider in the navigation bar. I'm not on my computer at the moment but I believe it's in the app settings.
When you say the app center becomes unresponsive can you better describe what you are doing when that occurs and how much data you have.
Also, learn to use the app inspector in runtime app view it logs a lot of useful info in the events tab.
abdulmojeb
2015-12-03, 02:33
hi barry,
Yes I followed your instructions last time and if it's really a network problem then why it's only slow the first time you search for a record in database. For second time and so on it's quite fast.
The app center unresponsive when I update and delete record. Note that I used SQL command to do that.
OK. I really have to learn to use the inspector. thanks
barrymavin
2015-12-03, 03:01
If you are using SQL to perform UPDATE and DELETE operations you need to make sure that the WHERE condition can be optimized and is not doing a sequential scan of the table.
Learn how to use the EXPLAIN command with SELECT and you can see if the optimizer can use any indexes. If it can't then you need to create indexes on the primary key column at least.
If you know the record number the optimizer will perform a singleton update/delete operation when referenced using the rowid system column.
It sounds like you are doing a sequential scan with no index optimization taking place.
EXPLAIN is your friend, get to know how to use it.
abdulmojeb
2015-12-06, 20:08
Hi sir barry,
My tables where already indexed and upon using the EXPLAIN command my query is optimized. But despite of that my problem is not solved yet.
Nothing is improved. So the only thing we've not yet tried is to change/upgrade the switch.
There current switch speed is 10/100Mbps.
How many records do you read?
If you read many records, with a 10 Mb/s lan, it is slow any system ..
Try to write a query to read only a few records (50 or 100).
Ciao
abdulmojeb
2015-12-09, 01:06
hi,
We've already upgraded the network switch to a gigabit switch and upon using the LAN_Speedtest we have 211Mbps writing data and 710Mbps reading data from the server PC to the client PC. I think that's fast enough right?
In regards to the system, updating of records took 4min to update a record. Note that table already indexed and where condition is optimized.
Any idea why updating of record is very slow?
thanks.
barrymavin
2015-12-09, 01:17
Copy your database onto your local drive and perform the update then compare the times.
If you have an active subscription and you are a licensed developer then zip up the app and its database, then attach it to a ticket with steps to reproduce this behavior and we will investigate this and advise what you need to do.
abdulmojeb
2015-12-09, 01:28
If the database is on the local drive the system responds so fast. It's just a matter of milliseconds upon updating a record.
I just have a question on indexing. I had created the index through this code
create index policy in artrans (atco,attype,alltrim(atno),atcd)
Upon running this code
explain select * from artrans where atco='PF' and attype='CV' and alltrim(atno)='134066' and atcd='S'
and I have this output
Optimized WHERE condition for table 'artrans' using index tag 'POLICY'
Table 'artrans' has 145149 records
SEEK 'PFCV'
SCAN WHILE ATCO+ATTYPE = 'PFCV'
Total I/O read operations was 19131
1 record selected in 72ms
Does it mean that not all fields were optimized but only the first 2 fields?
thanks barry
barrymavin
2015-12-09, 01:35
Remove the alltrim.
The SQL engine has SET STRCOMPARE ON by default so it works similar to MySQL and MSSQL and performs case insensitive string compares and will automatically pad out strings with spaces.
Try that and see what the EXPLAIN command tells you.
abdulmojeb
2015-12-09, 01:42
Copy that. Thanks a lot.
So I have to rebuild all my index files and try to run the system again.
barrymavin
2015-12-09, 01:51
That one index you created with alltrim is not being used to optimize the query properly because the keys are variable length. You don't need to use trim functions in Lianja like that.
If you look at the output from EXPLAIN you can see that the optimizer is using a partial key match to reduce the amount of sequential reads but it still has to scan down through the the records as the index is not being used properly to optimize the SELECT.
abdulmojeb
2015-12-09, 01:57
Please look at this code
select artrans
locate for atco='PF' and attype='CV' and atno='134066' and atcd='S'
if found()
endif
Does the query is still optimize as the SQL select statement do? How can I use EXPLAIN command in NoSQL command to test it myself?
barrymavin
2015-12-09, 01:59
No LOCATE will do a sequential scan.
You should use
SEEK key
SCAN REST WHILE ...
abdulmojeb
2015-12-09, 02:02
Really?
What about the replace and delete command?
Then that should be the reason why my app responds so slow. I'll have to decode my program and try to run it again. Thank you very much for your support to a beginner like me.
barrymavin
2015-12-09, 02:09
You have to SEEK and use the REST scope to manually optimize NoSQL-style of commands. SQL command optimization is handled by the SQL optimizer.
Performing sequential scans in a LAN is bad practice and is not recommended.