Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f1OGa1x81973 for ; Sat, 24 Feb 2001 11:36:01 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.1/8.11.1) with ESMTP id f1OGZt911935; Sat, 24 Feb 2001 11:35:55 -0500 (EST) To: R D cc: pgsql-admin@postgresql.org Subject: Re: Indexes and Views In-reply-to: <20010224112253.1319.qmail@web10012.mail.yahoo.com> References: <20010224112253.1319.qmail@web10012.mail.yahoo.com> Comments: In-reply-to R D message dated "Sat, 24 Feb 2001 03:22:53 -0800" Date: Sat, 24 Feb 2001 11:35:55 -0500 Message-ID: <11932.983032555@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200102/204 X-Sequence-Number: 811 R D 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