Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
12
Erster Beitrag:
vor 8 Jahren, 6 Monaten
Letzter Beitrag:
vor 8 Jahren, 6 Monaten
Beteiligte Autoren:
Louis Verbraak, Fabrice Harari, Arie, Fabrice Harari.pcs.crosspost

[WD12] HReadFirst after HExecuteSQLQuery

Startbeitrag von Louis Verbraak am 15.06.2009 09:32

Hello to you all,

After I execute a query with HExecuteSQLQuery, and I know the result is just one (or 2) records. The first time I read something from the result (HReadFirst or HNbRec) it takes about 1 second to get a result. Can anybody tell me why this takes so long?

Antworten:

Hello,

It only takes that long when I use HFCS?!

Can't anybody tell me why the HReadFirst is time-consuming when I use HFCS? Is there something I can do? I thought there is no difference in the created data source by HExecuteSQLQuery() when using HF or HFCS?

von Louis Verbraak - am 15.06.2009 10:07
Hello,

Is the view (HCreateView instead of HExecuteSQLQuery) the way to go?

von Louis Verbraak - am 15.06.2009 15:39
Hi Louis...

if I'm not mistaken, the query itself is executed only the first time
you read something... The fact that it take so long is probably due to
missing keys in the file to allow an optimized access, but without more
information on the query, it's hard to be sure


Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

More information on http://www.fabriceharari.com


Louis Verbraak wrote:
> Hello to you all,
> After I execute a query with HExecuteSQLQuery, and I know the result is just one (or 2) records. The first time I read something from the result (HReadFirst or HNbRec) it takes about 1 second to get a result. Can anybody tell me why this takes so long?
>
Message forwarded from pcsoft.us.windev

von Fabrice Harari.pcs.crosspost - am 15.06.2009 15:59
Hello Fabrice,

Here is the query I'm talking about:

[quote=
lsSQL="SELECT SUM(TelOpenstaandBedrag) AS Bedrag FROM HF_ADM_Transacties WHERE SorteerveldFactuur='"+lsSorteerveldFactuur+"'"
lsSQL+=" AND Sorteerveld'"+lsSorteerveldFactuur+"'"
// Alleen de gevraagde periodes meetellen.
lsSQL+=" AND (BoekjaarGeboekt

von Louis Verbraak - am 15.06.2009 16:45
Hi Louis...

Not knowing the content of your file (and the variable names do not help me a lot here :-) ), I would say that you need a composite key with the following variables in it, in that order:

SorteerveldFactuur + Sorteerveld + lsSubAdm + BoekjaarGeboekt + PeriodeGeboekt

If you don't have one, create it and test again, as this key should allow the engine to find the desired records extremely fast

best regards



von Fabrice Harari - am 15.06.2009 17:53
Hello Fabrice,

Thanks for your suggestion. I'll try that.

When this is the problem I suppose I need to create a composite key for every combination a record must been found.

Is it neccesary that every part of a composite key is a key for itself?

von Louis Verbraak - am 15.06.2009 18:12
Louis,
I noticed that the operators < and

von Arie - am 15.06.2009 18:28
Hi again...

not necessary at all... You need a composite key containing all the variables of the "=" conditions of your query then the ">=" ones, but each variable doesn't need to be a key.

If you use the query editor included in windev, it will automatically propose the appropriate composite key to add for you

best regards



von Fabrice Harari - am 15.06.2009 18:35

Re: [WD12] HReadFirst after HExecuteSQLQuery - THANKS

Hello Fabrice,

Thanks again.

von Louis Verbraak - am 15.06.2009 18:38

Re: [WD12] HReadFirst after HExecuteSQLQuery - THANKS

Hello Arie,

Thanks for your input. But creating the propriate composite key seems to work well in my case.

von Louis Verbraak - am 15.06.2009 18:41

Re: [WD12] HReadFirst after HExecuteSQLQuery - THANKS

Hi again...

I must say that I personally have never seen a case where creating the appropriate composite key DIDN'T work... As long of course as an optimized file reading is POSSIBLE (contains in conditions is a case where it's not possible, by example)

best regards


von Fabrice Harari - am 15.06.2009 20:48
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.