waterye

#

Partitioned Tables

Partitioned Tables

--  Range Partitioning Example
CREATE   TABLE  sales_range 
(salesman_id  
NUMBER ( 5 ), 
salesman_name 
VARCHAR2 ( 30 ), 
sales_amount  
NUMBER ( 10 ), 
sales_date    DATE)
PARTITION 
BY  RANGE(sales_date) 
(
PARTITION sales_jan2006 
VALUES  LESS THAN(TO_DATE( ' 02/01/2006 ' , ' MM/DD/YYYY ' )),
PARTITION sales_feb2006 
VALUES  LESS THAN(TO_DATE( ' 03/01/2006 ' , ' MM/DD/YYYY ' )),
PARTITION sales_mar2006 
VALUES  LESS THAN(TO_DATE( ' 04/01/2006 ' , ' MM/DD/YYYY ' )),
PARTITION sales_apr2006 
VALUES  LESS THAN(TO_DATE( ' 05/01/2006 ' , ' MM/DD/YYYY ' )),
PARTITION sales_may2006 
VALUES  LESS THAN(TO_DATE( ' 06/01/2006 ' , ' MM/DD/YYYY ' ))
);


insert   into  sales_range  values ( 12345 ' test ' 1000 , to_date( ' 2006-01-15 ' ' yyyy-mm-dd ' ));
insert   into  sales_range  values ( 12345 ' test ' 1000 , to_date( ' 2006-02-15 ' ' yyyy-mm-dd ' ));
insert   into  sales_range  values ( 12345 ' test ' 1000 , to_date( ' 2006-03-15 ' ' yyyy-mm-dd ' ));
insert   into  sales_range  values ( 12345 ' test ' 1000 , to_date( ' 2006-04-15 ' ' yyyy-mm-dd ' ));
insert   into  sales_range  values ( 12345 ' test ' 1000 , to_date( ' 2006-05-15 ' ' yyyy-mm-dd ' ));

create   index  idx_sales_range_sales_date  on  sales_range (sales_date);

ALTER   TABLE  sales_range  DROP  PARTITION sales_jan2006  UPDATE  GLOBAL INDEXES;

When to Partition a Table
Here are some suggestions for when to partition a table:

  • Tables greater than 2GB should always be considered for partitioning.
  • Tables containing historical data, in which new data is added into the newest partition. A typical example is a historical table where only the current month's data is updatable and the other 11 months are read-only.

参考:  ora92_doc/server.920/a96524/c12parti.htm

详细请参考oracle文档

posted @ 2006-05-12 16:37 waterye 阅读(1076) | 评论 (1)编辑 收藏

yahoo email, 3.5g

yahoo的邮箱容量已经增加至3.5G, 好大啊. 不过还是喜欢gmail.

posted @ 2006-05-10 22:43 waterye 阅读(680) | 评论 (0)编辑 收藏

Tobago, 看上去不错

The goal of Tobago is to provide the community with a well designed set of user interface components based on JSF and run on MyFaces.

Introduction

Demo

posted @ 2006-05-02 08:54 waterye 阅读(1102) | 评论 (1)编辑 收藏

ec的oracle分页

http://extremecomponents.org/wiki/index.php/Simplified_Chinese_Tutorials_Limit

上面的版本是mysql

oracle的分页实现, 在传参数时增加limit.getRowStart()即可

public String limitQuery(int rowStart, int rowEnd, String query) {
        String querySql 
= "select * from ( " +
                
"    select my_table.*, rownum  my_rownum from ( " +
                query 
+
                
"    ) my_table where rownum <= " + rowEnd +
                
") where my_rownum > " + rowStart;
        
return querySql;
}

posted @ 2006-04-30 15:30 waterye 阅读(1251) | 评论 (1)编辑 收藏

FlyakiteOSX, 让xp变成mac

Intel Mac能够运行OS X和XP,还是有诱惑力的,但两万块左右MacBook Pro对于普通老百姓来说太贵了.

FlyakiteOSX, 让我的xp变成mac os x, 爽

mac

desktop

posted @ 2006-04-22 23:47 waterye 阅读(1332) | 评论 (0)编辑 收藏

idea create war file

用idea创建war文件时(J2EE Build Settings|Create web module war file),老是将所有jar复制到WEB-INF/lib下,一直羡慕JBuilder的exclude, include功能。

原来idea也有这个功能,在Web Module Settings |  Modules and Libraries to Package下,选择Do not package即可。

posted @ 2006-04-18 22:11 waterye 阅读(1548) | 评论 (0)编辑 收藏

Struts Plugin: Struts Assistant

IDEA Struts Plugin: Struts Assistant

1. 安装: 在idea plugins下载并安装
2. 配置: 指定struts解压包的路径

posted @ 2006-04-15 15:21 waterye 阅读(1230) | 评论 (0)编辑 收藏

hibernate的column级lazy

1. Using lazy property fetching
To enable lazy property loading, set the lazy attribute on your particular property mappings:
<class name="Document">
       
<id name="id">
        
<generator class="native"/>
    
</id>
    
<property name="name" not-null="true" length="50"/>
    
<property name="summary" not-null="true" length="200" lazy="true"/>
    
<property name="text" not-null="true" length="2000" lazy="true"/>
</class>

Lazy property loading requires buildtime bytecode instrumentation! If your persistent classes are not enhanced, Hibernate will silently ignore lazy property settings and fall back to immediate fetching.

For bytecode instrumentation, use the following Ant task:
<target name="instrument" depends="compile">
    
<taskdef name="instrument" classname="org.hibernate.tool.instrument.InstrumentTask">
        
<classpath path="${jar.path}"/>
        
<classpath path="${classes.dir}"/>
        
<classpath refid="lib.class.path"/>
    
</taskdef>

    
<instrument verbose="true">
        
<fileset dir="${testclasses.dir}/org/hibernate/auction/model">
            
<include name="*.class"/>
        
</fileset>
    
</instrument>
</target>

Please note that this is mostly a marketing feature, as in practice, optimizing row reads is much more important than optimization of column reads.

debug麻烦, 并没有测试

2. use hql

// use vo
String hql = "select new Foo(f.id, f.name) from Foo f";

// use map 
String hql = "select new map(f.id, f.name) from Foo f";

// use Object[]
String hql = "select f.id, f.name from Foo f";

// use list
String "select new list(f.id, f.name) from Foo f";
不支持嵌套的对象, 不爽, 如
String hql = "select new Foo(f.id, new Bar(f.bar.id, f.bar.name)) from Foo f";


以上两种方法在实际应用中都不是很理想, 但那种from Pojo的方式太浪费内存, 遇到blob字段更可怕, 有其他更好方法的请告知

posted @ 2006-04-10 20:28 waterye 阅读(2006) | 评论 (1)编辑 收藏

刚换了电脑, 人脑又出问题了, 麻烦

前几个星期刚换电脑的主机, 但这几天人脑又出问题(偏头痛).

电脑坏了可以再买, 人脑坏了, 麻烦.

posted @ 2006-03-30 19:57 waterye 阅读(698) | 评论 (2)编辑 收藏

Grails 0.1 released

Grails终于发布0.1版

http://docs.codehaus.org/display/GRAILS/2006/03/29/Groovy+on+Rails+%28Grails%29+0.1+Released

posted @ 2006-03-30 09:10 waterye 阅读(706) | 评论 (2)编辑 收藏

仅列出标题
共18页: First 上一页 3 4 5 6 7 8 9 10 11 下一页 Last