Selecting with a large number of foreign keys
От | Matt Behrens |
---|---|
Тема | Selecting with a large number of foreign keys |
Дата | |
Msg-id | 372F5CEF.40A8B29@iserv.net обсуждение исходный текст |
Список | pgsql-sql |
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 <matt@iserv.net> Network Operations Center, The Iserv Company
В списке pgsql-sql по дате отправления: