PDA

View Full Version : Table Access OR File Manipulation


tho
02-19-02, 04:57
Hi guys
I was wondering if you could help me.

I am currently designing Perl DBI code to extract data from tables from Sybase Database under UNIX.
There are a dozen of tables I need to extract information from.
The biggest tables are ACCOUNTS and SUBSCRIBERS.
ACCOUNT has 10 million rows and SUBSCRIBERS has 20 million rows.
SUBSCRIBERS is related to the ACCOUNTS table as every account has subscribers.

I am questioning my strategy for this design.
At the end of the extraction process, I need to end up with 1 or 2 flat files that shows rows of SUBSCRIBER data and rows of ACCOUNT data associated to those subscribers.

Which is the better option in terms of performance and reliability:

Access the sybase tables with SELECT+JOIN sql statements, order and write the results to the overall flat file file immediately ?

OR

BCP out the results into multiple files and manipulate/rearrange/order them into a single file under Unix.

I would be most grateful if you could help me out.
Cheers
T

rhs98
03-29-02, 10:19
sounds similar to what i am doing at the moment; but i am using oracle and alot more data (but differently: 150million rows related to 3000rows + alot of additional processing). I decided to go down the oracle (database) road...

nigelrivett
03-31-02, 20:12
try putting your queries into views and using bcp to extract the data. You should find that the fastest and easiest way.