<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Death of the End Date &#8211; How LAG and LEAD help fight redundancy</title>
	<atom:link href="http://technology.amis.nl/2005/09/30/death-of-the-end-date-how-lag-and-lead-help-fight-redundancy/feed/" rel="self" type="application/rss+xml" />
	<link>http://technology.amis.nl/2005/09/30/death-of-the-end-date-how-lag-and-lead-help-fight-redundancy/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=death-of-the-end-date-how-lag-and-lead-help-fight-redundancy</link>
	<description></description>
	<lastBuildDate>Fri, 12 Apr 2013 10:04:09 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Garri</title>
		<link>http://technology.amis.nl/2005/09/30/death-of-the-end-date-how-lag-and-lead-help-fight-redundancy/#comment-2489</link>
		<dc:creator>Garri</dc:creator>
		<pubDate>Fri, 20 Jan 2006 14:54:56 +0000</pubDate>
		<guid isPermaLink="false">/?p=825#comment-2489</guid>
		<description><![CDATA[hi
Why do not answer my question?]]></description>
		<content:encoded><![CDATA[<p>hi<br />
Why do not answer my question?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sreenivasarao</title>
		<link>http://technology.amis.nl/2005/09/30/death-of-the-end-date-how-lag-and-lead-help-fight-redundancy/#comment-2488</link>
		<dc:creator>Sreenivasarao</dc:creator>
		<pubDate>Fri, 02 Dec 2005 08:11:52 +0000</pubDate>
		<guid isPermaLink="false">/?p=825#comment-2488</guid>
		<description><![CDATA[I want to know the date format in Oracle Warehouse Builder.
I wanted to filter the data based on a column Date.
The date format of this field is &#039;MM/DD/YYYY HH24:MI:SS&#039;.
I want to filetr the data based on a single day.
I am giving the filter condition in Filter transformation is
TO_DATE(INOUTGRP1.DATE,&#039;DD-MON-YYYY&#039;)=TO_DATE(&#039;13-12-2004&#039;,&#039;DD-MON-YYYY&#039;)
But it is not working.If u know the solution of this problem, please let me know.]]></description>
		<content:encoded><![CDATA[<p>I want to know the date format in Oracle Warehouse Builder.<br />
I wanted to filter the data based on a column Date.<br />
The date format of this field is &#8216;MM/DD/YYYY HH24:MI:SS&#8217;.<br />
I want to filetr the data based on a single day.<br />
I am giving the filter condition in Filter transformation is<br />
TO_DATE(INOUTGRP1.DATE,&#8217;DD-MON-YYYY&#8217;)=TO_DATE(&#8217;13-12-2004&#8242;,&#8217;DD-MON-YYYY&#8217;)<br />
But it is not working.If u know the solution of this problem, please let me know.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Toon Koppelaars</title>
		<link>http://technology.amis.nl/2005/09/30/death-of-the-end-date-how-lag-and-lead-help-fight-redundancy/#comment-2487</link>
		<dc:creator>Toon Koppelaars</dc:creator>
		<pubDate>Mon, 03 Oct 2005 21:27:12 +0000</pubDate>
		<guid isPermaLink="false">/?p=825#comment-2487</guid>
		<description><![CDATA[Just a quick response on the overhead of the analytical functions...

Lucas&#039; first query, third alternative, regarding current product prices executes with plan:
(Note: the SYS... index is the primary key on (product,begin_date)).
--------------------------------------------------------
&#124; Id  &#124; Operation                     &#124; Name           &#124;
--------------------------------------------------------
&#124;   0 &#124; SELECT STATEMENT              &#124;                &#124;
&#124;*  1 &#124;  VIEW                         &#124;                &#124;
&#124;   2 &#124;   WINDOW BUFFER               &#124;                &#124;
&#124;   3 &#124;    TABLE ACCESS BY INDEX ROWID&#124; PRODUCT_PRICES &#124;
&#124;   4 &#124;     INDEX FULL SCAN           &#124; SYS_C0014032   &#124;
--------------------------------------------------------
In the redundant enddate scenario a FULL table scan would be done.

The second query regarding fully qualified periods, executes with the same plan:
-------------------------------------------------------
&#124; Id  &#124; Operation                    &#124; Name           &#124;
-------------------------------------------------------
&#124;   0 &#124; SELECT STATEMENT             &#124;                &#124;
&#124;   1 &#124;  WINDOW BUFFER               &#124;                &#124;
&#124;   2 &#124;   TABLE ACCESS BY INDEX ROWID&#124; PRODUCT_PRICES &#124;
&#124;   3 &#124;    INDEX FULL SCAN           &#124; SYS_C0014032   &#124;
-------------------------------------------------------
Again the redundant enddate scenario executes with a FULL table scan.

Granted, the plans with the analytic functions are (still) most likely to be more expensive (both

cpu+I/O) than the redundant datamodel scenario: this mainly depends on the clustering factor for the

primary key index.

The execution plans DO NOT scare me however, AND are MUCH better than the queries we had to write in

the days when we did not have available to us the analytical functions (nested subqueries to find

maximum begindate before sysdate, etc.).

By &#039;do not scare me&#039; I mean that I&#039;m more than happy to trade-off the overhead for these queries

against the code that I&#039;d have to write to implement the &#039;redundant enddate&#039; business rule including

the runtime overhead it generates in transactions (as described by Lucas above). I have yet to

encounter the first production database (that is running for a few years) that has redundancy in

it&#039;s datamodel, AND has no violations with regards to this redundancy...

I very often have discussions with &#039;designers&#039; that create datamodels with redundancy designed into

the model: &#039;For performance reasons&#039;... With the current state of the optimizer technology available

to us, I always first disagree with these design decisions. I always seek proof that the queries

that this designed-redundancy is targetting, will come out as the bottle-necks of the system to be

built. To no suprise such proof can rarely be given... And then I veto the redundancy. :-)]]></description>
		<content:encoded><![CDATA[<p>Just a quick response on the overhead of the analytical functions&#8230;</p>
<p>Lucas&#8217; first query, third alternative, regarding current product prices executes with plan:<br />
(Note: the SYS&#8230; index is the primary key on (product,begin_date)).<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
| Id  | Operation                     | Name           |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
|   0 | SELECT STATEMENT              |                |<br />
|*  1 |  VIEW                         |                |<br />
|   2 |   WINDOW BUFFER               |                |<br />
|   3 |    TABLE ACCESS BY INDEX ROWID| PRODUCT_PRICES |<br />
|   4 |     INDEX FULL SCAN           | SYS_C0014032   |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
In the redundant enddate scenario a FULL table scan would be done.</p>
<p>The second query regarding fully qualified periods, executes with the same plan:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
| Id  | Operation                    | Name           |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
|   0 | SELECT STATEMENT             |                |<br />
|   1 |  WINDOW BUFFER               |                |<br />
|   2 |   TABLE ACCESS BY INDEX ROWID| PRODUCT_PRICES |<br />
|   3 |    INDEX FULL SCAN           | SYS_C0014032   |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Again the redundant enddate scenario executes with a FULL table scan.</p>
<p>Granted, the plans with the analytic functions are (still) most likely to be more expensive (both</p>
<p>cpu+I/O) than the redundant datamodel scenario: this mainly depends on the clustering factor for the</p>
<p>primary key index.</p>
<p>The execution plans DO NOT scare me however, AND are MUCH better than the queries we had to write in</p>
<p>the days when we did not have available to us the analytical functions (nested subqueries to find</p>
<p>maximum begindate before sysdate, etc.).</p>
<p>By &#8216;do not scare me&#8217; I mean that I&#8217;m more than happy to trade-off the overhead for these queries</p>
<p>against the code that I&#8217;d have to write to implement the &#8216;redundant enddate&#8217; business rule including</p>
<p>the runtime overhead it generates in transactions (as described by Lucas above). I have yet to</p>
<p>encounter the first production database (that is running for a few years) that has redundancy in</p>
<p>it&#8217;s datamodel, AND has no violations with regards to this redundancy&#8230;</p>
<p>I very often have discussions with &#8216;designers&#8217; that create datamodels with redundancy designed into</p>
<p>the model: &#8216;For performance reasons&#8217;&#8230; With the current state of the optimizer technology available</p>
<p>to us, I always first disagree with these design decisions. I always seek proof that the queries</p>
<p>that this designed-redundancy is targetting, will come out as the bottle-necks of the system to be</p>
<p>built. To no suprise such proof can rarely be given&#8230; And then I veto the redundancy. <img src='http://technology.amis.nl/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Moss</title>
		<link>http://technology.amis.nl/2005/09/30/death-of-the-end-date-how-lag-and-lead-help-fight-redundancy/#comment-2486</link>
		<dc:creator>Jeff Moss</dc:creator>
		<pubDate>Fri, 30 Sep 2005 08:25:37 +0000</pubDate>
		<guid isPermaLink="false">/?p=825#comment-2486</guid>
		<description><![CDATA[What you say is perfectly correct, however, I would have to be a little concerned with the efficiency of needing to use
the analytic function every time I wanted to work out for my given point in time all those records which were applicable.
I&#039;ve not tested it but I&#039;m guessing the analytic approach would be slower - and in a warehouse situation (which is what
I&#039;m normally in) then the number of rows on the table you are scanning can be significantly large which might make the
performance differential significant enough to warrant not doing it that way.

We also use the END_DATE of NULL for partitioning purposes - to segregate current open rows from historical closed rows so
that&#039;s another use for the physical END_DATE column.

Also, it does make the assumption that the record can&#039;t go away and then come back - which for some of our tables is not
the case. Maybe the government come along and want to make a public footpath between the two gardens - now you have a gap.

Nice article.]]></description>
		<content:encoded><![CDATA[<p>What you say is perfectly correct, however, I would have to be a little concerned with the efficiency of needing to use<br />
the analytic function every time I wanted to work out for my given point in time all those records which were applicable.<br />
I&#8217;ve not tested it but I&#8217;m guessing the analytic approach would be slower &#8211; and in a warehouse situation (which is what<br />
I&#8217;m normally in) then the number of rows on the table you are scanning can be significantly large which might make the<br />
performance differential significant enough to warrant not doing it that way.</p>
<p>We also use the END_DATE of NULL for partitioning purposes &#8211; to segregate current open rows from historical closed rows so<br />
that&#8217;s another use for the physical END_DATE column.</p>
<p>Also, it does make the assumption that the record can&#8217;t go away and then come back &#8211; which for some of our tables is not<br />
the case. Maybe the government come along and want to make a public footpath between the two gardens &#8211; now you have a gap.</p>
<p>Nice article.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
