博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
使用Postgresql基因查询优化
阅读量:2395 次
发布时间:2019-05-10

本文共 2513 字,大约阅读时间需要 8 分钟。

最近看到了一个关于Postgresql的基因查询优化方式,刚开始还不知道怎么用,后来才发现很简单,主要也是在配置文件postgresql.conf里进行配置,

关于基因查询优化的作用,简单地说就是处理关系查询的,也就是连接。
相关参数如图(基于8.4版本):
参数说明(基于9.1版本):

geqo (
boolean)

Enables or disables genetic query optimization. This is on by default. It is usually best not to turn it off in production; thegeqo_threshold variable provides more granular control of GEQO.

geqo_threshold (
integer)

Use genetic query optimization to plan queries with at least this many FROM items involved. (Note that a FULL OUTER JOIN construct counts as only oneFROM item.) The default is 12. For simpler queries it is usually best to use the deterministic, exhaustive planner, but for queries with many tables the deterministic planner takes too long, often longer than the penalty of executing a suboptimal plan.

geqo_effort (
integer)

Controls the trade-off between planning time and query plan quality in GEQO. This variable must be an integer in the range from 1 to 10. The default value is five. Larger values increase the time spent doing query planning, but also increase the likelihood that an efficient query plan will be chosen.

geqo_effort doesn't actually do anything directly; it is only used to compute the default values for the other variables that influence GEQO behavior (described below). If you prefer, you can set the other parameters by hand instead.

geqo_pool_size (
integer)

Controls the pool size used by GEQO, that is the number of individuals in the genetic population. It must be at least two, and useful values are typically 100 to 1000. If it is set to zero (the default setting) then a suitable value is chosen based ongeqo_effort and the number of tables in the query.

geqo_generations (
integer)

Controls the number of generations used by GEQO, that is the number of iterations of the algorithm. It must be at least one, and useful values are in the same range as the pool size. If it is set to zero (the default setting) then a suitable value is chosen based on geqo_pool_size.

geqo_selection_bias (
floating point)

Controls the selection bias used by GEQO. The selection bias is the selective pressure within the population. Values can be from 1.50 to 2.00; the latter is the default.

geqo_seed (
floating point)

Controls the initial value of the random number generator used by GEQO to select random paths through the join order search space. The value can range from zero (the default) to one. Varying the value changes the set of join paths explored, and may result in a better or worse best path being found.

转载地址:http://tpzob.baihongyu.com/

你可能感兴趣的文章
Virtual的一些总结
查看>>
Fedora13上折腾了下ACE
查看>>
tomcat keepAliveTimeout=0问题
查看>>
JDK1.6在SUSE11下问题跳变定时任务失效问题记录
查看>>
400 Bad request 一例
查看>>
linux文件锁定
查看>>
fedora4上安装gcc2.9,编译安装rainbow过程
查看>>
求质数算法的N种境界 (N > 10)
查看>>
一个简单的linux下原生socket的tcp程序及其修改
查看>>
JSP的入门简介
查看>>
JSP中的基本语法和3指令,6动作,9内置对象
查看>>
JSP的6个动作
查看>>
JAVA中的数据类型和方法重载
查看>>
常见面试题——斐波纳挈数列
查看>>
我的第一篇hibernate框架博客
查看>>
java中File类
查看>>
java中File类创建和删除功能
查看>>
java中File类的判断功能
查看>>
java中File类的获取功能和修改名字功能
查看>>
java中File类的其它获取功能
查看>>