Giter Site home page Giter Site logo

Comments (7)

yoshinorim avatar yoshinorim commented on June 26, 2024

@spetrunia In the above example, do you know if there is any way to know the length of equal conditions at ha_rocksdb::index_read_map()? ("id1=1 AND id2=1 AND id3>=2" => equal cond length is 4 + 8 + 4=16 (index_id + 8 byte id1 + 4 byte id2), and "id1=1 AND id2>=1 AND id3>=2" => equal cond length is 4+8=12)

from mysql-5.6.

spetrunia avatar spetrunia commented on June 26, 2024

One can't see the end of the range inside ha_rocksdb::index_read_map() call.

We need to overload handler::read_range_first(). It sees both ends of the range, so we can compare both endpoints and find the length of the common prefix.

from mysql-5.6.

yoshinorim avatar yoshinorim commented on June 26, 2024

Thanks @spetrunia! I'm going to fix it.

from mysql-5.6.

rven1 avatar rven1 commented on June 26, 2024

One point to note is that if the range spans more than one prefix for rocksdb, you cannot use the bloom filter.

On Sep 11, 2015, at 2:49 PM, Sergei Petrunia <[email protected]mailto:[email protected]> wrote:

One can't see the end of the range inside ha_rocksdb::index_read_map() call.

We need to overload handler::read_range_first(). It sees both ends of the range, so we can compare both endpoints and find the length of the common prefix.


Reply to this email directly or view it on GitHubhttps://github.com//issues/109#issuecomment-139669070.

from mysql-5.6.

yoshinorim avatar yoshinorim commented on June 26, 2024

Handling IN clause is also interesting.

example: select * from r1 where id1=1 and id2 in (1,2,3);

read_range_first() is called three times, and both start_key and end_key matched on both id1 and id2. can_use_bloom_filter() is called only once at ha_rocksdb::setup_index_scan(), because Iterator is reused in this statement. MyRocks needs either of the following I think.

  1. Do not include id2 for bloom filter. Only (index_id + id1=1) should be used. The problem is this is less efficient, and I'm not sure how to get that from read_range_first().
  2. Decide if bloom filter can be used or not per each setup_index_scan().

from mysql-5.6.

yoshinorim avatar yoshinorim commented on June 26, 2024

https://reviews.facebook.net/D46851

@spetrunia Could you please review this diff? This diff calls kd->pack_index_tuple() twice (for end key and start key), and I'm still not 100% confident that it is safe.

    end_key_packed_size= kd->pack_index_tuple(table, pack_buffer,
                                              end_key_packed_tuple, end_key->key,
                                              end_key->keypart_map);

    packed_size= kd->pack_index_tuple(table, pack_buffer,
                                      sec_key_packed_tuple, key,
                                      keypart_map);

from mysql-5.6.

spetrunia avatar spetrunia commented on June 26, 2024

@yoshinorim, reviewed, ok to push. pack_index_tuple modifies table->record[0](where the record is returned), but this should be ok because the column values will be decoded back from the storage format when the record is read.

from mysql-5.6.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.