Received: from mail.iserv.net (mail.iserv.net [204.177.184.19]) by hub.org (8.9.3/8.9.3) with ESMTP id QAA20140 for ; Tue, 4 May 1999 16:45:36 -0400 (EDT) (envelope-from matt@iserv.net) Received: from iserv.net (wibble.iserv.net [206.114.47.48]) by mail.iserv.net (8.8.5/8.8.5) with ESMTP idi for ; Tue, 4 May 1999 16:53:59 -0400 (EDT)QAA14944 for ; Tue, 4 May 1999 16:53:59 -0400 (EDT) X-Envelope-To: Message-ID: <372F5CEF.40A8B29@iserv.net> Date: Tue, 04 May 1999 16:47:43 -0400 From: Matt Behrens Organization: The Iserv Company X-Mailer: Mozilla 4.51 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Selecting with a large number of foreign keys Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I didn't get any answers from the -novice list, maybe you folks know? In my call tracking database, I have quite a few fields that are numbers representing primary keys in a number of smaller tables; these are used when there is a drop-down list of choices that someone can pick from. My problem is that when I do reports on these, I want to see the name of the selection instead of the number. I tried doing this with the following query (which seems to work well for a small number of these fields): SELECT call_table.field_one, call_table.field_two, field_three_table.name AS field_three WHERE field_three_table.id = call_table.field_three; However, when I start doing this with a LOT of fields, I notice the backend process growing extremely large (just pulling up all the calls for two days with 20 fields selected resulting in the backend growing > 50 MB and taking a loooong time.) Is there a better way to do these? -- Matt Behrens Network Operations Center, The Iserv Company