Other The great commission system on the Korean official server

smoochy boys on tour

czm6553930

Dedicated Member
Dedicated Member
Nov 17, 2012
23
2
35
Km2 Consignment.png

I have been playing the official korean server for a while and I am always amazed by its commission system since the system can handle thousands of pages of items with no pressure. 2058 pages with 10 items per page result in 20580 lines in SQL database (I assume they are still using SQL). It could take minutes for some M2engines to fetch 20580 lines of data and the cpu usage could go very high at the same time. Marvelous....
 

forspinki

Legend
Legendary
Oct 23, 2006
3,352
80
195
Handan, China
I bet they have optimized the backend quite a bit to support the number of users that are playing. I have tried to download the client a few times to start playing but even with a korean VPN the download just gets stuck at like 20%.
 
Last edited:

Far

tsniffer
Staff member
Developer
May 19, 2003
20,172
30
2,767
540
It won't be returning all 20k rows to the client

It'll return the ones being displayed and a counter of the total, like every system would.

If your software is returning every record to every client at once then you've written it wrong.

You could have a billion records all paged and it wouldn't make any difference.

Sent from my SM-G930F using Tapatalk
 
  • Like
Reactions: Chriz and OxxpqxxO

Chriz

Captain Lurker
VIP
Mar 24, 2003
1,158
277
335
LOMCN
Far's right, with paging and efficient code, your only going to be fetching 10 records per page and sending that to the client. No real magic involved :D

Our commsion has more items than official O_O

comm.gif
 

czm6553930

Dedicated Member
Dedicated Member
Nov 17, 2012
23
2
35
It won't be returning all 20k rows to the client

It'll return the ones being displayed and a counter of the total, like every system would.

If your software is returning every record to every client at once then you've written it wrong.

You could have a billion records all paged and it wouldn't make any difference.

Sent from my SM-G930F using Tapatalk
That makes sense to me. But i believe the system would still be slowed if there are too many records since the system needs to get the total number of records each time when players click 'previous', 'next' or 'refresh' buttons. Maybe i am mistaken, please advise. Also, i would like to know if there is a way to access the database of the consignment system on your newly released crystal program.
 

Far

tsniffer
Staff member
Developer
May 19, 2003
20,172
30
2,767
540
Sql is very clever. It doesn't blink when needing to get something like a total count of records.

It'll likely all be cached too so will just get it from memory until its told the page count changes (probably will do this when the window is opened. It definitely won't get the page count every time the page is changed)
 
Last edited:

Alecs

SPQR
VIP
Jan 10, 2009
3,309
3
1,191
380
Europa
That makes sense to me. But i believe the system would still be slowed if there are too many records since the system needs to get the total number of records each time when players click 'previous', 'next' or 'refresh' buttons. Maybe i am mistaken, please advise. Also, i would like to know if there is a way to access the database of the consignment system on your newly released crystal program.

This forum performs probably more counts than the commission system. It takes literally a thousandth of a second. 2000 pages or 20000 items is nothing. You should start worrying after about a little delay after millions of rows.
 

czm6553930

Dedicated Member
Dedicated Member
Nov 17, 2012
23
2
35
I have checked a couple of old Delphi codes such as outtest, hero, assassin, etc. ; The official code (outtest) is out of date, it loads all the data eachtime when there is a change in amount of items, it is OK when the database size is small. The rest codes utilize a similar approach; they load all the data each time regardless of any changes in database but only send 10 records to client, making them more efficient than outtest code apparently. Both approaches cause a large amount of CPU usage when the database is large. I plan to transfer the auction part of your code into Delphi. Not sure how difficult it will be or it is just not possible...

Sent from my Pixel 2 using Tapatalk