<?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: find overlapping time ranges</title>
	<atom:link href="http://www.depesz.com/index.php/2007/11/21/find-overlapping-time-ranges/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.depesz.com/index.php/2007/11/21/find-overlapping-time-ranges/</link>
	<description></description>
	<lastBuildDate>Thu, 29 Jul 2010 21:40:44 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: amnezick</title>
		<link>http://www.depesz.com/index.php/2007/11/21/find-overlapping-time-ranges/comment-page-1/#comment-25839</link>
		<dc:creator>amnezick</dc:creator>
		<pubDate>Tue, 15 Apr 2008 22:22:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.depesz.com/index.php/2007/11/21/find-overlapping-time-ranges/#comment-25839</guid>
		<description>what happened to my condition?

(c&gt;=a a.Nd c=a a.Nd d&lt;=b)</description>
		<content:encoded><![CDATA[<p>what happened to my condition?</p>
<p>(c&gt;=a a.Nd c=a a.Nd d&lt;=b)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: amnezick</title>
		<link>http://www.depesz.com/index.php/2007/11/21/find-overlapping-time-ranges/comment-page-1/#comment-25838</link>
		<dc:creator>amnezick</dc:creator>
		<pubDate>Tue, 15 Apr 2008 22:21:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.depesz.com/index.php/2007/11/21/find-overlapping-time-ranges/#comment-25838</guid>
		<description>????
what happened to my condition?
(c&gt;=a &amp;&amp; c&lt;b&gt;=a &amp;&amp; d&lt;b)</description>
		<content:encoded><![CDATA[<p>????<br />
what happened to my condition?<br />
(c&gt;=a &amp;&amp; c<b>=a &amp;&amp; d&lt;b)</b></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: amnezick</title>
		<link>http://www.depesz.com/index.php/2007/11/21/find-overlapping-time-ranges/comment-page-1/#comment-25837</link>
		<dc:creator>amnezick</dc:creator>
		<pubDate>Tue, 15 Apr 2008 22:20:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.depesz.com/index.php/2007/11/21/find-overlapping-time-ranges/#comment-25837</guid>
		<description>hi there. I&#039;m trying something similar in php though and with dates. Your problem is your condition: you are missing the case (c,d) is inside (a,b). so the condition should be
   (c&gt;=a AND c=a AND d&lt;=b)   that translates into: either edges of interval (c,d) is inside interval (a,b) which is bad</description>
		<content:encoded><![CDATA[<p>hi there. I&#8217;m trying something similar in php though and with dates. Your problem is your condition: you are missing the case (c,d) is inside (a,b). so the condition should be<br />
   (c&gt;=a AND c=a AND d&lt;=b)   that translates into: either edges of interval (c,d) is inside interval (a,b) which is bad</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: depesz</title>
		<link>http://www.depesz.com/index.php/2007/11/21/find-overlapping-time-ranges/comment-page-1/#comment-25598</link>
		<dc:creator>depesz</dc:creator>
		<pubDate>Sat, 29 Mar 2008 13:21:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.depesz.com/index.php/2007/11/21/find-overlapping-time-ranges/#comment-25598</guid>
		<description>@T1:
looks like Ants Aasma approach from his comment is the best.</description>
		<content:encoded><![CDATA[<p>@T1:<br />
looks like Ants Aasma approach from his comment is the best.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: T1</title>
		<link>http://www.depesz.com/index.php/2007/11/21/find-overlapping-time-ranges/comment-page-1/#comment-25597</link>
		<dc:creator>T1</dc:creator>
		<pubDate>Sat, 29 Mar 2008 13:14:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.depesz.com/index.php/2007/11/21/find-overlapping-time-ranges/#comment-25597</guid>
		<description>What was the final conclusion of the query?</description>
		<content:encoded><![CDATA[<p>What was the final conclusion of the query?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: depesz</title>
		<link>http://www.depesz.com/index.php/2007/11/21/find-overlapping-time-ranges/comment-page-1/#comment-24315</link>
		<dc:creator>depesz</dc:creator>
		<pubDate>Thu, 22 Nov 2007 08:56:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.depesz.com/index.php/2007/11/21/find-overlapping-time-ranges/#comment-24315</guid>
		<description>@Jeff Davis:
thanks for link, i&#039;ll definitely check it.</description>
		<content:encoded><![CDATA[<p>@Jeff Davis:<br />
thanks for link, i&#8217;ll definitely check it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Davis</title>
		<link>http://www.depesz.com/index.php/2007/11/21/find-overlapping-time-ranges/comment-page-1/#comment-24313</link>
		<dc:creator>Jeff Davis</dc:creator>
		<pubDate>Wed, 21 Nov 2007 17:27:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.depesz.com/index.php/2007/11/21/find-overlapping-time-ranges/#comment-24313</guid>
		<description>You might be interested to see the pgsql-temporal project here:

http://www.pgfoundry.org/projects/temporal/

It provides a time interval type (what you call a time range) and also provides GiST support functions so that it can be efficiently indexed, including the &quot;overlaps&quot; operator.</description>
		<content:encoded><![CDATA[<p>You might be interested to see the pgsql-temporal project here:</p>
<p><a href="http://www.pgfoundry.org/projects/temporal/" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/www.pgfoundry.org/projects/temporal/?referer=');">http://www.pgfoundry.org/projects/temporal/</a></p>
<p>It provides a time interval type (what you call a time range) and also provides GiST support functions so that it can be efficiently indexed, including the &#8220;overlaps&#8221; operator.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: depesz</title>
		<link>http://www.depesz.com/index.php/2007/11/21/find-overlapping-time-ranges/comment-page-1/#comment-24310</link>
		<dc:creator>depesz</dc:creator>
		<pubDate>Wed, 21 Nov 2007 14:07:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.depesz.com/index.php/2007/11/21/find-overlapping-time-ranges/#comment-24310</guid>
		<description>@Ants Aasma:
ah. sometimes the easiest approach is somehow hidden :)</description>
		<content:encoded><![CDATA[<p>@Ants Aasma:<br />
ah. sometimes the easiest approach is somehow hidden <img src='http://www.depesz.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: depesz</title>
		<link>http://www.depesz.com/index.php/2007/11/21/find-overlapping-time-ranges/comment-page-1/#comment-24309</link>
		<dc:creator>depesz</dc:creator>
		<pubDate>Wed, 21 Nov 2007 14:01:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.depesz.com/index.php/2007/11/21/find-overlapping-time-ranges/#comment-24309</guid>
		<description>@Ants Aasma:
i think the operator is missing in the &quot;where&#039; clause.

but i dont really see what operator could you use to make this query return the same results as &quot;overlaps&quot;.</description>
		<content:encoded><![CDATA[<p>@Ants Aasma:<br />
i think the operator is missing in the &#8220;where&#8217; clause.</p>
<p>but i dont really see what operator could you use to make this query return the same results as &#8220;overlaps&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ants Aasma</title>
		<link>http://www.depesz.com/index.php/2007/11/21/find-overlapping-time-ranges/comment-page-1/#comment-24308</link>
		<dc:creator>Ants Aasma</dc:creator>
		<pubDate>Wed, 21 Nov 2007 14:00:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.depesz.com/index.php/2007/11/21/find-overlapping-time-ranges/#comment-24308</guid>
		<description>Stupid wordpress ate half of the criteria, meant to say
SELECT t1.*, (SELECT count(*) FROM test t2 WHERE (t2.a &lt; t1.b AND t2.b &gt; t1.a)) FROM test t1;</description>
		<content:encoded><![CDATA[<p>Stupid wordpress ate half of the criteria, meant to say<br />
SELECT t1.*, (SELECT count(*) FROM test t2 WHERE (t2.a &lt; t1.b AND t2.b &gt; t1.a)) FROM test t1;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ants Aasma</title>
		<link>http://www.depesz.com/index.php/2007/11/21/find-overlapping-time-ranges/comment-page-1/#comment-24307</link>
		<dc:creator>Ants Aasma</dc:creator>
		<pubDate>Wed, 21 Nov 2007 13:59:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.depesz.com/index.php/2007/11/21/find-overlapping-time-ranges/#comment-24307</guid>
		<description>That or criteria simplifies as
SELECT t1.*, (SELECT count(*) FROM test t2 WHERE t2.a  t1.a) FROM test t1;
This way there is one fewer index scans.</description>
		<content:encoded><![CDATA[<p>That or criteria simplifies as<br />
SELECT t1.*, (SELECT count(*) FROM test t2 WHERE t2.a  t1.a) FROM test t1;<br />
This way there is one fewer index scans.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
