How could I improve performace of queries which are generated runt

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using .NET Framework 1.1 on a windows server machine.
I am creating a .NET web application where
I will ask user to select parameters and a query will be generated
dynamically, this query will then be passed to the database server for
retrieval of data.
I this scenario there can be around 50 users who are requesting the
information according to their need; so the query for each of them can be
same or different,
In short I want to save these queries for future use.

I feel that in this scenario some caching could help, but I am not sure how.

We can also store these queries somewhere and by using some statistical
information so that we can retrieve these stored queries in future if the
same query is to be fired, but I dont know how.

If anybody have any better way to achieve this please let me know.
 
Vikas,
In short I want to save these queries for future use.
Than you only place is a persistent place even with power down. And that is
than a database.

Just my thought,

Cor
 
Inline..

--

Vikas Rathod said:
I am using .NET Framework 1.1 on a windows server machine.
I am creating a .NET web application where
I will ask user to select parameters and a query will be generated
dynamically, this query will then be passed to the database server for
retrieval of data.
I this scenario there can be around 50 users who are requesting the
information according to their need; so the query for each of them can be
same or different,
In short I want to save these queries for future use.

Dou you mean keep the resultst in memory ? you'll havr to take into account
possible changes to refresh the data. Also you'll have first to check what
is the chance that two users are requesting the exact same info.
I feel that in this scenario some caching could help, but I am not sure how.

We can also store these queries somewhere and by using some statistical
information so that we can retrieve these stored queries in future if the
same query is to be fired, but I dont know how.

Some DBMS are able to reuse queries plans if this is what you meant.
If anybody have any better way to achieve this please let me know.

Did you actually have a problem ? The first step would be to check current
performance to see if it's acceptable or not. You could also just measure
for now how many unique request are sent to the server to sse if it's worth
caching...

Patrice
 
Vikas,

To add to this when you want to use it, you can as well create a shared
class (those belong to all users). With something as (in a kind of pseudo
code, I dont know what you use)

Class MyQueries
Shared/Static Sub
dataset -> myDataset
If mydataset is nothing
mydataset = getdatasetfromdatabase

And use that than as
MyQueries.mydataset

This lives as long as there are still users who are not yet timed out or
closed the session.

I hope this helps,

Cor
 
Hi Cor,

Thanks for reply.
Actually I want to save those queries into cache, in some format
so that when any client requests for some data then it would be
availabe.
I want to create something like stored procedures which will be
there in cache and after getting some statistics from client respective
procedure will be called, but i dont want to store it as text I want to
store it in parsed format how could I do that?
 
Vikas

I don't see what this has to do with a stored procedure. However for me is
the most sufficient for this just the session.item

session.item(mydata1) = "Whatever"

That you can use between post and postback and belongs to the client.
That does the viewstate as well, however cost sending time.

The cache and the shared procedure needs a lot more information and
processing, because they are for all users. Therefore you have to find in
that procedure to which user it belong. However it is very usefull by
instance for an list of article names which are not changed by the clients..

I hope this gives an idea.

Cor
 
Back
Top