查询优化技术?(关闭)Query optimization techniques? [closed]

- 此内容更新于:2014-12-30
主题:

如何优化查询已经写吗?

原文:

How to optimize queries which are already written?

ChrisF♦的回复:看到stackoverflow.com/questions/105400/…

(原文:See stackoverflow.com/questions/105400/…)

解决方案:
用解释来看到发生了什么,使用索引等等。
原文:

Use EXPLAIN to see what's going on - what indexes are being used and so on.

解决方案:
如果你不能改变他们。 索引和统计数据。 所以你不要优化查询但他们执行计划。
原文:

If you can not change the them: Indexes and statistics.
So you don't optimize the query but their execution plan.

解决方案:
如果你不能改变查询,这取决于可用的特性在你的数据库引擎的选择。Ovidiu说您可以使用索引和生成使用统计数据瓶颈在哪里。 否则你可以使用技术实现视图或水平分区。 在开始之前确保你知道你优化的目标是什么。
原文:

If you can't change the query then it really depends on what features are available on your database engine of choice. As Ovidiu said you can use indexes and generate usage statistics to see where the bottleneck is.

Otherwise you can employ techniques like materialised views or horizontal partitioning.

Before you start make sure you know what you're optimisation target is.

解决方案:
IBM Informix Dynamic Server支持功能,允许您添加优化器指令时预先存在的SQL执行(无需修改应用程序)。查找在Informix外部指令的网站的更多信息(或谷歌的网站:ibm.com Informix外部指令)。
原文:

IBM Informix Dynamic Server supports a feature that allows you to add optimizer directives to pre-existing SQL when it is executed (without modifying the application). Look up 'external directives' at the Informix web site for more information (or Google 'site:ibm.com informix external directives').