【问题标题】:Prevent aldeed/meteor-tabular from showing counts at the bottom of tables防止 aldeed/meteor-tabular 在表格底部显示计数
【发布时间】:2016-10-26 21:17:04
【问题描述】:

我遇到了运行缓慢的 Meteor 应用程序的问题。我已将其范围缩小到 mongo 性能,并且正在使用分析器查看慢查询。我有一堆超过 10 秒的查询。它们看起来都类似于下面的输出。

我相信这些查询来自meteor-tabular 中每个数据表底部的行数。该表可能有数万行,但每个页面应该只显示数十或数百行。我真的不需要count,如果它确实导致了这些性能问题,我很乐意杀死它。

我发现无法在流星数据表或数据表本身中禁用此页数。有什么办法吗?

{
  "op" : "command",
  "command" : {
    "count" : "myCollection",
    "query" : {
      "user_id" : "someId"
    },
    "fields" : null
  },
  "keyUpdates" : 0,
  "writeConflicts" : 0,
  "numYield" : 1180,
  "locks" : {
    "Global" : {
      "acquireCount" : {
        "r" : NumberLong(2362)
      }
    },
    "MMAPV1Journal" : {
      "acquireCount" : {
        "r" : NumberLong(2345)
      },
      "acquireWaitCount" : {
        "r" : NumberLong(3)
      },
      "timeAcquiringMicros" : {
        "r" : NumberLong(26215)
      }
    },
    "Database" : {
      "acquireCount" : {
        "r" : NumberLong(1181)
      }
    },
    "Collection" : {
      "acquireCount" : {
        "R" : NumberLong(1181)
      },
      "acquireWaitCount" : {
        "R" : NumberLong(1164)
      },
      "timeAcquiringMicros" : {
        "R" : NumberLong(12358760)
      }
    }
  },
  "responseLength" : 44,
  "millis" : 33332,
  "execStats" : {

  },
  "client" : "XX.XXX.XX.XXX"
}

【问题讨论】:

  • 不确定您是否走在正确的轨道上。您可以分叉 package 并删除计算以查看是否有帮助。服务器上只有一个.count(),客户端上只有一个。 github.com/aldeed/meteor-tabular/…
  • 你可以用jquery隐藏$('#example').dataTable({ "bInfo" : false });
  • @MichelFloyd 我会试试的
  • @Gandalf 没用,计算仍会执行。
  • @maxko87 我也遇到了这个问题,男孩是不是让事情陷入困境。我不得不从galaxy转移到heroku再到aws,但我最终从数据表转移到反应表,并且我的应用程序的速度得到了提高。

标签: mongodb meteor datatables


【解决方案1】:

如果有人遇到这个问题,我会在我的 fork 中修复它:

https://github.com/maxko87/meteor-tabular

我还向 aldeed/meteor-tabular 提交了一个拉取请求,我们将看看它是否被拉入。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-03-08
    • 1970-01-01
    • 2020-05-24
    • 1970-01-01
    • 2020-12-11
    • 2016-11-12
    • 2016-12-20
    相关资源
    最近更新 更多