redis怎么处理mysql的关联数据?
PHP中文网
PHP中文网 2017-04-17 13:11:39
0
2
666

mysql数据库中有A、B、C三张表,现在应用程序得到的数据是由这三张表关联查询后得到的结果集。
每个用户得到的关联查询结果是不一样的。
我想插入数据时就直接写入到redis,用户所有操作都在redis里面,定时把数据同步到mysql,但是redis不支持关联查询,redis如何返回mysql关联查询出的结果呢?

PHP中文网
PHP中文网

认证0级讲师

reply all(2)
Peter_Zhu

If the related query is very close, it may be wrong to choose redis. It is more suitable to choose a product that supports conditional query, such as MongoDB;

If it is not very close, query ABC separately to determine which table can get the smallest result set through the conditional filtering after where; then use this minimum result set to check the other two tables;

In addition, redis supports intersection, but the time complexity is relatively high, and it may not be faster than filtering it yourself;
http://redisdoc.com/set/sinter.html

左手右手慢动作

Can you use Map table storage?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template