Hello Jose,
If you share some of the details of your "complex calculation," I think you
will discover that some of the folks on this helpful board are able to show
you how to precalculate many of the values that you then need to use in your
search criteria.
For example, say you want to find all invoices where the average value per
line exceeds $100. Let's say you have 50,000 invoice headers and >200K
invoice rows. It would be prohibitively expensive to run this query without
precalculation.
On the other hand, if you simply added a column to the invoice header table
that stores the average value per invoice line for the entire invoice, then
the query is not only fast, but completely trivial. You simply have to
perform the calculation in advance, whenever the invoice itself is written.
Clearly, this is an overly simplistic example, and it may not be anything
like the problem you are facing. On the other hand, without further
information, you leave folks like us to guess, and we cannot be completely
helpful.
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Jose" <discussions@avandis.co.ukwrote in message
news:1164659553.438745.267250@45g2000cws.googlegro ups.com...
Quote:
Hi All,
>
(I realise this isn't a specific dotnet question but I'm using dotnet
to implement it.)
>
I have a table of data that could run to about 50,000 rows. A user will
enter a some data in a web form and I need to return a paged set of
results depending on the value of the data. However I cannot process
this value in SQL I need to perform some complex calculations that can
only be done in code. My question is this, is there a better way than
returning all the rows (just the values I need not the entire row) run
the processing query and then display 10 records? It just seems a bad
way to get 10 records!!!
>
Thanks in advance for any suggestions.
>
Jose
>