镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content
This repository was archived by the owner on Jul 11, 2021. It is now read-only.
This repository was archived by the owner on Jul 11, 2021. It is now read-only.

benchmarks #114

Open
Open

Description

@megauspexx
No description provided.

Activity

  1. megauspexx commented on Feb 18, 2021

    @megauspexx
    Author

    Hello, i was interested in this extension. I would like to use it to calculate rank like this

    select count(id) as count from data where (rating_sum > ? or (rating_sum = ? and p_id < ?) ) <more filters> .

    What do you think about performance redisql vs mysql for this query?

    Will redisql give more performance?
    I tried using demo.redisql.com but for now connection refused

  2. siscia commented on Feb 18, 2021

    @siscia
    Member

    Hi there,

    yeah unfortunately I had to switch off the demo machine.

    For your particular query, the engine doesn't really matter much.
    As long as you have the correct indexes in place.

    A composite index on rating_sum and p_id would already makes wonder for this particular query. Maybe it would be possible to find an even better index give the other filters.

    The advantage of RediSQL is that you run it in memory. And you don't hit the disk. Then if your disk is fast enough this is not going to be a big issue.

    Suggestion it is to try it and see if it goes fast enough for your use case.

    Note of allert, this project is being discontinued in favor of zeesql, which is the version 2 of RediSQL.

    More info on https://zeesql.com

    What you can try is to start zeesql with docker, populate it with some data and see the performance. Something like:

    $ docker run -d --name zeesql --rm redbeardlab/zeesql
    $ docker exec -it zeesql redis-cli
    > ZEESQL.CREATE_DB DB
    > ZEESQL.EXEC DB COMMAND "create table data(rating_sum INT, p_id INT);"
    > ZEESQL.EXEC DB COMMAND "INSERT INTO data VALUES (1,2),(2,3),(3,4);"
    > ZEESQL.EXEC DB COMMAND "select count(id) as count from data where (rating_sum > ? or (rating_sum = ? and p_id < ?) ) <more filters>"
    

    Of course, you will need more data to have reasonable numbers to compare!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions