由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - mysql index优化求助
相关主题
[合集] 如何能让这个程序快一点呢?太慢了我这样把一个2D array 的每个column的数据导入到1D array的方法对不对?
MySQL COUNT() 问题.cassandra query speed求助
mysql 在两台电脑中倒数据? (转载)请问一个问题1
请问可以用多线程来同时写入数据到数据库中吗?mysql stream output问题求助
想自学JS based web development, 如何入手?帮忙看一段php代码
Cassandra 里的 partitionchange year format in Access by SQL query (转载)
有谁能讲讲Cassandra secondary index的?用node怎么把多个mysql query 的结果合起来
请帮我看看这个java method? 一直不正常运行Partitioning (转载)
相关话题的讨论汇总
话题: index话题: node2话题: node1话题: mysql话题: int
进入Programming版参与讨论
1 (共1页)
v****s
发帖数: 1112
1
目前的一个project需要在mysql里面查询 两个node之间的value,
table columns:
LOOKUPTABLE (INT id, VARCHAR node1, VARCHAR node2, INT value)
问题是这个table有 10 millions rows, 一次select query时间大概是0.8 sec:
select value from LOOKUPTABLE where node1 = 'a' and node2 = 'b';
尝试用index来优化query,但是不知道最优的index应该是哪种?谢谢!包子有赏!
g*****g
发帖数: 34805
2
just index node1 and node2 columns.

【在 v****s 的大作中提到】
: 目前的一个project需要在mysql里面查询 两个node之间的value,
: table columns:
: LOOKUPTABLE (INT id, VARCHAR node1, VARCHAR node2, INT value)
: 问题是这个table有 10 millions rows, 一次select query时间大概是0.8 sec:
: select value from LOOKUPTABLE where node1 = 'a' and node2 = 'b';
: 尝试用index来优化query,但是不知道最优的index应该是哪种?谢谢!包子有赏!

v****s
发帖数: 1112
3
i tried, but there is no significant improvement, still takes about 1 sec
per
query.
i used hashtable, maybe i should use btree?

【在 g*****g 的大作中提到】
: just index node1 and node2 columns.
g*****g
发帖数: 34805
4
If you simply have too many records in a table, you may want to do
partitioning, it can be transparent to application. I am not a DB expert,
you can ask database board.

【在 v****s 的大作中提到】
: i tried, but there is no significant improvement, still takes about 1 sec
: per
: query.
: i used hashtable, maybe i should use btree?

v****s
发帖数: 1112
5
thanks! dear bug bro!

【在 g*****g 的大作中提到】
: If you simply have too many records in a table, you may want to do
: partitioning, it can be transparent to application. I am not a DB expert,
: you can ask database board.

1 (共1页)
进入Programming版参与讨论
相关主题
Partitioning (转载)想自学JS based web development, 如何入手?
[合集] MS interview questionCassandra 里的 partition
我的DBA在生成ORACLE table的时候需要一个一个column看 (转载)有谁能讲讲Cassandra secondary index的?
Windows下大家都用什么SqlConsole啊?请帮我看看这个java method? 一直不正常运行
[合集] 如何能让这个程序快一点呢?太慢了我这样把一个2D array 的每个column的数据导入到1D array的方法对不对?
MySQL COUNT() 问题.cassandra query speed求助
mysql 在两台电脑中倒数据? (转载)请问一个问题1
请问可以用多线程来同时写入数据到数据库中吗?mysql stream output问题求助
相关话题的讨论汇总
话题: index话题: node2话题: node1话题: mysql话题: int