Return-Path: <oracle-l-bounce@freelists.org>
Delivered-To: 2-oracle-l@orafaq.com
Received: (qmail 6401 invoked from network); 12 Dec 2007 08:44:19 -0600
Received: from freelists-180.iquest.net (HELO turing.freelists.org) (206.53.239.180)
  by static-ip-69-64-49-119.inaddr.intergenia.de with SMTP; 12 Dec 2007 08:44:19 -0600
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id A6F3A7D8436;
 Wed, 12 Dec 2007 09:44:19 -0500 (EST)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 01279-02; Wed, 12 Dec 2007 09:44:19 -0500 (EST)
Received: from turing (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 1907D7D83FF;
 Wed, 12 Dec 2007 09:44:19 -0500 (EST)
Received: with ECARTIS (v1.0.0; list oracle-l); Wed, 12 Dec 2007 08:56:53 -0500 (EST)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 6E3BB7D8046
 for <oracle-l@freelists.org>; Wed, 12 Dec 2007 08:56:53 -0500 (EST)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 23745-06 for <oracle-l@freelists.org>;
 Wed, 12 Dec 2007 08:56:53 -0500 (EST)
Received: from toc-mail.umb.com (toc-mail.umb.com [198.153.253.80])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 0E5867D6D2D
 for <oracle-l@freelists.org>; Wed, 12 Dec 2007 08:56:52 -0500 (EST)
X-WSS-ID: 0JSXW1D-02-I7D-01
Received: from x8114a.umb.com (unknown [192.168.145.4])
 by toc-mail.umb.com (Tumbleweed MailGate 3.5.0) with ESMTP id 241DB5B0387;
 Wed, 12 Dec 2007 07:56:00 -0600 (CST)
Received: from 172.19.48.183 by x8114a.umb.com with ESMTP (Tumbleweed
 Email Firewall SMTP Relay (Email Firewall v6.2.0)); Wed, 12 Dec 2007
 07:56:43 -0600
X-Server-Uuid: A6E1DA34-39DF-4ABE-A6EE-67E6B24F0DDF
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Subject: RE: partitioned tables
Date: Wed, 12 Dec 2007 07:56:43 -0600
Message-ID: <D40740337A3B524FA81DB598D2D7EBB30C391BB4@x6009a.umb.corp.umb.com>
In-Reply-To: <BLU108-W2A25F96326B489BEBF26C97650@phx.gbl>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: partitioned tables
From: "Kerber, Andrew W." <Andrew.Kerber@umb.com>
To: joe_dba@hotmail.com,
 tim@evdbt.com,
 oracle-l@freelists.org
X-WSS-ID: 6B413711298501971-01-01
Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C83CC6.D3A36D7D"
X-archive-position: 3873
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: Andrew.Kerber@umb.com
Precedence: normal
Reply-to: Andrew.Kerber@umb.com
List-help: <mailto:ecartis@freelists.org?Subject=help>
List-unsubscribe: <oracle-l-request@freelists.org?Subject=unsubscribe>
List-software: Ecartis version 1.0.0
List-Id: oracle-l <oracle-l.freelists.org>
X-List-ID: oracle-l <oracle-l.freelists.org>
List-subscribe: <oracle-l-request@freelists.org?Subject=subscribe>
List-owner: <mailto:steve.adams@ixora.com.au>
List-post: <mailto:oracle-l@freelists.org>
List-archive: <http://www.freelists.org/archives/oracle-l>
X-list: oracle-l
X-Virus-Scanned: Debian amavisd-new at localhost.localdomain
------_=_NextPart_001_01C83CC6.D3A36D7D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

Not that I have ever seen.  If you really need only the date and not
time portion of the date, just do a trunc on the column..   From what I
have seen, partitioning works really well on date columns.

=20

-----Original Message-----
=46rom: oracle-l-bounce@freelists.org
[mailto:oracle-l-bounce@freelists.org] On Behalf Of Joe Smith
Sent: Wednesday, December 12, 2007 7:29 AM
To: tim@evdbt.com; oracle-l@freelists.org
Subject: RE: partitioned tables

=20

The logical design team seems to think that the date as a number
datatype will speed up queries.  Not true=3F
=20
thanks.



________________________________

Date: Tue, 11 Dec 2007 18:39:20 -0700
=46rom: tim@evdbt.com
To: oracle-l@freelists.org
Subject: Re: partitioned tables

Why use a number to represent a date=3F  There is no advantage whatsoever,
and numerous disadvantages.

...and as Gus pointed out,  range partitioning syntax is "VALUES LESS
THAN" not "VALUES LESS THAN OR EQUAL TO"...


Gus Spier wrote:=20

Of course, it's up to you, but if you set NLS_DATE_FORMAT=3D'YYYYMMDD',
you won't need the TXN_DATE_ID.  I might also recommend that your
partition by range (TXN_DATE_ID) use values less than 20070201 instead
of 20070131.=20

r,

Gus

On Dec 11, 2007 4:51 PM, Joe Smith <joe_dba@hotmail.com> wrote:

My primary key is a composite of 3 columns, but I range parition only on
one column.
=20
 It that a problem=3F
=20

 I know it is a date field, but we are using a number for a date, i.e.
yyyymmdd.
=20
 Would I need to set up a partitioned tablespace for the index, i.e. PK=3F
=20
CREATE TABLE F_MBR_ACCT_TRANSACTION
(
MBR_ACCT_ID               INTEGER  NOT NULL ,
TXN_DATE_ID               INTEGER  NOT NULL ,
SPONSOR_TRAN_ID       INTEGER  NOT NULL ,
TXN_DTTM                  DATE  NULL ,=20
TXN_AMOUNT             NUMBER(14,2)  NULL=20
CONSTRAINT  F_MBR_ACCT_TRANSACTION_PK PRIMARY KEY
(MBR_ACCT_ID,TXN_DATE_ID,SPONSOR_TRAN_ID))
partion by range (TXN_DATE_ID)
(partition jan_2007 values less than (20070131) tablespace
smart_part_jan_2007,=20
 partition feb_2007 values less than (20070228) tablespace
smart_part_feb_2007,
 .
 .
 .
 partition jan_2007 values less than (20071231) tablespace
smart_part_dec_2007);
=20
=20

________________________________

Share life as it happens with the new Windows Live. Share now!
<http://www.windowslive.com/share.html=3Focid=3DTXT_TAGHM_Wave2_sharelife_12
2007>=20

=20

-- http://www.freelists.org/webpage/oracle-l=20

=20

________________________________

The best games are on Xbox 360. Click here for a special offer on an
Xbox 360 Console. Get it now!
<http://www.xbox.com/en-US/hardware/wheretobuy/>=20


---------------------------------------------------------------------------=
---
NOTICE:  This electronic mail message and any attached files are =
confidential.  The information is exclusively for the use of the individual=
 =
or entity intended as the recipient.  If you are not the intended recipient=
,=
 any use, copying, printing, reviewing, retention, disclosure, distribution=
 =
or forwarding of the message or any attached file is not authorized and is =
strictly prohibited.  If you have received this electronic mail message in =
error, please advise the sender by reply electronic mail immediately and =
permanently delete the original transmission, any attachments and any copie=
s=
 of this message from your computer system. Thank you.

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D

------_=_NextPart_001_01C83CC6.D3A36D7D
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

<html>

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=3Dus-ascii">


<meta name=3DGenerator content=3D"Microsoft Word 10 (filtered)">

<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:blue;
	text-decoration:underline;}
p
	{margin-right:0in;
	margin-left:0in;
	font-size:12.0pt;
	font-family:"Times New Roman";}
p.NormalWeb1, li.NormalWeb1, div.NormalWeb1
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
span.EmailStyle19
	{font-family:Arial;
	color:navy;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=3DEN-US link=3Dblue vlink=3Dblue>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Not that I have ever seen.&nbsp; If yo=
u=
 really
need only the date and not time portion of the date, just do a trunc on the
column..&nbsp;&nbsp; From what I have seen, partitioning works really well =
on date
columns.</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
=66ace=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'>-----Original Message-----<br>
<b><span style=3D'font-weight:bold'>From:</span></b>
oracle-l-bounce@freelists.org [mailto:oracle-l-bounce@freelists.org] =
<b><span
style=3D'font-weight:bold'>On Behalf Of </span></b>Joe Smith<br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> Wednesday, December 12=
,=
 2007
7:29 AM<br>
<b><span style=3D'font-weight:bold'>To:</span></b> tim@evdbt.com;
oracle-l@freelists.org<br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> RE: partitioned =
tables</span></font></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D3 face=3D"Time=
s=
 New Roman"><span
style=3D'font-size:12.0pt'>&nbsp;</span></font></p>

<p class=3DMsoNormal =
style=3D'margin-right:0in;margin-bottom:12.0pt;margin-left:
.5in'><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;font-family:Tahoma'>The
logical design team seems to think that the date as a number datatype will
speed up queries.&nbsp; Not true=3F<br>
&nbsp;<br>
thanks.<br>
<br>
</span></font></p>

<div class=3DMsoNormal align=3Dcenter =
style=3D'margin-left:.5in;text-align:center'><font
size=3D2 face=3DTahoma><span style=3D'font-size:10.0pt;font-family:Tahoma'>

<hr size=3D2 width=3D"100%" align=3Dcenter>

</span></font></div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
=66ace=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'>Date: Tue, 11 Dec 2007 =
18:39:20
-0700<br>
=46rom: tim@evdbt.com<br>
To: oracle-l@freelists.org<br>
Subject: Re: partitioned tables<br>
<br>
Why use a number to represent a date=3F&nbsp; There is no advantage =
whatsoever,
and numerous disadvantages.<br>
<br>
...and as Gus pointed out,&nbsp; range partitioning syntax is &quot;VALUES =
LESS
THAN&quot; not &quot;VALUES LESS THAN OR EQUAL TO&quot;...<br>
<br>
<br>
Gus Spier wrote: </span></font></p>

<p class=3DMsoNormal =
style=3D'margin-right:0in;margin-bottom:12.0pt;margin-left:
.5in'><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;font-family:Tahoma'>Of
course, it's up to you, but if you set NLS_DATE_FORMAT=3D'YYYYMMDD', you =
won't
need the TXN_DATE_ID.&nbsp; I might also recommend that your partition by =
range
(TXN_DATE_ID) use values less than 20070201 instead of 20070131. <br>
<br>
r,<br>
<br>
Gus</span></font></p>

<div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
=66ace=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'>On Dec 11, 2007 4:51 PM, Joe =
Smith
&lt;<a href=3D"mailto:joe_dba@hotmail.com">joe_dba@hotmail.com</a>&gt; =
wrote:</span></font></p>

<div>

<p class=3DMsoNormal =
style=3D'margin-right:0in;margin-bottom:12.0pt;margin-left:
.5in'><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;font-family:Tahoma'>My
primary key is a composite of 3 columns, but I range parition only on one
column.<br>
&nbsp;<br>
&nbsp;It that a problem=3F<br>
&nbsp;<br>
<br>
&nbsp;I know it is a date field, but we are using a number for a date, i.e.
yyyymmdd.<br>
&nbsp;<br>
&nbsp;Would I need to set up a partitioned tablespace for the index, i.e. =
PK=3F<br>
&nbsp;<br>
CREATE TABLE F_MBR_ACCT_TRANSACTION<br>
(<br>
MBR_ACCT_ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;
INTEGER&nbsp; NOT NULL ,<br>
TXN_DATE_ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;
INTEGER&nbsp; NOT NULL ,<br>
SPONSOR_TRAN_ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; INTEGER&nbsp; NOT NULL =
,<br>
TXN_DTTM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
DATE&nbsp; NULL , <br>
TXN_AMOUNT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;
NUMBER(14,2)&nbsp; NULL <br>
CONSTRAINT&nbsp; F_MBR_ACCT_TRANSACTION_PK PRIMARY KEY
(MBR_ACCT_ID,TXN_DATE_ID,SPONSOR_TRAN_ID))<br>
partion by range (TXN_DATE_ID)<br>
(partition jan_2007 values less than (20070131) tablespace =
smart_part_jan_2007,
<br>
&nbsp;partition feb_2007 values less than (20070228) tablespace
smart_part_feb_2007,<br>
&nbsp;.<br>
&nbsp;.<br>
&nbsp;.<br>
&nbsp;partition jan_2007 values less than (20071231) tablespace
smart_part_dec_2007);<br>
&nbsp;<br>
&nbsp;</span></font></p>

<div class=3DMsoNormal align=3Dcenter =
style=3D'margin-left:.5in;text-align:center'><font
size=3D2 face=3DTahoma><span style=3D'font-size:10.0pt;font-family:Tahoma'>

<hr size=3D2 width=3D"100%" align=3Dcenter>

</span></font></div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
=66ace=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'>Share life as it happens with=
 =
the
new Windows Live. <a
href=3D"http://www.windowslive.com/share.html=3Focid=3DTXT_TAGHM_Wave2_shar=
elife_122007"
target=3D"_blank">Share now!</a></span></font></p>

</div>

</div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
=66ace=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'>&nbsp;</span></font></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
=66ace=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'>--
http://www.freelists.org/webpage/oracle-l </span></font></p>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
=66ace=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'>&nbsp;</span></font></p>

<div class=3DMsoNormal align=3Dcenter =
style=3D'margin-left:.5in;text-align:center'><font
size=3D2 face=3DTahoma><span style=3D'font-size:10.0pt;font-family:Tahoma'>

<hr size=3D2 width=3D"100%" align=3Dcenter>

</span></font></div>

<p class=3DMsoNormal style=3D'margin-left:.5in'><font size=3D2 =
=66ace=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'>The best games are on Xbox =
360.
Click here for a special offer on an Xbox 360 Console. <a
href=3D"http://www.xbox.com/en-US/hardware/wheretobuy/" target=3D"_new">Get=
 =
it now!</a></span></font></p>

</div>


<P>------------------------------------------------------------------------=
------<br>
NOTICE:  This electronic mail message and any attached files are =
confidential.  The information is exclusively for the use of the individual=
 =
or entity intended as the recipient.  If you are not the intended recipient=
,=
 any use, copying, printing, reviewing, retention, disclosure, distribution=
 =
or forwarding of the message or any attached file is not authorized and is =
strictly prohibited.  If you have received this electronic mail message in =
error, please advise the sender by reply electronic mail immediately and =
permanently delete the original transmission, any attachments and any copie=
s=
 of this message from your computer system. Thank you.<br>
<br>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D<br>
</P></body>

</html>

------_=_NextPart_001_01C83CC6.D3A36D7D--

--
http://www.freelists.org/webpage/oracle-l


