Rule Based Optimizer 基于规则的SQL优化器

Submitted by Lizhe on Mon, 03/27/2017 - 09:56

 

待执行的SQL语句进入数据库系统后都会进入查询优化器进行查询转换.

在Oracle 10g之前, Oracle会默认使用RBO规则

数据库会将查询条件分成15个等级, 通过判断条件(动作)的级别高低来决定那个谓词被优先执行

例如 基于rowid的查询级别是最高的为1, 全表扫描的执行级别最低为15

基于RBO优化器的一个明显缺点在于, 依靠硬编码来确定的规则很难被动态改变, 编写SQL语句的时候需要十分注意

这里如果你跟我一样使用的是10g之后的版本,我们需要使用下面的命令将优化器暂时改成RBO ( 只对当前session有效,不用再改回来)

alter session set optimizer_mode='RULE';

然后我执行一个执行计划

 

EXPLAIN PLAN FOR select * from INO_OUTAGES.OUTAGE where SUBCATEGORY='NBN Outage';
SELECT plan_table_output FROM TABLE(DBMS_XPLAN.DISPLAY('PLAN_TABLE'));

 

Java Rest

Submitted by Lizhe on Mon, 09/12/2016 - 11:06

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.Authenticator;
import java.net.InetAddress;
import java.net.PasswordAuthentication;
import java.net.URL;

public class Test {
  public static void main(String[] argv) throws Exception {
    Authenticator.setDefault(new MyAuthenticator());
    URL url = new URL("http://hostname:80/index.html");

selenium driver

Submitted by Lizhe on Thu, 05/26/2016 - 08:35

    public static WebDriver createChromeDriver(){    
        System.setProperty("webdriver.chrome.driver", "C:/PSP/selenium/chromedriver.data");
        WebDriver driver = new ChromeDriver();
        return driver;
    }

    public static WebDriver createFireFoxDriver() {
        System.setProperty("webdriver.firefox.bin", "C:/Program Files (x86)/Mozilla Firefox/firefox.exe");
        WebDriver driver;
        driver = new FirefoxDriver();
        return driver;
    }

jmx

Submitted by Lizhe on Thu, 05/19/2016 - 07:31

JAVA_OPTS="$JAVA_OPTS "-Dcom.sun.management.jmxremote=true" "-Dcom.sun.management.jmxremote.port=7091" "-Dcom.sun.management.jmxremote.authenticate=false" "-Dcom.sun.management.jmxremote.ssl=false" "-Djava.rmi.server.hostname=169.193.148.71

 

-Djava.rmi.server.hostname=10.10.8.57 -Dcom.sun.management.jmxremote  -Dcom.sun.management.jmxremote.port=8011 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false

Docker network

Submitted by Lizhe on Wed, 05/18/2016 - 07:09

$ docker run -i -t --rm --net=none base /bin/bash

root@63f36fc01b5f:/#

 

# At another shell, learn the container process ID

# and create its namespace entry in /var/run/netns/

# for the "ip netns" command we will be using below

 

$ docker inspect -f '{{.State.Pid}}' 63f36fc01b5f

2778

$ pid=2778

$ sudo mkdir -p /var/run/netns

$ sudo ln -s /proc/$pid/ns/net /var/run/netns/$pid

 

# Check the bridge's IP address and netmask

 

$ ip addr show docker0

21: docker0: ...

tomcat config

Submitted by Lizhe on Tue, 03/29/2016 - 15:01

DataPicker/WEB-INF/classes

<Context path="" reloadable="true" docBase="E:\Study\EclipseWorkSpace\DataPicker" workDir="E:\Study\EclipseWorkSpace\DataPicker\work">

</Context>
 

E:\apache-tomcat-7.0.67\conf\Catalina\localhost\ROOT.xml