Why the Execution time for Same SQL Query varies? [closed] - sql-server

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I am executing a stored procedure on my machine in SSMS and database is located on Server.
The stored procedure works properly, but every time it takes different time to execute even if all parameters are the same. Execution time varies from 1 minutes to 8 minute. I am not able to find reason for this and I am not using any DBCC command in between.
Please share your thoughts on this

Multiple possible reasons.
Slow disk, too little RAM - other operations load different data to cache
Corrupted disk - sometimes read operations delay
Heavy CPU usage in your procedure - other processes eat CPU away
Locking problems - other operations lock required tables sometimes

Related

Database decision - Cassandra or PostGres [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I'm trying to determine wether or not to use PostGres or Cassandra data store. Data will be inserted to this new store initially via :
1. A batch process to insert 100MB per day.
2. At a later point the existing batch process + CRUD operations at a rate of 20 operations per second.
From reading articles & various conversations with other I have determined:
**Cassandra**
Type: NoSql
Read Speed: Fast
Write Speed: Slow
Storage: Distributed Cluster
Scaling: Horizontal
**PostGres**
Type: Relational
Storage: Single Instance
Scaling: Horizontal
Some resources I have been reading :
https://www.quora.com/How-do-you-compare-Postgres-to-Cassandra-for-big-data-application
https://www.quora.com/How-do-you-approach-choosing-a-database-architecture-and-design
https://www.thegeekstuff.com/2014/01/sql-vs-nosql-db/?utm_source=tuicool
What other considerations should be taken before making the decision ? Are there other data points I should include in the decision process such as determining the expected number reads, writes, updates, deletes from the table ?
I could utilize PostGres and then migrate to Cassandra at some other point but would prefer to avoid the overhead of a DB migration process.
I work with postgres, because it is more customizable for developers and it is a nosql database combined with the most beautiful parts with sql db.

How to check blocking id's in sybase query execution , [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I am running some update scripts in a server. Normally that will run in 20 - 30 mins. But today its taking very long time , more than 2 hrs. Will there be any block , can anyone help me how to identify the process running in tat server, and why it is running slow.
sp_who will show you the processes running on your system, the status of each process, and the spid for any blocking processes (along with other information).
You can also use sp_who USERNAME to show the processes from a specific user.
If you wan't more detailed information about what is going on in your server while you are running your query, you can use sp_sysmon to give you detailed statistics about the various actions (reads, writes, cache hits, network reads, disk access, etc.)
sp_sysmon syntax
Performance and Tuning using sp_sysmon

MS SQL Express - Memory limitation vs. web application [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have web application that will be similar to forums. I plan to have few thousands+ users on this application, and i wonder if i can use MS SQL Express - here is the list of it's limitations:
Despite the cpu usage, i wonder if this 1 GB of memory usage is enough. Can anyone tell me if this might be enough, or maybe give me some examples when this 1 GB would be enough.
I think it should be fine. Depending on how many columns you have in each row and their types, you should be able to get at least 1 million rows into 1GB of disk space. The database will only load as much of that table as it needs in memory. If it reaches its memory limit it will start paging.
If you are using SQL 2008 R2, then the actual database can only grow up to 10GB which is the real limit you should be concerned about.
In our database, our tables that are around 1GB contain about 4 million rows. We have 2 databases that are 50GB and the one takes up 16GB of RAM and the other 2GB. So it depends on how often and which tables are accessed.

Sql Server performance [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I know that I can't get a specific answer to my question, but I would like to know if I can find the tools to get to my answer.
Ok we have a Sql Server 2008 database that for the last 4 days has had moments where for 5-20 minutes becomes unresponsive for specific queries.
e.g. The following queries run in different query windows simultaneously have the following results
SELECT * FROM Assignment --hangs indefinitely
SELECT * FROM Invoice -- works fine
Many of the tables have non-clustered indexes to help speed up SELECTs
Here's what I know:
1) The same query will either hang indefinitely or run normally.
2) In Activity Monitor in the processes tab there are normally around 80-100 processes running
I think that what's happening is
1) A user updates a table
2) This causes one or more indexes to get updated
3) Another user issues a select while the index is updating
Is there a way I can figure out why at a specific moment in time SQL Server is being unresponsive for a specific query?
The sp_who system stored procedure will tell you if a connection is blocked because of another query.
When a query (such as your examples) hangs, the most common cause (in my experience) is that another query is blocking it. This might be apparent.
To diagnose this, I simply uses Activity Monitor in Sql server Management Studio.
Find the node that is being blocked and through that, you can find what is causing the block. Then at least you isolate the problem. The next step is to prevent the blocking... That will certainly depend.
For me, it's been a long running BEGIN TRAN contents.

Memory Usage in SQL Server [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
What are the most memory consuming reasons in SQL SERVER 2005?
The SQL Rocks article Memory Use in SQL Server will probably answer your question.
I think this is one of the important parts:
SQL Server's caching behavior is the
reason for the substantial memory use.
This is by design and is not a bug,
memory leak nor incorrect
configuration. Every time
SQL Server needs to read a page from
disk it caches the page in memory so
that the slow disk operation will be
unnecessary should SQL Server need
that page again. Every time SQL Server
needs to read a page from disk it
caches the page in memory so that the
slow disk operation will be
unnecessary SQL Server should need
that page again.
SQL Server is just memory hungry. The more memory you give it, the more it will use. SQL Server should probably always be run on its own server if it is doing anything non-trivial. In other words, don't install SQL Server on your domain controller, file server or source control repository (unless your source control repository uses SQL Server).
Buffer pool for mainly data, plans, locks
Can you add some background please?

Resources