[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: Client-server strategy for simulating a server-side join is not working (sports 2000)

Status
Not open for further replies.
P

Patrick Tingen

Guest
It pretty much depends on your data distribution, but in a test where I played with this, I found that is was faster to just fetch all orders and all customers first in separate loops and then perform the query locally: /* Local data */ DEFINE TEMP-TABLE TT_Order NO-UNDO FIELD OrderNum AS INTEGER FIELD OrderDate AS DATE FIELD OrderStatus AS CHARACTER FIELD CustNum AS INTEGER INDEX TT_Order1 IS UNIQUE PRIMARY OrderNum INDEX TT_Order2 CustNum. DEFINE TEMP-TABLE TT_Customer NO-UNDO FIELD CustNum AS INTEGER FIELD Name AS CHARACTER INIT ? INDEX TT_Customer1 IS UNIQUE PRIMARY CustNum. /* Get data */ FOR EACH Order NO-LOCK WHERE Order.OrderDate >= 01/01/1998 AND Order.OrderDate < 02/01/2998: CREATE TT_Order. BUFFER-COPY order TO TT_Order. END. FOR EACH customer NO-LOCK: CREATE TT_Customer. BUFFER-COPY customer TO TT_Customer. END. /* Join */ FOR EACH TT_Order, EACH TT_Customer OF TT_Order: DISPLAY TT_Order.ordernum TT_Customer.name . END. In this case, you get all customers which is probably too much, but like I said, it depends on your situation. At one client we used this to speed up some processing.

Continue reading...
 
Status
Not open for further replies.
Top