Showing posts with label block. Show all posts
Showing posts with label block. Show all posts

Tuesday, March 27, 2012

A DB block during stored procedure excecution...

Hi all,
I'd like to ask if is there any deference between executing a stored
procedure with 'exec' command in the Query analyzer and executing the code o
f
the stored procedure in Query analyzer too. I mean that I copied the source
of stored procedure in a window of the analyzer, I declare the parameters of
stored procedure as variables and I set the same values into them and I just
run the source...
When I execute the stored proc by "exec sp 'x', 'y', 'z' " where x,y,z are
the parameters sometimes it occures a block... When I run the source
declaring the parameters as variables etc, all are fine and I have never any
block... How is it possible? Is there any idea?
Thanks in advance..Christos,
What do you mean by block?
See if this helps:
[url]http://groups-beta.google.com/group/microsoft.public.sqlserver.server/msg/a5517668
94ed8781? q=%22what+is%22%2B%22parameter+sniffing%
22&hl=en&lr=&ie=UTF-8&rnum=1[/url
]
AMB
"Christos" wrote:

> Hi all,
> I'd like to ask if is there any deference between executing a stored
> procedure with 'exec' command in the Query analyzer and executing the code
of
> the stored procedure in Query analyzer too. I mean that I copied the sourc
e
> of stored procedure in a window of the analyzer, I declare the parameters
of
> stored procedure as variables and I set the same values into them and I ju
st
> run the source...
> When I execute the stored proc by "exec sp 'x', 'y', 'z' " where x,y,z are
> the parameters sometimes it occures a block... When I run the source
> declaring the parameters as variables etc, all are fine and I have never a
ny
> block... How is it possible? Is there any idea?
> Thanks in advance..
>|||I mean that stored procedure never ends, so it is blocking other users from
using the same tables etc (the sp updates data in some tables...)|||Christos,
If the sp never ends could be because another process is blocking the
resources needed by the sp and it is waiting, or the workload is heavy.
You can use EM (Management - Current Activity) or execute sp_who2 from QA to
see the processes and locks. You can also use Profiler to trace locks.
AMB
"Christos" wrote:

> I mean that stored procedure never ends, so it is blocking other users fro
m
> using the same tables etc (the sp updates data in some tables...)|||The strange in this situation is that when I have a block during the sp
execution, if I kill the process of sp and I try again to run it separetely
with the same parameters in the Q Analyzer's environment, the blocking
happens again. If I 'export' the source code in the analyzer's window and ru
n
it again using the parameters as variables it finishes imediatelly without
any problem...sql

Thursday, February 16, 2012

4K block size vs something higher

It appears the the default block size is 4K. Is it worth increasing the size
? Pros and cons ...
Hassan
Blocks are in Oracle , did you mean Pages? It is 8096 KB
"Hassan" <Hassan@.hotmail.com> wrote in message
news:%23Zzy3ALAHHA.204@.TK2MSFTNGP04.phx.gbl...
> It appears the the default block size is 4K. Is it worth increasing the
> size ? Pros and cons ...
>
|||You can find some information on this in the Operations
Guide - check the Windows NT File System (NTFS) Allocation
Unit section:
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/sqlops6.mspx
-Sue
On Sat, 4 Nov 2006 23:58:43 -0800, "Hassan"
<Hassan@.hotmail.com> wrote:

>It appears the the default block size is 4K. Is it worth increasing the size
>? Pros and cons ...
>
|||Im talking about block size on hard disks that the OS uses to write data to.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uyyzhFLAHHA.4808@.TK2MSFTNGP03.phx.gbl...
> Hassan
> Blocks are in Oracle , did you mean Pages? It is 8096 KB
>
> "Hassan" <Hassan@.hotmail.com> wrote in message
> news:%23Zzy3ALAHHA.204@.TK2MSFTNGP04.phx.gbl...
>
|||Hi Hassan,
Guidance is that you match the allocation size with the stripe size of the
array/lun you are using.
In reality I've yet to see a benchmark that its actually made a difference
on!
I tend to make it 64KB on drives that only SQL data is stored on (or larger
files); essentially if you have a lot of little couple of KB files then each
file will take up a minimum of 64KB so if you have 10's of thousands of
files then you'll waste a massive amount of space.
Tony Rogerson
SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL
Server Consultant
http://sqlserverfaq.com - free video tutorials
"Hassan" <Hassan@.hotmail.com> wrote in message
news:%23Zzy3ALAHHA.204@.TK2MSFTNGP04.phx.gbl...
> It appears the the default block size is 4K. Is it worth increasing the
> size ? Pros and cons ...
>

4K block size vs something higher

It appears the the default block size is 4K. Is it worth increasing the size
? Pros and cons ...Hassan
Blocks are in Oracle , did you mean Pages? It is 8096 KB
"Hassan" <Hassan@.hotmail.com> wrote in message
news:%23Zzy3ALAHHA.204@.TK2MSFTNGP04.phx.gbl...
> It appears the the default block size is 4K. Is it worth increasing the
> size ? Pros and cons ...
>|||I think you are talking about NTFS Allocation Unit Size (correct me if I
am wrong).
If this is the case then the answer is yes.
Pro's: If you increase it to 8K, a complete page is read in one action.
Con's: If you are using the drive also for other programs, you be reaing
to much in an action, and lose a lot of disk space if you write al lot
of small files.
Hassan wrote:
> It appears the the default block size is 4K. Is it worth increasing the si
ze
> ? Pros and cons ...
>|||You can find some information on this in the Operations
Guide - check the Windows NT File System (NTFS) Allocation
Unit section:
http://www.microsoft.com/technet/pr...in/sqlops6.mspx
-Sue
On Sat, 4 Nov 2006 23:58:43 -0800, "Hassan"
<Hassan@.hotmail.com> wrote:

>It appears the the default block size is 4K. Is it worth increasing the siz
e
>? Pros and cons ...
>|||Im talking about block size on hard disks that the OS uses to write data to.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uyyzhFLAHHA.4808@.TK2MSFTNGP03.phx.gbl...
> Hassan
> Blocks are in Oracle , did you mean Pages? It is 8096 KB
>
> "Hassan" <Hassan@.hotmail.com> wrote in message
> news:%23Zzy3ALAHHA.204@.TK2MSFTNGP04.phx.gbl...
>|||Hi Hassan,
Guidance is that you match the allocation size with the stripe size of the
array/lun you are using.
In reality I've yet to see a benchmark that its actually made a difference
on!
I tend to make it 64KB on drives that only SQL data is stored on (or larger
files); essentially if you have a lot of little couple of KB files then each
file will take up a minimum of 64KB so if you have 10's of thousands of
files then you'll waste a massive amount of space.
Tony Rogerson
SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL
Server Consultant
http://sqlserverfaq.com - free video tutorials
"Hassan" <Hassan@.hotmail.com> wrote in message
news:%23Zzy3ALAHHA.204@.TK2MSFTNGP04.phx.gbl...
> It appears the the default block size is 4K. Is it worth increasing the
> size ? Pros and cons ...
>

4K block size vs something higher

It appears the the default block size is 4K. Is it worth increasing the size
? Pros and cons ...Hassan
Blocks are in Oracle , did you mean Pages? It is 8096 KB
"Hassan" <Hassan@.hotmail.com> wrote in message
news:%23Zzy3ALAHHA.204@.TK2MSFTNGP04.phx.gbl...
> It appears the the default block size is 4K. Is it worth increasing the
> size ? Pros and cons ...
>|||I think you are talking about NTFS Allocation Unit Size (correct me if I
am wrong).
If this is the case then the answer is yes.
Pro's: If you increase it to 8K, a complete page is read in one action.
Con's: If you are using the drive also for other programs, you be reaing
to much in an action, and lose a lot of disk space if you write al lot
of small files.
Hassan wrote:
> It appears the the default block size is 4K. Is it worth increasing the size
> ? Pros and cons ...
>|||You can find some information on this in the Operations
Guide - check the Windows NT File System (NTFS) Allocation
Unit section:
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/sqlops6.mspx
-Sue
On Sat, 4 Nov 2006 23:58:43 -0800, "Hassan"
<Hassan@.hotmail.com> wrote:
>It appears the the default block size is 4K. Is it worth increasing the size
>? Pros and cons ...
>|||Im talking about block size on hard disks that the OS uses to write data to.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uyyzhFLAHHA.4808@.TK2MSFTNGP03.phx.gbl...
> Hassan
> Blocks are in Oracle , did you mean Pages? It is 8096 KB
>
> "Hassan" <Hassan@.hotmail.com> wrote in message
> news:%23Zzy3ALAHHA.204@.TK2MSFTNGP04.phx.gbl...
>> It appears the the default block size is 4K. Is it worth increasing the
>> size ? Pros and cons ...
>|||Hi Hassan,
Guidance is that you match the allocation size with the stripe size of the
array/lun you are using.
In reality I've yet to see a benchmark that its actually made a difference
on!
I tend to make it 64KB on drives that only SQL data is stored on (or larger
files); essentially if you have a lot of little couple of KB files then each
file will take up a minimum of 64KB so if you have 10's of thousands of
files then you'll waste a massive amount of space.
--
Tony Rogerson
SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL
Server Consultant
http://sqlserverfaq.com - free video tutorials
"Hassan" <Hassan@.hotmail.com> wrote in message
news:%23Zzy3ALAHHA.204@.TK2MSFTNGP04.phx.gbl...
> It appears the the default block size is 4K. Is it worth increasing the
> size ? Pros and cons ...
>