the st thing is right not the queryrun.get thing.

Simon

--- In [email protected], "rolf_olsen" <[EMAIL PROTECTED]>
wrote:
>
> Hi Barry,
>
> As far as I can see you don't reset st before the execution of the
> query, so it prints the time for both the while select and the
query
> initialization and the query execution. Or am I missing something
> here?
>
> I guess you should also do a queryrun.get(tablenum(xxx)) into a
> buffer in the queryloop to get the same functional result as the
two
> select loops (where the programmer has a initialized buffer
> available).
>
> Can you post the result from a run with that fixed, I would like
to
> see the real result (since I believe that the query - from the
time
> it's executed) and a select should be more or less equally fast.
>
> Kind regards,
>
> Rolf Olsen
> thy:development
>
>
> --- In [email protected], "Bayliss, Barry"
> <[EMAIL PROTECTED]> wrote:
> >
> >
> > Hello Steeve,
> >
> > Can you post the code you used to test, as I found the following:
> >
> >
> > Using the next method:            2:27.002
> > Using the while method:            2:27.010
> > Using the query method:            5:04.052
> >
> > The number of records in the table was:      59071
> >
> > The code I used was:
> >
> > static void Job231(Args _args)
> > {
> >     Query                                   Query;
> >     QueryBuildDataSource                    qbds;
> >     QueryRun                                QueryRun;
> >     PCDrockfastTrxHeader                    PCDrockfastTrxHeader;
> >     int                                     i,st;
> >     ;
> >
> >     // Ensuring the creation of an execution plan
> >     while
> >     select  PCDRockfastTrxHeader
> >     {
> >         i = 0;
> >     }
> >
> >     st      = winAPI::getTickCount();
> >     select  PCDrockfastTrxHeader;
> >     while   (PCDrockfastTrxHeader)
> >     {
> >         i   = 0;
> >         next PCdrockfastTrxHeader;
> >     }
> >     info("Next:   " + Milliseconds2strhms(winAPI::getTickCount
() -
> st));
> >
> >     st      = winAPI::getTickCount();
> >     while
> >     select  PCDrockfastTrxHeader
> >     {
> >         i = 0;
> >     }
> >     info("While:  " + Milliseconds2strhms(winAPI::getTickCount
() -
> st));
> >
> >
> >     Query       = new Query();
> >     qbds        = Query.addDataSource(TableNum
> (PCDRockfastTrxHeader));
> >     QueryRun    = new QueryRun(Query);
> >
> >     while   (QueryRun.next()) {
> >         i = 0;
> >     }
> >     info("Query:  " + Milliseconds2strhms(winAPI::getTickCount
() -
> st));
> > }
> >
> > The following was placed in the global class.
> >
> > static TempStr milliSeconds2StrHMS(int time)
> > {
> >     int                             millisec;
> >     ;
> >
> >     millisec            = time mod 3600 mod 60 mod 1000;
> >     time                = time div 1000;
> >     return  Time2strHMS(time) + "." + num2str0(millisec,
3,0,0,0);
> > }
> >
> >
> >
> >
> > Barry.
> >
> >
> >
> >
> > -----Original Message-----
> > From: [email protected] [mailto:development-
> [EMAIL PROTECTED] On Behalf Of Steeve Gilbert
> > Sent: Thursday, 22 December 2005 12:03 AM
> > To: [email protected]
> > Subject: RE : RE : [development-axapta] Reset position in a
> tablebuffer
> >
> > Sorry, I always tought "while select" was faster but just did a
> test and it doesn't seem so.
> >
> > Steeve...
> >
> >
> > -----Message d'origine-----
> > De : [email protected] [mailto:development-
> [EMAIL PROTECTED] De la part de densop1
> > Envoyé : 21 décembre 2005 04:01
> > À : [email protected]
> > Objet : Re: RE : [development-axapta] Reset position in a
> tablebuffer
> >
> > Yes "select ct" initialises the buffer again. But it doesn't
matter
> > if you uses "while select" or "next".
> >
> > Simon 
> >
> > --- In [email protected], "Steeve Gilbert"
> > <[EMAIL PROTECTED]> wrote:
> > >
> > > I would redo the "select ct;".  But you should be doing that
> > instead :
> > >
> > > While select ct {
> > >     info(ct.AccountNum);
> > > }
> > >
> > > Steeve...
> > >
> > >
> > > -----Message d'origine-----
> > > De : [email protected] [mailto:development-
> > [EMAIL PROTECTED] De la part de cdlmalherbe01
> > > Envoyé : 20 décembre 2005 06:02
> > > À : [email protected]
> > > Objet : [development-axapta] Reset position in a tablebuffer
> > >
> > > Hi all,
> > >
> > > An obvious question to the more experienced, but how does one
> > reset
> > > the cursor's position to the first record in a tablebuffer?
> > >
> > > Example
> > > ========
> > >
> > > CustTable ct;
> > >
> > > ;
> > >
> > > select ct;
> > >
> > > while (ct)
> > > {
> > >     info(ct.AccountNum);
> > >
> > >     next ct;
> > > }
> > >
> > > /*what call goes here to reset position of the cursor to the
> first
> > > record in the table buffer?*/
> > >
> > > while (ct)
> > > {
> > >     info(ct.Name);
> > >    
> > >     next ct;
> > > }
> > >
> > > Kind regards,
> > >
> > > Christoph
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > 
> > > Yahoo! Groups Links
> > >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > 
> > Yahoo! Groups Links
> >
> >
> >
> > 
> >
> >
> >
> >
> >
> >
> > 
> > Yahoo! Groups Links
> >
>










SPONSORED LINKS
Computer part Programming languages Microsoft axapta
Support exchange


YAHOO! GROUPS LINKS




Reply via email to