Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: reading random records with JDBC?
On Nov 27, 4:21 am, "йенс мартин шлаттер" <MfwEwkCtz..._at_spammotel.com>
wrote:
> > I have always tried to follow the tenet "there are no stupid
> > questions" when I read newsgroups, but this thread is pushing my
> > limits.
> > Just how would you select the row from the second table?
> > Think about what you seem to be attempting to do. Consider this
> > outside the context of Oracle. Let say you were comparing two files
> > (then record is the correct term). You somehow randomly select records
> > out of the first file, then what would be the corresponding record in
> > the second file?
>
> I compare the row 1 in table 1 with row 1 in table 2, then row 100 in
> table 1 with row 100 in table 2. Nothing spectacular. My program
> works, but is very slow.
>
> JMS
Please define row 100.
Keep in mind that in a relational database, the tables contain SETs of data. There is no order to a set. (recall your grade school mathematics class, with Venn Diagrams for example)
So I guess you are basically doing this
open SELECT * from tableA
open SELECT * from tableB
loop
fetch rowA
fetch rowB
compare and report
end loop
so you get a report on Monday. Monday night, the DBA migrates the DB to a new server, or maybe just reorganizes the file structure. No data is changed. rerunning you program on Tuesday gives different results. (Do you know why?)
This report tells you nothing really. So you are doing this because...?
Given that you are doing full scans BY ROW (whatever that means to you), then there is no speed up possible. With no criteria for row selection, you cannot get any better than linear search. You are done. game over.
Ed
Again, this sounds like busy work or an insane assignment to me. It
makes no sense.
Received on Tue Nov 27 2007 - 10:48:36 CST