Showing posts with label t-sql. Show all posts
Showing posts with label t-sql. Show all posts

Monday, March 26, 2012

Hints in T-SQL (SQL Server 2000)

Hello,
I want the help on the SQL Server HINTS. In Oracel we use the hints in the following manner:
SELECT /*+ ORDERED use_nl(EMPLOYEE_RECORD_MGR)*/
Similarly, i found the help on SQL Server HINTS. They are used with the Keyword 'OPTION' at the end of SELECT statement.
Here i want to know more about the hints. In specific, i would like to know about the 'OPTION (FORCE ORDER)' hint in sql server.
If any one if you have any idea regarding this then do let me.
Thanking all of u in advance.
Aparna,
Still migrating things? SQL Server uses a cost based
optimizer and it's generally better to let SQL Server figure
out the most efficient plans. In general, you don't see
hints being used in SQL Server to the same degree they are
used in Oracle. For the most part, you'd want to have a good
specific reason for using them in SQL Server. I've seen
cases where hints being used actually hurt performance more
than helped. Have you come up with something specific on the
execution of a query that you'd want to use this?
-Sue
On Mon, 12 Apr 2004 21:36:04 -0700, Aparna
<aparna.shirodkar@.lycos.com> wrote:

>Hello,
>I want the help on the SQL Server HINTS. In Oracel we use the hints in the following manner:
>SELECT /*+ ORDERED use_nl(EMPLOYEE_RECORD_MGR)*/
>Similarly, i found the help on SQL Server HINTS. They are used with the Keyword 'OPTION' at the end of SELECT statement.
>Here i want to know more about the hints. In specific, i would like to know about the 'OPTION (FORCE ORDER)' hint in sql server.
>If any one if you have any idea regarding this then do let me.
>Thanking all of u in advance.

Hints in T-SQL (SQL Server 2000)

Hello,
I want the help on the SQL Server HINTS. In Oracel we use the hints in the f
ollowing manner:
SELECT /*+ ORDERED use_nl(EMPLOYEE_RECORD_MGR)*/
Similarly, i found the help on SQL Server HINTS. They are used with the Keyw
ord 'OPTION' at the end of SELECT statement.
Here i want to know more about the hints. In specific, i would like to know
about the 'OPTION (FORCE ORDER)' hint in sql server.
If any one if you have any idea regarding this then do let me.
Thanking all of u in advance.Aparna,
Still migrating things? SQL Server uses a cost based
optimizer and it's generally better to let SQL Server figure
out the most efficient plans. In general, you don't see
hints being used in SQL Server to the same degree they are
used in Oracle. For the most part, you'd want to have a good
specific reason for using them in SQL Server. I've seen
cases where hints being used actually hurt performance more
than helped. Have you come up with something specific on the
execution of a query that you'd want to use this?
-Sue
On Mon, 12 Apr 2004 21:36:04 -0700, Aparna
<aparna.shirodkar@.lycos.com> wrote:

>Hello,
>I want the help on the SQL Server HINTS. In Oracel we use the hints in the
following manner:
>SELECT /*+ ORDERED use_nl(EMPLOYEE_RECORD_MGR)*/
>Similarly, i found the help on SQL Server HINTS. They are used with the Key
word 'OPTION' at the end of SELECT statement.
>Here i want to know more about the hints. In specific, i would like to know
about the 'OPTION (FORCE ORDER)' hint in sql server.
>If any one if you have any idea regarding this then do let me.
>Thanking all of u in advance.sql

Monday, March 19, 2012

High CPU utilization

The CPU utilization on one of the servers is always around 50%, sometimes
it went to 100%, I turned on Profiler, did not find T-SQL statement using
long CPU time. Also check sp_who2 and find msdb is the most CPU user, the cumulated CPU time is 2742463. There were no other jobs running, just sqlserver agent-alert, which is default How to find the top cpu users? Thanks
Hi,
Can you check the taskmanager and confirm SQLSERVR.EXE is using more CPU? IF
SQL Server then
analyze the each connections connected to server using sp_who, sp_who2 and
dbcc inputbuffer commands.
You can try stopping the SQLSERVERAGENT service as well.
Thanks
Hari
MCDBA
"lhse" <lhse@.discussions.microsoft.com> wrote in message
news:A8BBBC49-4647-4206-B515-B4904E7553A2@.microsoft.com...
> The CPU utilization on one of the servers is always around 50%, sometimes
> it went to 100%, I turned on Profiler, did not find T-SQL statement using
> long CPU time. Also check sp_who2 and find msdb is the most CPU user, the
cumulated CPU time is 2742463. There were no other jobs running, just
sqlserver agent-alert, which is default How to find the top cpu users?
Thanks
>
|||You can run profiler and sort by cpu.. You can also insert the profiler data
into a SQL table and start doing select group by user, app, etc to find the
largest CPU user..
Remember that other maintenance type things go on, like checkpoint, lazy
writer, etc which can use CPU as well.
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"lhse" <lhse@.discussions.microsoft.com> wrote in message
news:A8BBBC49-4647-4206-B515-B4904E7553A2@.microsoft.com...
> The CPU utilization on one of the servers is always around 50%, sometimes
> it went to 100%, I turned on Profiler, did not find T-SQL statement using
> long CPU time. Also check sp_who2 and find msdb is the most CPU user, the
cumulated CPU time is 2742463. There were no other jobs running, just
sqlserver agent-alert, which is default How to find the top cpu users?
Thanks
>

High CPU utilization

The CPU utilization on one of the servers is always around 50%, sometimes
it went to 100%, I turned on Profiler, did not find T-SQL statement using
long CPU time. Also check sp_who2 and find msdb is the most CPU user, the cu
mulated CPU time is 2742463. There were no other jobs running, just sqlserve
r agent-alert, which is default How to find the top cpu users? ThanksHi,
Can you check the taskmanager and confirm SQLSERVR.EXE is using more CPU? IF
SQL Server then
analyze the each connections connected to server using sp_who, sp_who2 and
dbcc inputbuffer commands.
You can try stopping the SQLSERVERAGENT service as well.
Thanks
Hari
MCDBA
"lhse" <lhse@.discussions.microsoft.com> wrote in message
news:A8BBBC49-4647-4206-B515-B4904E7553A2@.microsoft.com...
> The CPU utilization on one of the servers is always around 50%, sometimes
> it went to 100%, I turned on Profiler, did not find T-SQL statement using
> long CPU time. Also check sp_who2 and find msdb is the most CPU user, the
cumulated CPU time is 2742463. There were no other jobs running, just
sqlserver agent-alert, which is default How to find the top cpu users?
Thanks
>|||You can run profiler and sort by cpu.. You can also insert the profiler data
into a SQL table and start doing select group by user, app, etc to find the
largest CPU user..
Remember that other maintenance type things go on, like checkpoint, lazy
writer, etc which can use CPU as well.
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"lhse" <lhse@.discussions.microsoft.com> wrote in message
news:A8BBBC49-4647-4206-B515-B4904E7553A2@.microsoft.com...
> The CPU utilization on one of the servers is always around 50%, sometimes
> it went to 100%, I turned on Profiler, did not find T-SQL statement using
> long CPU time. Also check sp_who2 and find msdb is the most CPU user, the
cumulated CPU time is 2742463. There were no other jobs running, just
sqlserver agent-alert, which is default How to find the top cpu users?
Thanks
>