Efficiency of inner joins across multiple tables - Mailing list pgsql-general

From Saptarshi Guha
Subject Efficiency of inner joins across multiple tables
Date
Msg-id FAAC2F77-64EA-414E-B0EF-FD45AFE57BD3@gmail.com
Whole thread Raw
Responses Left outer join question  ("Bill Reynolds" <Bill.Reynolds@ateb.com>)
Re: Efficiency of inner joins across multiple tables  ("David Wilson" <david.t.wilson@gmail.com>)
List pgsql-general
Hello,
I guess this is  basic question for DBAs. I have several tables, each
numbering in 100,000's of rows.
They all have have connectionHash as the primary key and indices on
several variables.
E.g
Table1 has connectionHash, duration, type
Table2 has connectionHash, location
Table3 has connectionHash, region


Now i need to select columns:connectionHash, duration, location,
region (the variables can differ)
from Tables 1,2 and 3 using an inner join on connectionHash(indexed).

Q: How efficient is this?

Issues involved:
One might suggest that i make a table with all columns from across all
tables, however, as my research continues
more tables, TableK, with connectionHash, extracolumn will be created.
Option:
Every time i create a new table should i create a table with all
columns and query from that? So I make one new table
(made via an inner join, but done only once) and subsequent queries
made from this larger table(union of all columns from Tables 1..K)

Any suggestions will be very much welcome.
Regards
Saptarshi




pgsql-general by date:

Previous
From: Luis Castillo
Date:
Subject: question
Next
From: "Bill Reynolds"
Date:
Subject: Left outer join question