Click here to Skip to main content
15,884,995 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
my application is not running due to server problem..
when I contact my hosting provider he send me following message..
so plz help me how to solve it... Is it solved by code side or any other solution??




utilizing more than 90% of MS SQL load and this cause the entire server to get down. As per our terms of service all the shared hosting accounts are allowed to utilize the maximum of 20% CPU load and that too should not exceed continuously for more than 90 seconds, and hence we suspended this domain for violating our terms of service and the detailed information of queries which took heavy load are as below for your reference,



select * from dbo.ril_fosacct

SELECT * FROM [dbo].[ril_fosacct] WHERE [createddate]<=@1

SELECT
SCHEMA_NAME(sp.schema_id) AS [Schema],
sp.name AS [Name],
CASE WHEN sp.type = N'P' THEN 1 WHEN sp.type = N'PC' THEN 2 ELSE 1 END AS [ImplementationType],
CAST(OBJECTPROPERTYEX(sp.object_id,N'ExecIsQuotedIdentOn') AS bit) AS [QuotedIdentifierStatus],
CAST(OBJECTPROPERTYEX(sp.object_id,N'ExecIsAnsiNullsOn') AS bit) AS [AnsiNullsStatus],
CAST(CASE WHEN ISNULL(smsp.definition, ssmsp.definition) IS NULL THEN 1 ELSE 0 END AS bit) AS [IsEncrypted],
NULL AS [Text],
CAST(
case
when sp.is_ms_shipped = 1 then 1
when (
select
major_id
from
sys.extended_properties
where
major_id = sp.object_id and
minor_id = 0 and
class = 1 and
name = N'microsoft_database_tools_support')
is not null then 1
else 0
end
AS bit) AS [IsSystemObject],
sp.object_id AS [ID],
CAST(ISNULL(spp.is_auto_executed,0) AS bit) AS [Startup],
ISNULL(smsp.definition, ssmsp.definition) AS [Definition]
FROM
sys.all_objects AS sp
LEFT OUTER JOIN sys.sql_modules AS smsp ON smsp.object_id = sp.object_id
LEFT OUTER JOIN sys.system_sql_modules AS ssmsp ON ssmsp.object_id = sp.object_id
LEFT OUTER JOIN sys.procedures AS spp ON spp.object_id = sp.object_id
WHERE
(sp.type = @_msparam_0 OR sp.type = @_msparam_1 OR sp.type=@_msparam_2)
ORDER BY
[Schema] ASC,[Name] ASC
Posted
Comments
Ankur\m/ 13-Mar-14 7:57am    
Clearly you need to optimize your SQL queries. And if you still have a high load, you may need better hardware contract.
heta.dave 13-Mar-14 8:43am    
how to optimize query?
plz let me know
Ankur\m/ 14-Mar-14 0:49am    
SQL optimization is a job in itself and there are consultants paid very high for this very purpose. That being said, there are guidelines and techniques which developers follow in order to write good performing queries. As Dave said start by Googling about query optimization techniques.

1 solution

You're going to have to break down this query and optimize it and possibly the tables you're query is touching.

You're doing a lost of casting and conversion or transforms of data, which is slowing down your queries. Casts have to happen on every single row in your result set.

You're also making a second query for each rows that satisfies a condition. That's a really big performance killer!
 
Share this answer
 
Comments
heta.dave 13-Mar-14 8:44am    
how to optimize query?
Dave Kreskowiak 13-Mar-14 9:27am    
That's where YOU optimize the query. I have no idea what your schema is. I have no idea what this query is supposed to do. I have no idea what data you have in the tables. I have no idea what your requirements are. I have no idea what the end result is supposed to be.

Why is it so hard to type "sql optimization techniques" into Google and start teaching yourself how to do it yourself? Learn to do it yourself and you won't be depending on other people to do it for you all the time!!

heta.dave 13-Mar-14 8:45am    
what is solution of problem?? because I not able to access any table or database..
AdamASPGeek 14-Mar-14 1:09am    
Please ask your provider to open the suspension first and then please kindly check what's wrong with your code. You need to optimize your SQL query. As if you consume high memory on the server, it will be impact to other client sites on that server too.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900