Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Sybase > Re: creating vi...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 3 Topic 2393 of 2544
Post > Topic >>

Re: creating view to select unique records

by jefftyzzer <jefftyzzer@[EMAIL PROTECTED] > Jan 31, 2008 at 10:26 AM

On Jan 31, 7:41 am, "set...@[EMAIL PROTECTED]
" <set...@[EMAIL PROTECTED]
> wrote:
> Hello All,
>
> I am unsure if similar question has already been posted to this group.
> If so please point me to the relevant post/group.. otherwise please
> read on...
>
> We are in the process of migrating our application from Sybase to
> Oracle. Basically for each table, we would do an bcp out of the table
> and load it into oracle via sqlldr.
>
> The source table has duplicate rows in it. However, we would not want
> to ex****t those dupe rows to our oracle table.
>
> My intention is to create a view that would pick up only the unique
> records and I can bcp the data out of the view.
>
> I can create a view something like
> select distict * from sybase_table. However, I am worried about the
> performance since I have heard that distinct clause is a costly
> operation ( I am working on about 120-140 million rows ).
>
> Is there a better way to achieve it?
>
> Thanks in advance
> Arun

Arun:

Are the duplication criteria just a few columns or all columns? If
just a few, it might be better to create a unique constraint on those
columns on the target (Oracle) side and allow SQL*Loader to handle the
rejected duplicates. Naturally, having any indexes (which is, of
course, how unique/PK constraints are enforced) on the target table
can slow loads into that table, so you should use a DIRECT PATH load
in SQL*Loader.

Another approach might be to delete the duplicate rows out of the
source table (or a copy of it if you're nervous ;-) first. Of course,
deleting from such a large table will also be costly, but maybe not as
costly as the DISTINCTing.

Finally, you may want to dump the source data to a text file, use any
myriad of (fast) text-manipulation utilities to remove the duplicates,
then use SQL*Loader to load the cleansed text file into the target.

HTH,

--Jeff
 




 3 Posts in Topic:
creating view to select unique records
"setsun@[EMAIL PROTE  2008-01-31 07:41:14 
Re: creating view to select unique records
jefftyzzer <jefftyzzer  2008-01-31 10:26:20 
Re: creating view to select unique records
Keith <keith.wingate@[  2008-02-01 05:54:37 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Oct 15 21:50:23 CDT 2008.