2

I have a table with two binary columns used to store strings that are 64 bytes long maximum and two integer columns. This table has 10+ million rows and uses 2GB of memory out 7GB available memory, so there is plenty of available memory left. I also configured MemSQL based on http://docs.memsql.com/latest/setup/best_practices/.

For simple select SQL where binary columns are compared to certain values, MemSQL is about 3 times faster than SQL Server, so we could rule out issues such as configuration or hardware with MemSQL.

For complex SQLs that use

  • substring operations in the Select clause and
  • substring and length operations in the where clause

MemSQL is about 10 times slower than SQL Server. The measured performance of these SQLs on MemSQL were taken after the first few runs to make sure that the SQL compilation durations were not included. It looks like MemSQL’s performance issue has to do with how it handles binary columns and substring and string length operations.

  1. Has anyone seen similar performance issues with MemSQL? If so, what were the column types and SQL operations?

  2. Has anyone seen similar performance issues with MemSQL for substring and length operations on varchar columns?

Thanks.

Michael,

4

2 回答 2

1

我的建议:回到行存储,但用VARBINARY代替BINARY,考虑在列上放置索引或创建持久列,并尝试用 重写你的谓词like
如果您粘贴示例查询,我可以帮助您转换它。

相关文档在这里 dev.mysql.com/doc/refman/5.0/en/pattern-matching.html docs.memsql.com/4.0/concepts/computed_columns

祝你好运。

于 2015-07-14T20:20:15.573 回答
0

很难对性能问题做出一般性的回答,但在您的情况下,我会尝试使用 MemSQL 列存储表,而不是内存中的行存储表。由于无论如何您都在进行全面扫描,因此您将受益于将列数据堆叠在一起。

http://docs.memsql.com/4.0/concepts/columnar/

于 2015-07-13T18:23:13.443 回答