Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MySQLi performance

Comments in 'Plugin Development' started by MyNameIsTriXz, Aug 30, 2016.

  1. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    Since databases are related to plugin development, I'd like to ask some questions?


    How long is the result of Player::getSkinData() (to save it in a DB)?

    When a row has 100 columns, will it take longer to fetch a single column compared to a 5 columns row?

    Should MySQLi only be queried in an AsyncTask?

    Is it good to store all the queried data of a user in an array? The user gets removed when he quits, which will make the array length less than the server maximum players, as example 40 players. I would upload the array data of a player when a player leaves. Would that method be good for performance?

    And last question:
    I plan to add auto login by clientId, I want to login the player by IP address too, but is this insecure when as example a friend is in the players WLAN? What are other ways to recognize a player?
  2. Muqsit
    Offline

    Muqsit Active Member

    Joined:
    Sep 9, 2015
    Posts:
    175
    Minecraft User:
    Muqsit
    If your MySQL server is running on the same system you are hosting your server on, the transfer rate is instant.
    MyNameIsTriXz likes this.
  3. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    Oh thats good! Thx
  4. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Always run queries that could slow down main thread with Async worker. See this repository for example https://github.com/LegionPE/LegionPE-Theta-Base
    MyNameIsTriXz and Muqsit like this.

Share This Page

Advertisement