Re: Creating exponential sequences

From: Rod Kreisler <rod(at)23net(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Creating exponential sequences
Date: 2002-10-08 03:25:25
Message-ID: JNEGKNDJGBKLBDGPOPFOIEJNDCAA.rod@23net.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-novice

My last example should have used an int8.

Not in some instances. For example, I'm working on a structure for a real
estate db. Each property has about 15 different attributes that are best
described as sets, e.g. rooms (kitchen, living room, utility, family room,
etc) Each set is limited and 64 would more than suffice for all of them.
As it is a 1:M join table is required to link the properties to each
attribute. Now the number of elements in each set varies, rooms would be
the largest with an average of around 11, some will only be two or three.
We are projecting 500,000 properties within the first 6 months. That would
equate to a 1:M join table containing 5.5 million entries. We will almost
exclusively be querying for one property at a time, so grabbing a single
value from the main property table (which we will have to query anyway)
would be preferable.

> -----Original Message-----
> From: pgsql-novice-owner(at)postgresql(dot)org
> [mailto:pgsql-novice-owner(at)postgresql(dot)org]On Behalf Of Tom Lane
> Sent: Monday, October 07, 2002 11:13 PM
> To: Rod Kreisler
> Cc: pgsql-novice(at)postgresql(dot)org
> Subject: Re: [NOVICE] Creating exponential sequences
>
>
> Rod Kreisler <rod(at)23net(dot)net> writes:
> > Is there any way to create an exponential sequence rather than
> incremental?
> > What I would like is a sequence that would start at 1 and grow
> exponentially
> > by 2. (i.e. 1,2,4,8,16,32....)
>
> A sequence that will bomb out after 32 or 64 increments seems of limited
> use ...
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Joshua Daniel Franklin 2002-10-08 17:26:55 hiding normalization with views
Previous Message Rod Kreisler 2002-10-08 03:13:24 Re: Creating exponential sequences