pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: R D <mrk279@yahoo.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Indexes and Views
Date: Sat, 24 Feb 2001 11:35:55 -0500
Message-ID: <11932.983032555@sss.pgh.pa.us> (raw)
In-Reply-To: <20010224112253.1319.qmail@web10012.mail.yahoo.com>
References: <20010224112253.1319.qmail@web10012.mail.yahoo.com>

R D <mrk279@yahoo.com> writes:
> i'm storing col1 to col3 as integers to save storage
> space(infact they are fixed point).I have many tables
> ctrated using this template only the view devidor
> constants are different for each table. Here they are
> 1000.0 1000.0 and 100.0 but for every table they are
> different. I would like to be able to execute the
> queryes like this using the index:

This table design is sufficiently ugly and pointless that I feel no deep
remorse over the fact that you can't use an index that way ;-)

Why are you bothering with these divisors?  float4 is no larger than
int4 and will eliminate all of these pushups: just store the values
naturally.

If there really is some good reason to use scaled integers, you should
build yourself a scaled-integer datatype.

			regards, tom lane



view thread (3+ messages)  latest in thread

Message-ID: <11932.983032555@sss.pgh.pa.us>
Permalink:  ../11932.983032555@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/11932.983032555@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, mrk279@yahoo.com
  Subject: Re: Indexes and Views
  In-Reply-To: <11932.983032555@sss.pgh.pa.us>
  References: <20010224112253.1319.qmail@web10012.mail.yahoo.com> <11932.983032555@sss.pgh.pa.us>

* 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