It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
Actually i have an web application where i have a form which takes data from MYSQL database where i have written an Sp to get the data from DataBase(compares 100.000 records and gives 40,000 of records as output) and bind it to Gridview. At the very first time it takes 15 mins to debug and den for second time(reload) it takes approx.1-2 hours(while i call the same SP in MYSQL DB it takes ~8 mins) Can any one please help me.
You are not going to show 40,000 records at once. You need to implement SP level pagination.
CREATE PROCEDURE OrdersByStatus(
IN orderStatus VARCHAR(25),
IN start INT, IN size, OUT total INT)
BEGIN
SELECT count(orderNumber)
INTO total
FROM orders
WHERE status = orderStatus;
SELECT *
FROM orders
WHERE status = orderStatus
LIMIT start, (start + size);
END$$
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I am planning a "statistics" page for a university project where lots of factoids will be displayed based on data from my Access database.
The statistics will be displayed in text format like so:
23% of drinkers enjoyed Life of Pi whilst only 15% of non-drinkers like it.
65% of teachers have read Othello by William Shakespeare whilst only 40% of policemen have read it.
[I have bolded the values I know how to retrieve in an SQL statement, and have italicized the percentages which I don't know how to compute]
User details include Boolean values such as smoker:yes/no or drinker:yes/no as well as the user's profession (there will be a limited number of professions listed in a combobox). These are all stored in a table called 'userprofiles'
I have a separate table called 'booklist' that stores the names,authors,title etc of books as well as a table called 'booklikejunction' where the likes for each book are recorded as well as the user's current User.Identity.Name
What would my SQL statement look like? And how would I display the results of my query in the format I have outlined above?
Just a hint (using ms-access SQL syntax):
select sum(iif([field1]='drinker',1,0)) / count([field1])
from [tbl_questions]
where ...
Not the cleanest way to do it, but it works
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
how can I get how many people registered to my website?
in ASP.NET
You're not going to get much better then incrementing in Session_Start and decrementing in Session_End unless you use some other means such as a database.
When you are authenticating your requests you could update a timestamp in the database to show that the user has been active, and after a given time (say 10-15 minutes), the query thatcollects the number of current users ignores that row in the database (thus decrementing the count).
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Forget the other details of the DataSet vs DataReader argument and tell me factually whether using the DataSet saves you from creating as many database queries as the DataReader does?
In my experience, it is clear that using the DataReader requires more database queries than using a DataSet. With the DataSet you can create one query (or stored procedure), disconnect, and then simply query the DataSet, leaving less back-and-forth to the database.
So factually, is the statement true that a DataReader creates more database traffic than a DataSet given the same scenario of cause.
A DataSet uses a DataReader to populate itself.
So the answer is no, a DataReader does not create more database traffic. It is the developer's understanding and usage (or mis-usage) that would create more database traffic.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
well i have a table my boss has made... they are 2 tables..
first where products are going to be has
(table A)
idinvoice (since table B)
idpruduct
description (it is the name of product)
quantity
unitPrice
TotalPrice
another table (i am going to call it table B)
idinvoice
date
deadline
type
idclient
saler (i consider it is sooo bad)
street
transport
status
Total
why do i believe it is bad?
because first the client is going to choose the product (but it doesn't have a idinvoice)
i have never made something as this, only on windows form, but i have never built a online point sale,
how tables do you believe I must to have? (what columns)
You need three tables. They might be something like:
Product: idpruduct, description (it is the name of product), unitPrice
Client: idclient, street
Invoice: idinvoice, idclient, saler, plus everything else related to a shipment or sale of one or more products.
You might also want:
Saler, or salesman: name, idnumber (perhaps idclient, too)
Does this sound close to correct, to start with?
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I have stock market application which will be frequently used by millions of members at a time.
What could be the best option to retrieve data from my database based on the retrieval time and Database load - DataReader or DataSet?
If you will have a large amount of people reading the data, then you should use the DataReader paradigm. This way you can quickly get in and out with the trouble of schema inference. I would also recommend that once you pull the data from the server that you cache it. Even if it is only cached for 1 second, that will improve the number of connections from the database that will retrieve the same data. Otherwise, you could quickly saturate your connection pool if you are not careful as well as some possible locking.