• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Subquery Execution Issue

 
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am invoking a below sub query :-

insert into customer(select * from customer_temp)

Which is basically merging 2 tables, whether this query will be faster as both the queries will be invoked at once compared to invoking these queries individually?

For the above query whether 2 execution plan will be created or only one plan will be created? Please clarify.

Thanks
 
Bartender
Posts: 598
26
Oracle Notepad Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rithanya Laxmi wrote:Hi,

I am invoking a below sub query :-

insert into customer(select * from customer_temp)

Which is basically merging 2 tables, whether this query will be faster as both the queries will be invoked at once compared to invoking these queries individually?

For the above query whether 2 execution plan will be created or only one plan will be created? Please clarify.

Thanks



Other than being syntactically incorrect, that is the best way to do it via SQL. (export/import can be faster in some databases in some cases.) You need to remove the parenthesis for it to work, as the parenthesis denote a column list.

Ideally, however, a column list would be provided. * should only be used in COUNT(), EXISTS(), and ad-hoc queries: INSERT INTO Customer(col1, col2, col3) SELECT col1, col2, col3 FROM Customer Temp;
 
A wop bop a lu bob a womp bam boom. Tutti frutti ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic