Re: Interview question

From: David Ramírez Reyes <dramirezr_at_gmail.com>
Date: Fri, 26 Apr 2013 11:47:12 -0500
Message-ID: <CAJt=wvXjiBrVSniCehD03kKmSWeJ=EyxPAWW28Lc7c+fDqBLZQ_at_mail.gmail.com>



The question is not well done, it's like asking what is best, add more disk space or delete unused files from a filesystem?, you are asking about comparison from apples to pears, removing the records will always be the best option (if possible).
A better question would be what is the best way to have both values separated (the one in both and the one only in A) from performance perspective?, adding a flag?, partitioned table?, partitioned index?, both?, materialized view?

Thanks

David Ramírez Reyes
Profesión: Padre de Familia

On 26 April 2013 10:10, Guillermo Alan Bort <cicciuxdba_at_gmail.com> wrote:

> Partitioning?
> Adding a column and flagging the rows is not the same as removing them. So
> this is a functional question. If the app supports the use of this column
> to filter the rows then you would be adding a fast full index scan to the
> execution of the queries (assuming they are written properly). However,
> removing them would have a big impact for a limited time and no execution
> plan would need to change. I would personally go with deleting the records,
> under the correct circumstances, of course.
>
> A deeper understanding of the relation between these tables and the reason
> behind the data duplication would be necessary.
>
> hth
>
> Alan.-
>
>
> On Fri, Apr 26, 2013 at 10:36 AM, <rajugaru.vij_at_gmail.com> wrote:
>
> > Again back with an interview question.
> > Table A has 400 million rows and table b has 1 million rows.
> >
> > I want to compare table A and Table B and find all the rows available in
> b
> > which are already available in A.
> >
> > want to remove all those which are available in B from A.
> >
> > What would be best option? Deleting them or adding a column and flagging
> > them?
> >
> > What's the better option performance wise?
> >
> > Thanks
> > Sent on my BlackBerryŽ from Vodafone--
> > http://www.freelists.org/webpage/oracle-l
> >
> >
> >
>
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Apr 26 2013 - 18:47:12 CEST

Original text of this message