Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/62.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 如何为表建模以查询大量依赖数据_Mysql_Mongodb_Database Design_Database_Nosql - Fatal编程技术网

Mysql 如何为表建模以查询大量依赖数据

Mysql 如何为表建模以查询大量依赖数据,mysql,mongodb,database-design,database,nosql,Mysql,Mongodb,Database Design,Database,Nosql,我有许多以下格式的日志记录 a_id, b_id, c_id, count, x_id, y_id, z_id 对象关系如下所示 a has_many b b has_many c c has_many y y has_many z 我希望运行以下查询,什么样的数据库(关系型或其他)结构能够对大量数据建模/运行这些查询 find count for a certain a_id find count for a certain a_id and set of associated b_id(

我有许多以下格式的日志记录

a_id, b_id, c_id, count, x_id, y_id, z_id
对象关系如下所示

a has_many b
b has_many c
c has_many y
y has_many z
我希望运行以下查询,什么样的数据库(关系型或其他)结构能够对大量数据建模/运行这些查询

find count for a certain a_id
find count for a certain a_id and set of associated b_id(s)
find count for a set of a_id(s) and set of associated b_id(s)
find count for a certain a_id, b_id and set of associated c_id(s)
find count for a certain a_id, set of b_id(s) and set of associated c_id(s)

find count for a certain x_id
find count for a certain x_id and set of associated y_id(s)
...

我认为任何传统的数据库软件都足够了……你是在要求一个特定的设计实现吗?我应该如何设计,它应该在一个关系表中(它将有数百万行)如果计数是唯一的操作,如果上面的关系将成为主要关系,那么MySQL对于这样一个数据库来说应该是简单而高效的。然而,如果数据量很大并且需要大量连接,那么NoSQL将非常有用。但最好的办法是,两种方法都试一下,然后确定哪一种效果最好。这些技术中的每一项都是专门为处理不同类型的真实场景而构建的。所以两者都试试。祝你一切顺利。