Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 5 Jahren, 1 Monat
Letzter Beitrag:
vor 5 Jahren, 1 Monat
Beteiligte Autoren:
wbd, Peter Holemans, ICI, Fabrice Harari

Query's on HFCS

Startbeitrag von wbd am 29.05.2013 11:48


I was asking myself...

When you have HFCS and you run a query from the client, on wich place is the query data present.
Is it in memory on the HFCS server or in the memory on the clientmachine.

I did a test.
- make connection with HFCS
- run a qry from the clientmachine.
- place the qrydata in a memory table on my screen. (> 10.000 lines)
- Close the connection with 'CloseConnection'
- place the qrydata in a memory table on my screen. (> 0 lines)

After closing the connection i have 0 lines in the memorytable...but i did not empty the qry result ?
Is the qry result on the HFCS server or on the clientmachine ??

I think on the HFCS ???

Who can tell ?




Depend on location where you put and execute your query I think.
I think you ask about query's not created and saved into analisys but on "standard" way.

If you create your query on client pc, query ask server for data and transfer answer on your client pc. So, data need to be on your client pc. You can investigate and try little with :
gctMyConnection..CursorOptions = hServerCursor+hDynamicCursor+hPessimisticCursor
hClientCursor (Maybe here can be an answer for you)

But, this is just my opinion .

von ICI - am 29.05.2013 11:58
Hello Harry

to answer your first question, the answer is both:
- when you run a query, the dataset is first on the server, where it is read/created
- then you access the query data, and the dataset is transferred completely on the client

The problem with your test, AFAIK, is the following: You do a hCloseConnexion. As the help file states for this function: """All the data files that use this connection are closed."""

What you are missing, in my opinion, is the fact that a QUERY is a FILE, created on the fly with specific requirements, but still a file (and therefore, you can by example do a query on the result of a query)... But if a query is a file, then it's going to be closed by the the hCloseConnexion along with all the static files of the DB, which explains while afterward your dataset is empty

Best regards

von Fabrice Harari - am 29.05.2013 12:37
Hello Fabrice,

OK might be.. I just saw it in the helpfile about disconnecting..

We are working with HFCS and have now about 1500 connections..
There is a lot a data going from the HFCS to the client and v.v.. (with qry)
After 3 a 4 hours the performance is poor...

When we disconnect all users the performance is still poor...
The use of memory is not going down..
The only way to get performance better is restarting the database..

Any idea ?

Regards Harry

von wbd - am 29.05.2013 12:56
Hi Harry,

Do you do a hFreeQuery() when you don't need it anymore?
This will free all resources used by a query.

On the other hand, I have the impression on your code snippet that you are using a lot of client grids (tables) linked directly to HFCS queries. I might be wrong here but in my experience doing so eats a lot of resources as (at least that is my assumption) the record pointers and datasets are synchronised between client and server causing a lot of C/S traffic. Transforming your grids into memory tables solves this (also based on experience) as you execute the query on the server, move the result over to the client, transfer it into a memory table and next free all query resources on the server and on the client (using hFreeQuery()).

Just my 2 cents,

Peter H.

von Peter Holemans - am 29.05.2013 13:19
Hello Peter,

We don't use file tables or qry tables only memory table...
And yes, we do use hFreeQuery..

My code snippet was juist a small example for testing..

Thanks in anyway..

Regards Harry

von wbd - am 29.05.2013 13:27
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.