Code Monkey home page Code Monkey logo

Comments (4)

efwevg avatar efwevg commented on June 12, 2024

image
但是将redis去除之后反而快很多
image

from apijson.

TommyLemon avatar TommyLemon commented on June 12, 2024

APIJSON 性能是有测试过的,包括在腾讯的项目中实际表现也很好:
https://github.com/Tencent/APIJSON/releases/tag/5.1.5

Redis 如果没部署(连接耗时,超时才有结果),或者不在本机部署(网络耗时),光连 Redis 查询就会很耗时。

你现在这种写法
1.首先引用赋值(外键关联)写法就错了
"id>": "/Srctions/router_id"
对应
WHERE id > '/Srctions/router_id'
结果可能是扫全表然后查不到值

应该改成
"id@": "/Srctions/router_id"

可以加 @Explain: true 或者在控制台日志查看生成和执行的 SQL。

建议多看看 通用文档测试用例

2.其次如果写对了,那也是 N+1 次查询,大数据量下性能确实差,需要改成 JOIN,可以试试 APP JOIN 和 LEFT/INNER JOIN
#374

3.最后 Log.DEBUG = true(默认 false) 时,打印日志对性能会有明显影响,可以关掉后再测试

from apijson.

efwevg avatar efwevg commented on June 12, 2024

1.如果写法改为"id@": "/Srctions/router_id" sql会执行多次,会和数据量无限叠加,速度更慢

from apijson.

TommyLemon avatar TommyLemon commented on June 12, 2024

用 JOIN

from apijson.

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.