Re: Performance problem on client/server
Posted in 1996
> > I think we are missing the question here... so let me restate > it... [SNIP] > LET f_prepare_stmt = > "SELECT from table where table_id = ? order by invoice_date" > PREPARE select_records FROM f_prepare_stmt > DECLARE select_records_cur CURSOR FOR select_records > > and then later on... > > OPEN select_records_cur using id # id was previously gotten > IF SQLCA.SQLCODE = 0 THEN > FETCH select_records_cur INTO f_record > ....... > What I am concerned about is whether or not > the above code results in the entire table being loaded to the client > and the SQL statement executed on the client. Not by itself. If you run this statement for one record, it should fetch one record and only one record should go down the network. Of course, if you run it 60000 times, it will send 60000 records down the network! :-) > It is my hunch that > this is in fact what is happening as it would in a VB or DELPHI > client/server relationship if not done properly. The program in > question does one select against 60000 server rows looking for non > printed invoice... once it gets the population it gets data from > subordinate tables each with the same id indexed as unique and using > the above technique. Again I dont care if the code sucks on an > isolated platform... what I want to know is whether or not the code > results in the who table(s) shouting down the network?? I don't think so. I can't think of a single instance where the above code would cause a VB type deluge. It should be fairly simple to use netstat or something to monitor network load when you run your report. Sounds to me more like a network problem, or your database needs indexes or an update statistics. Nils was right and *I* missed the point here... :-) HTH. -- Ciao, Billy +------------------------------------------------------------------------------+ | Billy Wheeler Junior Programmer / Director The West Solutions Group | +------------------------------------------------------------------------------+ | (E) billy@west.co.za (U) http://www.west.co.za/billy.html | +------------------------------------------------------------------------------+ | "No, Woody, I said _TUCK_ the kids in bed..." | +------------------------------------------------------------------------------+