<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.us.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>23 Nov 2015 12:14:00 Z</lastBuildDate><pubDate>18 Nov 2015 12:09:00 Z</pubDate><description>Hello All&#13;
&#13;
I am trying to move from Classic to HFCS and from reading the forum I understand that Queries are the way to go instead of procedural code for extracting data, but having no experience with queries, I have to rely in the query generator and I fear that it is not that efficient.&#13;
&#13;
This query return 73 records out of a file of about 450,000 records&#13;
SELECT&#13;
Crtrans.CTCLEUNIK AS CTCLEUNIK,&#13;
Crtrans.ActualCost AS ActualCost,&#13;
Crtrans.JobCost AS JobCost,&#13;
FROM&#13;
Crtrans&#13;
WHERE&#13;
CRTrans.JCSourceCleunik IN&#13;
(&#13;
SELECT&#13;
CostCat.CACLEUNIK AS CACLEUNIK,&#13;
CostCat.BUCLEUNIK AS BUCLEUNIK,&#13;
CostCat.CodeOrder AS CodeOrder&#13;
FROM&#13;
CostCat&#13;
WHERE&#13;
CostCat.BUCLEUNIK = {pBUCleunik}&#13;
)&#13;
AND CRTrans.FinPeriod &lt;= {pFinperiod}&#13;
This query is then processed in a loop to get some additional info and the data goes into a memory table.&#13;
FOR EACH CRTransCAQry&#13;
&#13;
&#13;
This query returns about 6000 records from the same file&#13;
SELECT&#13;
Crtrans.CTCLEUNIK AS CTCLEUNIK,&#13;
Crtrans.ActualCost AS ActualCost,&#13;
Crtrans.JobCost AS JobCost,&#13;
FROM&#13;
Crtrans&#13;
WHERE&#13;
AND Crtrans.FinPeriod &lt;= {pFinPeriod}&#13;
AND Crtrans.JOCLEUNIK = {pJOCleunik}&#13;
&#13;
The results of this second query are also processed in the same method but with an additional test to isolate the same 73 records produced in the first query&#13;
FOR EACH CRTransCAQry&#13;
IF Position(CRTransCAQry.JCSourceCleunik,[62283,62284,62285,62286,62287,62288,62289,62290,]) &lt;&gt; 0&#13;
&#13;
&#13;
The second process on the 6,000 records is twice as fast as the first process, so there is obviously something not right in the first query&#13;
The query generator informs me that no further indexes are required to make it faster.&#13;
&#13;
Can anyone tell me if the first query can be made more efficient please&#13;
&#13;
Regards&#13;
Al</description><ttl>30</ttl><generator>WEBDEV</generator><language>en_US</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please/read.awp</link><title>[WD19]   Help with a slow query please</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55089/read.awp</comments><pubDate>23 Nov 2015 12:14:00 Z</pubDate><description>Allard&#13;
By 'Lost' I meant that as the query is part of the control in which is was written is is unavailable for use anywhere el…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55089/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55089/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please/read.awp">[WD19]   Help with a slow query please</source><title>Re: [WD19]   Help with a slow query please</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55088/read.awp</comments><pubDate>23 Nov 2015 10:40:00 Z</pubDate><description>Arie&#13;
Thankfully I have not had an issue when sending parameters as part of hExecuteQuery as normally WD pops up a window with t…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55088/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55088/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please/read.awp">[WD19]   Help with a slow query please</source><title>Re: [WD19]   Help with a slow query please</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55086/read.awp</comments><pubDate>23 Nov 2015 08:27:00 Z</pubDate><description>Well Derrek,&#13;
I do use queries ( internal ) and just call them with mysource.parameter. Put it in the init code of say a table a…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55086/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55086/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please/read.awp">[WD19]   Help with a slow query please</source><title>Re: [WD19]   Help with a slow query please</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55085/read.awp</comments><pubDate>23 Nov 2015 08:22:00 Z</pubDate><description>Derek,&#13;
&#13;
there is some risk in using using hExecuteQuery and fill in the params directly.&#13;
I've seen queries changed by WD with…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55085/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55085/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please/read.awp">[WD19]   Help with a slow query please</source><title>Re: [WD19]   Help with a slow query please</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55082/read.awp</comments><pubDate>22 Nov 2015 20:54:00 Z</pubDate><description>Hello Derek&#13;
&#13;
Thanks for the additional info.&#13;
I use HFreeQuery before running the query as a way of making the all parameters …</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55082/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55082/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please/read.awp">[WD19]   Help with a slow query please</source><title>Re: [WD19]   Help with a slow query please</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55075/read.awp</comments><pubDate>21 Nov 2015 12:01:00 Z</pubDate><description>Hi Al&#13;
&#13;
I also use the same queries multiple times within my applications.&#13;
I do however have similar queries depending on the …</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55075/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55075/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please/read.awp">[WD19]   Help with a slow query please</source><title>Re: [WD19]   Help with a slow query please</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55074/read.awp</comments><pubDate>21 Nov 2015 10:40:00 Z</pubDate><description>Hello Allard&#13;
&#13;
Thanks for the followup info.&#13;
I don't have any MDI windows but I do have some opensister() and openchild() wind…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55074/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55074/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please/read.awp">[WD19]   Help with a slow query please</source><title>Re: [WD19]   Help with a slow query please</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55073/read.awp</comments><pubDate>21 Nov 2015 09:40:00 Z</pubDate><description>Hi All,&#13;
&#13;
First let me state that Iam not an expert. Far form it. I learned programming with Windev. and went from there. . So …</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55073/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55073/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please/read.awp">[WD19]   Help with a slow query please</source><title>Re: [WD19]   Help with a slow query please</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55072/read.awp</comments><pubDate>21 Nov 2015 00:54:00 Z</pubDate><description>Hello Allard&#13;
&#13;
Can you give some more information on the problems you see in using a query multiple times please.&#13;
&#13;
I tend to …</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55072/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55072/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please/read.awp">[WD19]   Help with a slow query please</source><title>Re: [WD19]   Help with a slow query please</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55051/read.awp</comments><pubDate>19 Nov 2015 14:25:00 Z</pubDate><description>Hi Al,&#13;
&#13;
I use queries a lot and they work great. However I had some problems with using queries. That was when I used the same…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55051/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55051/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please/read.awp">[WD19]   Help with a slow query please</source><title>Re: [WD19]   Help with a slow query please</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55049/read.awp</comments><pubDate>19 Nov 2015 13:37:00 Z</pubDate><description>Hello Allard&#13;
&#13;
Thanks for the confirmation on the method.&#13;
I agree about the query writer, it is quite easy to use, I just have…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55049/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55049/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please/read.awp">[WD19]   Help with a slow query please</source><title>Re: [WD19]   Help with a slow query please</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55048/read.awp</comments><pubDate>19 Nov 2015 13:24:00 Z</pubDate><description>Hi Al&#13;
&#13;
Yes that is the way to go. Parameter is in the list. I use it all the time.&#13;
The querie builder works great for me . I …</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55048/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55048/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please/read.awp">[WD19]   Help with a slow query please</source><title>Re: [WD19]   Help with a slow query please</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55042/read.awp</comments><pubDate>19 Nov 2015 07:19:00 Z</pubDate><description>Hello Jose&#13;
&#13;
I don't understand the query either, but it is what the generator program produced. However your comment about the…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55042/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55042/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please/read.awp">[WD19]   Help with a slow query please</source><title>Re: [WD19]   Help with a slow query please</title></item><item><author>ccordes</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55040/read.awp</comments><pubDate>19 Nov 2015 01:56:24 Z</pubDate><description>Al a écrit : &#13;
&gt; Hello All&#13;
&gt; &#13;
&gt; I am trying to move from Classic to HFCS and from reading the forum I understand that Queries …</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55040/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55040/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please/read.awp">[WD19]   Help with a slow query please</source><title>Re: [WD19]   Help with a slow query please</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55038/read.awp</comments><pubDate>18 Nov 2015 19:28:00 Z</pubDate><description>Well, I never use IN but JOIN.&#13;
The SUB SELECT is executed for each row of the main SELECT, so it's executed 6000 times, and may…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55038/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please-55038/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/55027-wd19-help-with-slow-query-please/read.awp">[WD19]   Help with a slow query please</source><title>Re: [WD19]   Help with a slow query please</title></item></channel></rss>
