X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id BEBA1D8280 for ; Wed, 12 Oct 2005 23:02:55 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 87726-08 for ; Thu, 13 Oct 2005 02:02:47 +0000 (GMT) Received: from smtp-v.fe.bosch.de (smtp-v.fe.bosch.de [139.15.237.2]) by svr1.postgresql.org (Postfix) with ESMTP id 301E6D824B for ; Wed, 12 Oct 2005 23:02:46 -0300 (ADT) Received: from mta1.fe.internet.bosch.com (unknown [10.4.98.30]) by imta6.fe.bosch.de (Postfix) with ESMTP id 981103804E for ; Thu, 13 Oct 2005 04:02:45 +0200 (CEST) Received: from mailgate.cl.internet.bosch.com (virusscan4.fe.internet.bosch.com [10.4.98.10]) by mta1.fe.internet.bosch.com (Postfix) with ESMTP id B73528C007 for ; Thu, 13 Oct 2005 04:02:44 +0200 (CEST) Received: from cl-mail01.au.bosch.com (unknown [10.23.5.53]) by mailgate.cl.internet.bosch.com (Postfix) with ESMTP id 7A63F5282E for ; Thu, 13 Oct 2005 12:02:42 +1000 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: Re: SEVEN cross joins?!?!? Date: Thu, 13 Oct 2005 12:02:42 +1000 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [SQL] SEVEN cross joins?!?!? Thread-Index: AcXPmJKZXt6JnQ+mRdC8/ESN7TwhHQAAVPJQ From: "Stewart Ben (RBAU/EQS4) *" To: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.888 required=5 tests=[AWL=-0.343, DNS_FROM_RFC_ABUSE=0.374, MANY_EXCLAMATIONS=0, PLING_QUERY=0.857] X-Spam-Level: X-Archive-Number: 200510/120 X-Sequence-Number: 22973 > Splitting locations into subsets (like 2,2,3) doesn't work=20 > because it is possible that low values in one location can be offset by=20 > high values in another location, and still result in an excellent combo. >=20 > The good news is these suggestions got me thinking outside=20 > the box. I think I can program a modified brute-force that bypasses=20 > large numbers of combos early. It might still be too large/slow, so I'd be=20 > interested in finding more info about these "smarter algorithms" in option=20 Could you define an view with a calculated field, say, 2 * a1 + 6 * a2 + 3 * a3, and then use this aggregate to score the individual rows? I haven't looked at the exact nature of the problem, but if you're multiplying a table by itself, it may be worth redefining the problem in terms of a simple ranking algorithm, define a column to calculate this, then sort by that column. Best regards, Ben Stewart -- Robert Bosch (Australia) Pty. Ltd. Engineering Quality Services, Student Software Engineer (RBAU/EQS4) Locked Bag 66 - Clayton South, VIC 3169 - AUSTRALIA Tel: +61 3 9541-7002 Fax: +61 3 9541-7700 mailto:ben.stewart@au.bosch.com http://www.bosch.com.au/=20