Showing posts with label performance. Show all posts
Showing posts with label performance. Show all posts

Sunday, February 19, 2012

Can sendStringParametersAsUnicode=false be overriden/changed for certain cases

Configuration: MS SQL server 2005 SP2, and MS jdbc driver version: 1.1
The sendStringParameterAsUnicode has been set to false for performance reasons. However, when inserting unicode data, we would like to override the setting and send the data encoded in unicode, instead of defaulting the whole app to unicode=true and take a performance hit.

Any suggestions? We have tried the cast(? as nvarchar) function, but that did not help.

Sample code/output:
String text = "\u0143\u0144";
sendStringParametersAsUnicode=false
insert into unitable (_ntext) values (?)
Inserting into databse:
143 144 (printed hex values)
Read from database:
3f 3f (printed hex values)

Unicode is the native string representation for communication with SQL Server, if you are converting to MBCS, then you are doing 2 converts for every string. I suggest that if you are concerned with performance, use all Unicode instead of all MBCS.

Hope that helps,

John

|||

Hello,

Sample code will be great in helping to answering this question. I am interested in what API calls are being made to insert and retrieve the data (stmt.execute(), pstmt.setString(), rs.getString(), rs.getCharacterStream(), etc).

Additionally, the following diagnostic information may help:

SQL Server Collation.

SQL Server Machine Language.

Client machine Language.

I'll assume the client and server machines are distinct. Therefore, let's clarify where the data is being improperly converted. After insertion, is the data accurate on the server?

Kind Regards,

Jaaved

|||Details at:
http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx?cat=en_us_37eacc47-2e30-4a64-841b-c94b5716569a&lang=en&cr=us&guid=&sloc=en-us&dg=microsoft.public.sqlserver.jdbcdriver&tid=25b3259e-8e4f-4552-808d-15747c8b3fd9&mid=4381b5d6-31c5-49c1-b378-f377205eb5bd&amid=4381b5d6-31c5-49c1-b378-f377205eb5bd&answer=1&p=1&stgxml=http%3a%2f%2fwww.microsoft.com%2fcommunities%2fnewsgroups%2flist%2fen-us%2fsettings.xml
|||I am glad to see this solved on the newsgroups.
Thanks,
Jaaved

Can sendStringParametersAsUnicode=false be overriden/changed for certain cases

Configuration: MS SQL server 2005 SP2, and MS jdbc driver version: 1.1
The sendStringParameterAsUnicode has been set to false for performance reasons. However, when inserting unicode data, we would like to override the setting and send the data encoded in unicode, instead of defaulting the whole app to unicode=true and take a performance hit.

Any suggestions? We have tried the cast(? as nvarchar) function, but that did not help.

Sample code/output:
String text = "\u0143\u0144";
sendStringParametersAsUnicode=false
insert into unitable (_ntext) values (?)
Inserting into databse:
143 144 (printed hex values)
Read from database:
3f 3f (printed hex values)

Unicode is the native string representation for communication with SQL Server, if you are converting to MBCS, then you are doing 2 converts for every string. I suggest that if you are concerned with performance, use all Unicode instead of all MBCS.

Hope that helps,

John

|||

Hello,

Sample code will be great in helping to answering this question. I am interested in what API calls are being made to insert and retrieve the data (stmt.execute(), pstmt.setString(), rs.getString(), rs.getCharacterStream(), etc).

Additionally, the following diagnostic information may help:

SQL Server Collation.

SQL Server Machine Language.

Client machine Language.

I'll assume the client and server machines are distinct. Therefore, let's clarify where the data is being improperly converted. After insertion, is the data accurate on the server?

Kind Regards,

Jaaved

|||Details at:
http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx?cat=en_us_37eacc47-2e30-4a64-841b-c94b5716569a&lang=en&cr=us&guid=&sloc=en-us&dg=microsoft.public.sqlserver.jdbcdriver&tid=25b3259e-8e4f-4552-808d-15747c8b3fd9&mid=4381b5d6-31c5-49c1-b378-f377205eb5bd&amid=4381b5d6-31c5-49c1-b378-f377205eb5bd&answer=1&p=1&stgxml=http%3a%2f%2fwww.microsoft.com%2fcommunities%2fnewsgroups%2flist%2fen-us%2fsettings.xml
|||I am glad to see this solved on the newsgroups.
Thanks,
Jaaved

Thursday, February 16, 2012

Can performance improve using RAID 0 if have only one CPU?

Hi,
If I have only one CPU in my SQL Server computer, can the performance have
any improvement by using RAID0?
Thanks
FrankWhy would you want to do that ? You would get peformance , no doubt, but no
fault tolerance.. You could go with RAID 1 or 1+ 0 to get performance and
the fault tolerance ..
"Frank" <wangping@.lucent.com> wrote in message
news:%23TxSv8NDFHA.1932@.TK2MSFTNGP14.phx.gbl...
> Hi,
> If I have only one CPU in my SQL Server computer, can the performance have
> any improvement by using RAID0?
> Thanks
> Frank
>|||Thanks Hassan,
I just read about the RAID, so I am wondering about this.
I think the RAID 0 will strip the data for read and write, if have more than
one processor, then the read and write can be done by different processors
on different strips. If only one processor, then I suspect there will be any
performance improvement for the processor to go to different strips.
Apprecite your further information
Frank
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:OdsweGODFHA.2620@.tk2msftngp13.phx.gbl...
> Why would you want to do that ? You would get peformance , no doubt, but
no
> fault tolerance.. You could go with RAID 1 or 1+ 0 to get performance and
> the fault tolerance ..
> "Frank" <wangping@.lucent.com> wrote in message
> news:%23TxSv8NDFHA.1932@.TK2MSFTNGP14.phx.gbl...
have[vbcol=seagreen]
>|||Well you definitely need to worry about Fault Tolerance as disks have a high
possibility of going bad. And with regards to performance, you will not see
a whole lot of difference with regards to CPUs and IO read/writes . Your
performance could be looked at right from the application level. Why not
consider RAID 1 or RAID 1+ 0
How many disks along with size do you have and how much space do you need ?
"Frank" <wangping@.lucent.com> wrote in message
news:ueQ2gKODFHA.2232@.TK2MSFTNGP14.phx.gbl...
> Thanks Hassan,
> I just read about the RAID, so I am wondering about this.
> I think the RAID 0 will strip the data for read and write, if have more
than
> one processor, then the read and write can be done by different processors
> on different strips. If only one processor, then I suspect there will be
any
> performance improvement for the processor to go to different strips.
> Apprecite your further information
> Frank
> "Hassan" <fatima_ja@.hotmail.com> wrote in message
> news:OdsweGODFHA.2620@.tk2msftngp13.phx.gbl...
> no
and[vbcol=seagreen]
> have
>|||Frank,
you would likely see improvement by striping even with a single processor...
One processor can handle many concurrent IOs... As the others have said,
raid 0 gives you no fault tolerance... If a single disk in the stripe set
goes bad, everything will go down... Whether or not that is a requirement of
your configuration is a business decision...
Another way to increase IO throughput is to create several files within the
filegroup... This will allow sql to do parallel IO for a single query..
hope this helps.
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
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:%23hp8RRODFHA.960@.TK2MSFTNGP09.phx.gbl...
> Well you definitely need to worry about Fault Tolerance as disks have a
> high
> possibility of going bad. And with regards to performance, you will not
> see
> a whole lot of difference with regards to CPUs and IO read/writes . Your
> performance could be looked at right from the application level. Why not
> consider RAID 1 or RAID 1+ 0
> How many disks along with size do you have and how much space do you need
> ?
> "Frank" <wangping@.lucent.com> wrote in message
> news:ueQ2gKODFHA.2232@.TK2MSFTNGP14.phx.gbl...
> than
> any
> and
>

Can performance improve using RAID 0 if have only one CPU?

Hi,
If I have only one CPU in my SQL Server computer, can the performance have
any improvement by using RAID0?
Thanks
Frank
Why would you want to do that ? You would get peformance , no doubt, but no
fault tolerance.. You could go with RAID 1 or 1+ 0 to get performance and
the fault tolerance ..
"Frank" <wangping@.lucent.com> wrote in message
news:%23TxSv8NDFHA.1932@.TK2MSFTNGP14.phx.gbl...
> Hi,
> If I have only one CPU in my SQL Server computer, can the performance have
> any improvement by using RAID0?
> Thanks
> Frank
>
|||Thanks Hassan,
I just read about the RAID, so I am wondering about this.
I think the RAID 0 will strip the data for read and write, if have more than
one processor, then the read and write can be done by different processors
on different strips. If only one processor, then I suspect there will be any
performance improvement for the processor to go to different strips.
Apprecite your further information
Frank
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:OdsweGODFHA.2620@.tk2msftngp13.phx.gbl...
> Why would you want to do that ? You would get peformance , no doubt, but
no[vbcol=seagreen]
> fault tolerance.. You could go with RAID 1 or 1+ 0 to get performance and
> the fault tolerance ..
> "Frank" <wangping@.lucent.com> wrote in message
> news:%23TxSv8NDFHA.1932@.TK2MSFTNGP14.phx.gbl...
have
>
|||Well you definitely need to worry about Fault Tolerance as disks have a high
possibility of going bad. And with regards to performance, you will not see
a whole lot of difference with regards to CPUs and IO read/writes . Your
performance could be looked at right from the application level. Why not
consider RAID 1 or RAID 1+ 0
How many disks along with size do you have and how much space do you need ?
"Frank" <wangping@.lucent.com> wrote in message
news:ueQ2gKODFHA.2232@.TK2MSFTNGP14.phx.gbl...
> Thanks Hassan,
> I just read about the RAID, so I am wondering about this.
> I think the RAID 0 will strip the data for read and write, if have more
than
> one processor, then the read and write can be done by different processors
> on different strips. If only one processor, then I suspect there will be
any[vbcol=seagreen]
> performance improvement for the processor to go to different strips.
> Apprecite your further information
> Frank
> "Hassan" <fatima_ja@.hotmail.com> wrote in message
> news:OdsweGODFHA.2620@.tk2msftngp13.phx.gbl...
> no
and
> have
>
|||Frank,
you would likely see improvement by striping even with a single processor...
One processor can handle many concurrent IOs... As the others have said,
raid 0 gives you no fault tolerance... If a single disk in the stripe set
goes bad, everything will go down... Whether or not that is a requirement of
your configuration is a business decision...
Another way to increase IO throughput is to create several files within the
filegroup... This will allow sql to do parallel IO for a single query..
hope this helps.
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
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:%23hp8RRODFHA.960@.TK2MSFTNGP09.phx.gbl...
> Well you definitely need to worry about Fault Tolerance as disks have a
> high
> possibility of going bad. And with regards to performance, you will not
> see
> a whole lot of difference with regards to CPUs and IO read/writes . Your
> performance could be looked at right from the application level. Why not
> consider RAID 1 or RAID 1+ 0
> How many disks along with size do you have and how much space do you need
> ?
> "Frank" <wangping@.lucent.com> wrote in message
> news:ueQ2gKODFHA.2232@.TK2MSFTNGP14.phx.gbl...
> than
> any
> and
>

Can performance improve using RAID 0 if have only one CPU?

Hi,
If I have only one CPU in my SQL Server computer, can the performance have
any improvement by using RAID0?
Thanks
FrankWhy would you want to do that ? You would get peformance , no doubt, but no
fault tolerance.. You could go with RAID 1 or 1+ 0 to get performance and
the fault tolerance ..
"Frank" <wangping@.lucent.com> wrote in message
news:%23TxSv8NDFHA.1932@.TK2MSFTNGP14.phx.gbl...
> Hi,
> If I have only one CPU in my SQL Server computer, can the performance have
> any improvement by using RAID0?
> Thanks
> Frank
>|||Thanks Hassan,
I just read about the RAID, so I am wondering about this.
I think the RAID 0 will strip the data for read and write, if have more than
one processor, then the read and write can be done by different processors
on different strips. If only one processor, then I suspect there will be any
performance improvement for the processor to go to different strips.
Apprecite your further information
Frank
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:OdsweGODFHA.2620@.tk2msftngp13.phx.gbl...
> Why would you want to do that ? You would get peformance , no doubt, but
no
> fault tolerance.. You could go with RAID 1 or 1+ 0 to get performance and
> the fault tolerance ..
> "Frank" <wangping@.lucent.com> wrote in message
> news:%23TxSv8NDFHA.1932@.TK2MSFTNGP14.phx.gbl...
> > Hi,
> >
> > If I have only one CPU in my SQL Server computer, can the performance
have
> > any improvement by using RAID0?
> >
> > Thanks
> > Frank
> >
> >
>|||Well you definitely need to worry about Fault Tolerance as disks have a high
possibility of going bad. And with regards to performance, you will not see
a whole lot of difference with regards to CPUs and IO read/writes . Your
performance could be looked at right from the application level. Why not
consider RAID 1 or RAID 1+ 0
How many disks along with size do you have and how much space do you need ?
"Frank" <wangping@.lucent.com> wrote in message
news:ueQ2gKODFHA.2232@.TK2MSFTNGP14.phx.gbl...
> Thanks Hassan,
> I just read about the RAID, so I am wondering about this.
> I think the RAID 0 will strip the data for read and write, if have more
than
> one processor, then the read and write can be done by different processors
> on different strips. If only one processor, then I suspect there will be
any
> performance improvement for the processor to go to different strips.
> Apprecite your further information
> Frank
> "Hassan" <fatima_ja@.hotmail.com> wrote in message
> news:OdsweGODFHA.2620@.tk2msftngp13.phx.gbl...
> > Why would you want to do that ? You would get peformance , no doubt, but
> no
> > fault tolerance.. You could go with RAID 1 or 1+ 0 to get performance
and
> > the fault tolerance ..
> >
> > "Frank" <wangping@.lucent.com> wrote in message
> > news:%23TxSv8NDFHA.1932@.TK2MSFTNGP14.phx.gbl...
> > > Hi,
> > >
> > > If I have only one CPU in my SQL Server computer, can the performance
> have
> > > any improvement by using RAID0?
> > >
> > > Thanks
> > > Frank
> > >
> > >
> >
> >
>|||Frank,
you would likely see improvement by striping even with a single processor...
One processor can handle many concurrent IOs... As the others have said,
raid 0 gives you no fault tolerance... If a single disk in the stripe set
goes bad, everything will go down... Whether or not that is a requirement of
your configuration is a business decision...
Another way to increase IO throughput is to create several files within the
filegroup... This will allow sql to do parallel IO for a single query..
hope this helps.
--
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
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:%23hp8RRODFHA.960@.TK2MSFTNGP09.phx.gbl...
> Well you definitely need to worry about Fault Tolerance as disks have a
> high
> possibility of going bad. And with regards to performance, you will not
> see
> a whole lot of difference with regards to CPUs and IO read/writes . Your
> performance could be looked at right from the application level. Why not
> consider RAID 1 or RAID 1+ 0
> How many disks along with size do you have and how much space do you need
> ?
> "Frank" <wangping@.lucent.com> wrote in message
> news:ueQ2gKODFHA.2232@.TK2MSFTNGP14.phx.gbl...
>> Thanks Hassan,
>> I just read about the RAID, so I am wondering about this.
>> I think the RAID 0 will strip the data for read and write, if have more
> than
>> one processor, then the read and write can be done by different
>> processors
>> on different strips. If only one processor, then I suspect there will be
> any
>> performance improvement for the processor to go to different strips.
>> Apprecite your further information
>> Frank
>> "Hassan" <fatima_ja@.hotmail.com> wrote in message
>> news:OdsweGODFHA.2620@.tk2msftngp13.phx.gbl...
>> > Why would you want to do that ? You would get peformance , no doubt,
>> > but
>> no
>> > fault tolerance.. You could go with RAID 1 or 1+ 0 to get performance
> and
>> > the fault tolerance ..
>> >
>> > "Frank" <wangping@.lucent.com> wrote in message
>> > news:%23TxSv8NDFHA.1932@.TK2MSFTNGP14.phx.gbl...
>> > > Hi,
>> > >
>> > > If I have only one CPU in my SQL Server computer, can the performance
>> have
>> > > any improvement by using RAID0?
>> > >
>> > > Thanks
>> > > Frank
>> > >
>> > >
>> >
>> >
>>
>