Git Product home page Git Product logo

mp-dynamic-shardingsphere's Introduction

参考

https://blog.csdn.net/dls_123/article/details/114653348
https://shardingsphere.apache.org/document/legacy/3.x/document/cn/manual/sharding-jdbc/configuration/config-yaml/
https://mp.baomidou.com/guide/dynamic-datasource.html

hashCode()可能为负值

Math.abs(id.hashCode())

子查询不支持分表

示例:
SELECT t.* FROM user_log t WHERE t.user_id IN (SELECT u.id FROM user u WHERE u.age = #{age})

分库情况下, 关联表的分表键须一致

比如user拆分键为id
user_log.user_id表关联user.id
若user_log拆分键为id, 存在情况user存到ds1, 而user_log存到ds2; shardingsphere不会跨存关联查询, 比如不会关联查询ds1.user_1、ds2.user_log_1

algorithm-expression为groovy表达式

groovy的除法结果为浮点数
eg: 3 / 2 = 1.5

mp-dynamic-shardingsphere's People

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.