pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ty Busby <tybusby@yahoo.com>
To: Ty Busby <tybusby@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: optimize self-join query
Date: Sat, 29 Oct 2011 17:04:11 -0400
Message-ID: <A6BD48AA-5E71-4310-986E-05E6BDC2328F@yahoo.com> (raw)
In-Reply-To: <BFC71945-8821-4BC9-8430-A8CACF8F3794@gmail.com>
References: <BFC71945-8821-4BC9-8430-A8CACF8F3794@gmail.com>

Thanks to everyone for all the thoughtful responses.  They have been incredibly helpful.

Ended up optimizing per Lee, and creating buckets per Tom.  Thanks again.

On Oct 25, 2011, at 2:37 PM, Ty Busby wrote:

I have a table that stores a very large starting number called epc_start_numeric and a quantity.  I've apparently built the most inefficient query possible for doing the job I need: find out if any records overlap.  Imagine the epc_start_numeric + quantity representing a block of numbers.  I need to find out if any of these blocks overlap.




view thread (5+ messages)

Message-ID: <A6BD48AA-5E71-4310-986E-05E6BDC2328F@yahoo.com>
Permalink:  ../A6BD48AA-5E71-4310-986E-05E6BDC2328F@yahoo.com/
Also on:    postgresql.org/message-id/A6BD48AA-5E71-4310-986E-05E6BDC2328F@yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tybusby@yahoo.com, tybusby@gmail.com
  Subject: Re: optimize self-join query
  In-Reply-To: <A6BD48AA-5E71-4310-986E-05E6BDC2328F@yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox