Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Create index on tables that are joined?
On Tue, 16 Oct 2007 10:47:15 -0700, Stick With Hair
<StickWithHair_at_gmail.com> wrote:
>I have a table "ABC" which has 2 million records. A second table "XYZ"
>has 10 million records. I am joining ABC to XYZ and want to get all
>the records from ABC and only matches in XYZ (left join).
>
>ABC --> XYZ
>
>On Fields:
>CustName
>CustTitle
>CustPhoneNumber
>
>The table XYZ has an index on those 3 fields but ABC does not. If I
>created an index on those fields in ABC will it help with query
>performance even though I am bringing in all the rows from ABC? I
>would guess that we need indexes on all foreign keys in both tables.
Whether the INDEX help the FK should not be involved with this query.
If you are returning all rows in ABC, it will doa FULL TABLE SCAN anyway, so the INDEX should be moot.
Perhaps you can post your query and execution plan?
B.
>
>Any Suggestions or ideas?
>Stick with hair
Received on Tue Oct 16 2007 - 13:53:02 CDT