I think that RAID5 is still sort of the default for the main database
for average conditions, because it is more efficient in the use of
disk, when you get up to four or more drives, and it may be better for
reads, and average tables in average databases do 99% reads.
But, most apps may have a few more actively written tables, which
might be best on a filegroup and/or database on a RAID10 drive
instead.
I'm having my conscious raised on a number of hardware and
configurations issues these days myself.
Josh
On Sat, 03 Mar 2007 09:05:52 +0100, sp <kofa@.noemail.noemail> wrote:
>sp napisa?(a):
>
>what do you think about this configuration?
Hello KoFa,
The default Stripe Element Size for your hardware configuration is
recommanded. For example, in the Dell EMC white paper, it recommanded to
use the default size 128 blocks or 64 KB
Here are some article for you to refer:
http://www.dell.com/downloads/global/solutions/dell_emc_sap_bestpractice.pdf
http://forums.dantz.com/ubbthreads/showflat.php?Number=93175&page=0
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
|||Hi ,
How is everything going? Please feel free to let me know if you need any
assistance.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Showing posts with label sort. Show all posts
Showing posts with label sort. Show all posts
Monday, March 12, 2012
Optimal disk configuration for SQL
Friday, March 9, 2012
Opposite of TOP
Is there an opposite of TOP in sqlsvr? Only thing I can think to do is sort the opposite direction and use TOP but I have a big dynamically generated order by clause that I'd need to parse to reverse the sorting.
I wrote it in C# (http://www.dbforums.com/showthread.php?postid=3579565#post3579565) but I'm thinking now I need it in T-SQL.
Does anyone have the code for this or a better way of handling it? TIAYou already go the half way,
I think you can do this in T-SQL and let SQL reverse the sorting for you
select * from (
select top 10 * from T order by f1 desc, f2 desc, f3 desc
) a
order by f1, f2, f3|||Do you mean something like:
select top x field from table order by field desc|||Originally posted by rnealejr
Do you mean something like:
select top x field from table order by field desc
Yes but I don't know the OrderBy field list ahead of time (since its passed in as a parameter) so I was looking for some tsql code to parse it and add the "DESC" or "ASC"|||When you say tsql do you mean you want to make it a stored procedure - otherwise you can dynamically create the statement and change it based on the parameter (which you can do in a stored procedure as well).|||Originally posted by rnealejr
When you say tsql do you mean you want to make it a stored procedure - otherwise you can dynamically create the statement and change it based on the parameter (which you can do in a stored procedure as well).
Yes, a stored proc or maybe a function which I can use like this...
SELECT @.REVsql = ReverseOrderBy(@.pSQL)
...and the ReverseOrderBy function is what I'd like to know how to write.|||declare @.orderby varchar(100)
declare @.ind int
select @.orderby = 'f1 asc, f2 desc, f3 asc'
select @.orderby = replace(@.orderby, ' asc', ' asc1')
select @.orderby = replace(@.orderby, ' desc', ' asc')
select @.orderby = replace(@.orderby, ' asc1', ' desc')
select @.orderby
will return "f1 desc, f2 asc, f3 desc"|||I wrote the function for you, it should work.
create function ReverseOrderBy (@.orderby varchar(200))
returns varchar(200)
as
begin
declare @.reverse_orderby varchar(100)
declare @.sort_item varchar(100)
declare @.ind_start int
declare @.ind int
select @.ind_start = 1
select @.reverse_orderby = ''
select @.orderby = @.orderby + ','
while (1=1)
begin
select @.ind = charindex(',', @.orderby, @.ind_start)
if @.ind = 0
begin
break
end
select @.sort_item = substring(@.orderby, @.ind_start, @.ind - @.ind_start)
if charindex(' asc', @.sort_item) > 0
begin
select @.sort_item = replace(@.sort_item, ' asc', ' desc')
end
else
begin
if charindex(' desc', @.sort_item) > 0
begin
select @.sort_item = replace(@.sort_item, ' desc', '')
end
else
begin
select @.sort_item = @.sort_item + ' desc'
end
end
select @.reverse_orderby = @.reverse_orderby + @.sort_item + ', '
select @.ind_start = @.ind + 1
end
select @.reverse_orderby = substring(@.reverse_orderby, 1, len(@.reverse_orderby)-1)
return( @.reverse_orderby)
end
usage:
declare @.orderby varchar(100)
select @.orderby = 'f1, f2 desc, f3 asc, f4, f5, d6 desc'
select dbo.ReverseOrderBy(@.orderby)
will return
f1 desc, f2 , f3 desc, f4 desc, f5 desc, d6|||Ahh, that is cool. Thanks!
I wrote it in C# (http://www.dbforums.com/showthread.php?postid=3579565#post3579565) but I'm thinking now I need it in T-SQL.
Does anyone have the code for this or a better way of handling it? TIAYou already go the half way,
I think you can do this in T-SQL and let SQL reverse the sorting for you
select * from (
select top 10 * from T order by f1 desc, f2 desc, f3 desc
) a
order by f1, f2, f3|||Do you mean something like:
select top x field from table order by field desc|||Originally posted by rnealejr
Do you mean something like:
select top x field from table order by field desc
Yes but I don't know the OrderBy field list ahead of time (since its passed in as a parameter) so I was looking for some tsql code to parse it and add the "DESC" or "ASC"|||When you say tsql do you mean you want to make it a stored procedure - otherwise you can dynamically create the statement and change it based on the parameter (which you can do in a stored procedure as well).|||Originally posted by rnealejr
When you say tsql do you mean you want to make it a stored procedure - otherwise you can dynamically create the statement and change it based on the parameter (which you can do in a stored procedure as well).
Yes, a stored proc or maybe a function which I can use like this...
SELECT @.REVsql = ReverseOrderBy(@.pSQL)
...and the ReverseOrderBy function is what I'd like to know how to write.|||declare @.orderby varchar(100)
declare @.ind int
select @.orderby = 'f1 asc, f2 desc, f3 asc'
select @.orderby = replace(@.orderby, ' asc', ' asc1')
select @.orderby = replace(@.orderby, ' desc', ' asc')
select @.orderby = replace(@.orderby, ' asc1', ' desc')
select @.orderby
will return "f1 desc, f2 asc, f3 desc"|||I wrote the function for you, it should work.
create function ReverseOrderBy (@.orderby varchar(200))
returns varchar(200)
as
begin
declare @.reverse_orderby varchar(100)
declare @.sort_item varchar(100)
declare @.ind_start int
declare @.ind int
select @.ind_start = 1
select @.reverse_orderby = ''
select @.orderby = @.orderby + ','
while (1=1)
begin
select @.ind = charindex(',', @.orderby, @.ind_start)
if @.ind = 0
begin
break
end
select @.sort_item = substring(@.orderby, @.ind_start, @.ind - @.ind_start)
if charindex(' asc', @.sort_item) > 0
begin
select @.sort_item = replace(@.sort_item, ' asc', ' desc')
end
else
begin
if charindex(' desc', @.sort_item) > 0
begin
select @.sort_item = replace(@.sort_item, ' desc', '')
end
else
begin
select @.sort_item = @.sort_item + ' desc'
end
end
select @.reverse_orderby = @.reverse_orderby + @.sort_item + ', '
select @.ind_start = @.ind + 1
end
select @.reverse_orderby = substring(@.reverse_orderby, 1, len(@.reverse_orderby)-1)
return( @.reverse_orderby)
end
usage:
declare @.orderby varchar(100)
select @.orderby = 'f1, f2 desc, f3 asc, f4, f5, d6 desc'
select dbo.ReverseOrderBy(@.orderby)
will return
f1 desc, f2 , f3 desc, f4 desc, f5 desc, d6|||Ahh, that is cool. Thanks!
Subscribe to:
Posts (Atom)