Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Problem with "INSERT" statement
Raj,
The thing that struck me first about your query is that by just enumerating your views and tables in the FROM clause and not joining them in the WHERE clause (i.e. view1.field1 = table2.field2 and table2.field2 = table3.field3) you are producing a CARTESIAN PRODUCT of the three entities. If the rows in view1, table2, and table3 are significant, then computing a cartesian product will take a very long time.
HTH,
Brian
Raj wrote:
>
> Hi All,
> we have a query like:
>
> INSERT into T1 (
> Field1,
> Field2,
> Field3 )
> SELECT
> Field1,
> Field2,
> Field3
> FROM
> View1,
> Table2,
> Table3
> WHERE
> Field1 between date1 and date2
>
> The problem is that it takes hours to insert records into T1
> table. But running the subquery (SELECT..... date2) displays the
> records in few seconds.
> I have doublechecked, there is sufficient space in temporary,
> data & rollback segments.
> Could any one throw light on this?? Is this an oracle bug??
>
> Thanks & regards
> -Rajeev
Received on Thu Jul 12 2001 - 08:11:48 CDT
![]() |
![]() |