Is there a way to optimize this BAQ query? It gets slow for lon

You got it! That was the problem. Thanks for the great advice!


--- In vantage@yahoogroups.com, "Chris Robisch" <bluewine@...> wrote:
>
> You forgot the Company for JobAsmbl. Insert it before the JobNum.
>
> ----- Original Message -----
> From: sh4m4n71x
> To: vantage@yahoogroups.com
> Sent: Thursday, June 04, 2009 6:11 AM
> Subject: [Vantage] Re: Is there a way to optimize this BAQ query?? It gets slow for long date ranges
>
>
>
>
>
> I used PayRollDate originally but swapped it with ClockInDate to see if anything would change. The speed is exacly the same.
>
> --- In vantage@yahoogroups.com, "Chris Robisch" <bluewine@> wrote:
> >
> > For LaborHed, use PayrollDate instead of ClockInDate, as in index paydate: +Company +PayrollDate.
> >
> > ----- Original Message -----
> > From: sh4m4n71x
> > To: vantage@yahoogroups.com
> > Sent: Thursday, June 04, 2009 5:28 AM
> > Subject: [Vantage] Is there a way to optimize this BAQ query?? It gets slow for long date ranges
> >
> >
> >
> >
> >
> > I moved the date range to the top, but it didn't seem to improve speed.
> >
> > for each LaborHed Where LaborHed.Company = cur-comp
> > and LaborHed.ClockInDate >= 5/1/2009
> > and LaborHed.ClockInDate <= 5/31/2009 no-lock,
> > each empbasic where empbasic.company = laborhed.company
> > and empbasic.empid = laborhed.employeenum no-lock,
> > each labordtl where labordtl.company = laborhed.company
> > and labordtl.laborhedseq = laborhed.laborhedseq no-lock,
> > each jobasmbl where jobasmbl.jobnum = labordtl.jobnum
> > and jobasmbl.assemblyseq = labordtl.assemblyseq no-lock,
> > each wrkcenter where wrkcenter.company = labordtl.company
> > and wrkcenter.wccode = labordtl.wccode no-lock
> >
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
I moved the date range to the top, but it didn't seem to improve speed.

for each LaborHed Where LaborHed.Company = cur-comp
and LaborHed.ClockInDate >= 5/1/2009
and LaborHed.ClockInDate <= 5/31/2009 no-lock,
each empbasic where empbasic.company = laborhed.company
and empbasic.empid = laborhed.employeenum no-lock,
each labordtl where labordtl.company = laborhed.company
and labordtl.laborhedseq = laborhed.laborhedseq no-lock,
each jobasmbl where jobasmbl.jobnum = labordtl.jobnum
and jobasmbl.assemblyseq = labordtl.assemblyseq no-lock,
each wrkcenter where wrkcenter.company = labordtl.company
and wrkcenter.wccode = labordtl.wccode no-lock
For LaborHed, use PayrollDate instead of ClockInDate, as in index paydate: +Company +PayrollDate.

----- Original Message -----
From: sh4m4n71x
To: vantage@yahoogroups.com
Sent: Thursday, June 04, 2009 5:28 AM
Subject: [Vantage] Is there a way to optimize this BAQ query?? It gets slow for long date ranges





I moved the date range to the top, but it didn't seem to improve speed.

for each LaborHed Where LaborHed.Company = cur-comp
and LaborHed.ClockInDate >= 5/1/2009
and LaborHed.ClockInDate <= 5/31/2009 no-lock,
each empbasic where empbasic.company = laborhed.company
and empbasic.empid = laborhed.employeenum no-lock,
each labordtl where labordtl.company = laborhed.company
and labordtl.laborhedseq = laborhed.laborhedseq no-lock,
each jobasmbl where jobasmbl.jobnum = labordtl.jobnum
and jobasmbl.assemblyseq = labordtl.assemblyseq no-lock,
each wrkcenter where wrkcenter.company = labordtl.company
and wrkcenter.wccode = labordtl.wccode no-lock





[Non-text portions of this message have been removed]
I used PayRollDate originally but swapped it with ClockInDate to see if anything would change. The speed is exacly the same.

--- In vantage@yahoogroups.com, "Chris Robisch" <bluewine@...> wrote:
>
> For LaborHed, use PayrollDate instead of ClockInDate, as in index paydate: +Company +PayrollDate.
>
> ----- Original Message -----
> From: sh4m4n71x
> To: vantage@yahoogroups.com
> Sent: Thursday, June 04, 2009 5:28 AM
> Subject: [Vantage] Is there a way to optimize this BAQ query?? It gets slow for long date ranges
>
>
>
>
>
> I moved the date range to the top, but it didn't seem to improve speed.
>
> for each LaborHed Where LaborHed.Company = cur-comp
> and LaborHed.ClockInDate >= 5/1/2009
> and LaborHed.ClockInDate <= 5/31/2009 no-lock,
> each empbasic where empbasic.company = laborhed.company
> and empbasic.empid = laborhed.employeenum no-lock,
> each labordtl where labordtl.company = laborhed.company
> and labordtl.laborhedseq = laborhed.laborhedseq no-lock,
> each jobasmbl where jobasmbl.jobnum = labordtl.jobnum
> and jobasmbl.assemblyseq = labordtl.assemblyseq no-lock,
> each wrkcenter where wrkcenter.company = labordtl.company
> and wrkcenter.wccode = labordtl.wccode no-lock
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
You forgot the Company for JobAsmbl. Insert it before the JobNum.

----- Original Message -----
From: sh4m4n71x
To: vantage@yahoogroups.com
Sent: Thursday, June 04, 2009 6:11 AM
Subject: [Vantage] Re: Is there a way to optimize this BAQ query?? It gets slow for long date ranges





I used PayRollDate originally but swapped it with ClockInDate to see if anything would change. The speed is exacly the same.

--- In vantage@yahoogroups.com, "Chris Robisch" <bluewine@...> wrote:
>
> For LaborHed, use PayrollDate instead of ClockInDate, as in index paydate: +Company +PayrollDate.
>
> ----- Original Message -----
> From: sh4m4n71x
> To: vantage@yahoogroups.com
> Sent: Thursday, June 04, 2009 5:28 AM
> Subject: [Vantage] Is there a way to optimize this BAQ query?? It gets slow for long date ranges
>
>
>
>
>
> I moved the date range to the top, but it didn't seem to improve speed.
>
> for each LaborHed Where LaborHed.Company = cur-comp
> and LaborHed.ClockInDate >= 5/1/2009
> and LaborHed.ClockInDate <= 5/31/2009 no-lock,
> each empbasic where empbasic.company = laborhed.company
> and empbasic.empid = laborhed.employeenum no-lock,
> each labordtl where labordtl.company = laborhed.company
> and labordtl.laborhedseq = laborhed.laborhedseq no-lock,
> each jobasmbl where jobasmbl.jobnum = labordtl.jobnum
> and jobasmbl.assemblyseq = labordtl.assemblyseq no-lock,
> each wrkcenter where wrkcenter.company = labordtl.company
> and wrkcenter.wccode = labordtl.wccode no-lock
>
>
>
>
>
> [Non-text portions of this message have been removed]
>





[Non-text portions of this message have been removed]