We have been using SQL 2005 reporting services for a while but recently when
some one tries to print a report they will get a BSOD and the machine reboots.
Any Ideas'?We are also having the same problem when printing, blue screen with error
message 0X80070709.
"Eric Wainz" wrote:
> We have been using SQL 2005 reporting services for a while but recently when
> some one tries to print a report they will get a BSOD and the machine reboots.
> Any Ideas'?
>|||On Apr 10, 1:00 pm, rcruz03 <bobby.c...@.Early-Warning.com> wrote:
> We are also having the same problem when printing, blue screen with error
> message 0X80070709.
> "Eric Wainz" wrote:
> > We have been using SQL 2005 reporting services for a while but recently when
> > some one tries to print a report they will get a BSOD and the machine reboots.
> > Any Ideas'?
It sounds kind of like a printer driver issue. Does this occur when
exporting to any SSRS supported format (Excel, PDF, CSV, Web Archive,
etc) and then printing?
Enrique Martinez
Sr. Software Consultant|||No, It does not happen when you export the report.
But, We have been able to narrow it down to PCL6 print drivers.
"EMartinez" wrote:
> On Apr 10, 1:00 pm, rcruz03 <bobby.c...@.Early-Warning.com> wrote:
> > We are also having the same problem when printing, blue screen with error
> > message 0X80070709.
> >
> > "Eric Wainz" wrote:
> > > We have been using SQL 2005 reporting services for a while but recently when
> > > some one tries to print a report they will get a BSOD and the machine reboots.
> >
> > > Any Ideas'?
>
> It sounds kind of like a printer driver issue. Does this occur when
> exporting to any SSRS supported format (Excel, PDF, CSV, Web Archive,
> etc) and then printing?
> Enrique Martinez
> Sr. Software Consultant
>|||It isn't a printer driver issue, it is the ActiveX control RSClientPrint
Class that is causing the problem. It seems to be happening after a recent
Windows Update, but I have not attributed it to any particular one. Go to
C:\windows\downloaded program files and delete the RSClientPrint Class and
run your report again. It should prompt you to download the control again
and printing should resume after that.
Wish I could flag this so MS could figure out why it is happening. It has
happened to two of my users and I am sure there will be more to follow.
"Eric Wainz" <EricWainz@.discussions.microsoft.com> wrote in message
news:29A2AC00-2BDF-4052-AB0E-83D9C576EFC0@.microsoft.com...
> No, It does not happen when you export the report.
> But, We have been able to narrow it down to PCL6 print drivers.
> "EMartinez" wrote:
>> On Apr 10, 1:00 pm, rcruz03 <bobby.c...@.Early-Warning.com> wrote:
>> > We are also having the same problem when printing, blue screen with
>> > error
>> > message 0X80070709.
>> >
>> > "Eric Wainz" wrote:
>> > > We have been using SQL 2005 reporting services for a while but
>> > > recently when
>> > > some one tries to print a report they will get a BSOD and the machine
>> > > reboots.
>> >
>> > > Any Ideas'?
>>
>> It sounds kind of like a printer driver issue. Does this occur when
>> exporting to any SSRS supported format (Excel, PDF, CSV, Web Archive,
>> etc) and then printing?
>> Enrique Martinez
>> Sr. Software Consultant
>>|||I did that and still is rebooting.
"Rockn" wrote:
> It isn't a printer driver issue, it is the ActiveX control RSClientPrint
> Class that is causing the problem. It seems to be happening after a recent
> Windows Update, but I have not attributed it to any particular one. Go to
> C:\windows\downloaded program files and delete the RSClientPrint Class and
> run your report again. It should prompt you to download the control again
> and printing should resume after that.
> Wish I could flag this so MS could figure out why it is happening. It has
> happened to two of my users and I am sure there will be more to follow.
>
> "Eric Wainz" <EricWainz@.discussions.microsoft.com> wrote in message
> news:29A2AC00-2BDF-4052-AB0E-83D9C576EFC0@.microsoft.com...
> > No, It does not happen when you export the report.
> >
> > But, We have been able to narrow it down to PCL6 print drivers.
> >
> > "EMartinez" wrote:
> >
> >> On Apr 10, 1:00 pm, rcruz03 <bobby.c...@.Early-Warning.com> wrote:
> >> > We are also having the same problem when printing, blue screen with
> >> > error
> >> > message 0X80070709.
> >> >
> >> > "Eric Wainz" wrote:
> >> > > We have been using SQL 2005 reporting services for a while but
> >> > > recently when
> >> > > some one tries to print a report they will get a BSOD and the machine
> >> > > reboots.
> >> >
> >> > > Any Ideas'?
> >>
> >>
> >> It sounds kind of like a printer driver issue. Does this occur when
> >> exporting to any SSRS supported format (Excel, PDF, CSV, Web Archive,
> >> etc) and then printing?
> >>
> >> Enrique Martinez
> >> Sr. Software Consultant
> >>
> >>
>
>|||I am almost positive it is not a printer problem and I can almost bet the
problem started after a recent Windows Update. I tried my solution on one
person in the office and it seemed to fix it. I tried it on another
computer, but I wasn't logged on under his user account and it BSOD'd and
restarted.
"Eric Wainz" <EricWainz@.discussions.microsoft.com> wrote in message
news:3CEBEA69-C6F9-4B28-BE47-C8CF01A76118@.microsoft.com...
> I did that and still is rebooting.
> "Rockn" wrote:
> > It isn't a printer driver issue, it is the ActiveX control RSClientPrint
> > Class that is causing the problem. It seems to be happening after a
recent
> > Windows Update, but I have not attributed it to any particular one. Go
to
> > C:\windows\downloaded program files and delete the RSClientPrint Class
and
> > run your report again. It should prompt you to download the control
again
> > and printing should resume after that.
> >
> > Wish I could flag this so MS could figure out why it is happening. It
has
> > happened to two of my users and I am sure there will be more to follow.
> >
> >
> > "Eric Wainz" <EricWainz@.discussions.microsoft.com> wrote in message
> > news:29A2AC00-2BDF-4052-AB0E-83D9C576EFC0@.microsoft.com...
> > > No, It does not happen when you export the report.
> > >
> > > But, We have been able to narrow it down to PCL6 print drivers.
> > >
> > > "EMartinez" wrote:
> > >
> > >> On Apr 10, 1:00 pm, rcruz03 <bobby.c...@.Early-Warning.com> wrote:
> > >> > We are also having the same problem when printing, blue screen with
> > >> > error
> > >> > message 0X80070709.
> > >> >
> > >> > "Eric Wainz" wrote:
> > >> > > We have been using SQL 2005 reporting services for a while but
> > >> > > recently when
> > >> > > some one tries to print a report they will get a BSOD and the
machine
> > >> > > reboots.
> > >> >
> > >> > > Any Ideas'?
> > >>
> > >>
> > >> It sounds kind of like a printer driver issue. Does this occur when
> > >> exporting to any SSRS supported format (Excel, PDF, CSV, Web Archive,
> > >> etc) and then printing?
> > >>
> > >> Enrique Martinez
> > >> Sr. Software Consultant
> > >>
> > >>
> >
> >
> >|||What programs are installed on the computer getting the BSOD? Acrobat Pro,
IM? Others?
"Rockn" <Rockn@.newsgroups.nospam> wrote in message
news:eAXDzH8eHHA.4188@.TK2MSFTNGP02.phx.gbl...
>I am almost positive it is not a printer problem and I can almost bet the
> problem started after a recent Windows Update. I tried my solution on one
> person in the office and it seemed to fix it. I tried it on another
> computer, but I wasn't logged on under his user account and it BSOD'd and
> restarted.
>
> "Eric Wainz" <EricWainz@.discussions.microsoft.com> wrote in message
> news:3CEBEA69-C6F9-4B28-BE47-C8CF01A76118@.microsoft.com...
>> I did that and still is rebooting.
>> "Rockn" wrote:
>> > It isn't a printer driver issue, it is the ActiveX control
>> > RSClientPrint
>> > Class that is causing the problem. It seems to be happening after a
> recent
>> > Windows Update, but I have not attributed it to any particular one. Go
> to
>> > C:\windows\downloaded program files and delete the RSClientPrint Class
> and
>> > run your report again. It should prompt you to download the control
> again
>> > and printing should resume after that.
>> >
>> > Wish I could flag this so MS could figure out why it is happening. It
> has
>> > happened to two of my users and I am sure there will be more to follow.
>> >
>> >
>> > "Eric Wainz" <EricWainz@.discussions.microsoft.com> wrote in message
>> > news:29A2AC00-2BDF-4052-AB0E-83D9C576EFC0@.microsoft.com...
>> > > No, It does not happen when you export the report.
>> > >
>> > > But, We have been able to narrow it down to PCL6 print drivers.
>> > >
>> > > "EMartinez" wrote:
>> > >
>> > >> On Apr 10, 1:00 pm, rcruz03 <bobby.c...@.Early-Warning.com> wrote:
>> > >> > We are also having the same problem when printing, blue screen
>> > >> > with
>> > >> > error
>> > >> > message 0X80070709.
>> > >> >
>> > >> > "Eric Wainz" wrote:
>> > >> > > We have been using SQL 2005 reporting services for a while but
>> > >> > > recently when
>> > >> > > some one tries to print a report they will get a BSOD and the
> machine
>> > >> > > reboots.
>> > >> >
>> > >> > > Any Ideas'?
>> > >>
>> > >>
>> > >> It sounds kind of like a printer driver issue. Does this occur when
>> > >> exporting to any SSRS supported format (Excel, PDF, CSV, Web
>> > >> Archive,
>> > >> etc) and then printing?
>> > >>
>> > >> Enrique Martinez
>> > >> Sr. Software Consultant
>> > >>
>> > >>
>> >
>> >
>> >
>|||We are getting the same problem!
Just started happening a few days ago.
"Eric Wainz" wrote:
> We have been using SQL 2005 reporting services for a while but recently when
> some one tries to print a report they will get a BSOD and the machine reboots.
> Any Ideas'?
>|||I'm having the same issue with RS 2000. Microsoft, we need a hotfix...
"Eric Wainz" wrote:
> We have been using SQL 2005 reporting services for a while but recently when
> some one tries to print a report they will get a BSOD and the machine reboots.
> Any Ideas'?
>|||I fixed one of the computers using System Restore to a date before the
errors and it took care of his. I haven't narrowed it down yet, but I have
also tried removing all Windows updates for today and it still didn't fix
another users issue. I'll keep plugging away at it.
"ana9" <ana9@.discussions.microsoft.com> wrote in message
news:093ABBB0-B29D-47FD-82A5-3AD3FC109510@.microsoft.com...
> I'm having the same issue with RS 2000. Microsoft, we need a hotfix...
> "Eric Wainz" wrote:
>> We have been using SQL 2005 reporting services for a while but recently
>> when
>> some one tries to print a report they will get a BSOD and the machine
>> reboots.
>> Any Ideas'?|||I rolled back the security updates and re-installed the active x driver to no
avail. All the printers use the PCL6 driver but crashes only occur when
trying to print to an HP4250...
"Rockn" wrote:
> I fixed one of the computers using System Restore to a date before the
> errors and it took care of his. I haven't narrowed it down yet, but I have
> also tried removing all Windows updates for today and it still didn't fix
> another users issue. I'll keep plugging away at it.
> "ana9" <ana9@.discussions.microsoft.com> wrote in message
> news:093ABBB0-B29D-47FD-82A5-3AD3FC109510@.microsoft.com...
> > I'm having the same issue with RS 2000. Microsoft, we need a hotfix...
> >
> > "Eric Wainz" wrote:
> >
> >> We have been using SQL 2005 reporting services for a while but recently
> >> when
> >> some one tries to print a report they will get a BSOD and the machine
> >> reboots.
> >>
> >> Any Ideas'?
> >>
>
>|||Is that a PLC 5e driver or something else?
"ana9" <ana9@.discussions.microsoft.com> wrote in message
news:27CF0AFF-AC34-4E24-81B8-34C5D446BA1F@.microsoft.com...
>I rolled back the security updates and re-installed the active x driver to
>no
> avail. All the printers use the PCL6 driver but crashes only occur when
> trying to print to an HP4250...
>
> "Rockn" wrote:
>> I fixed one of the computers using System Restore to a date before the
>> errors and it took care of his. I haven't narrowed it down yet, but I
>> have
>> also tried removing all Windows updates for today and it still didn't fix
>> another users issue. I'll keep plugging away at it.
>> "ana9" <ana9@.discussions.microsoft.com> wrote in message
>> news:093ABBB0-B29D-47FD-82A5-3AD3FC109510@.microsoft.com...
>> > I'm having the same issue with RS 2000. Microsoft, we need a hotfix...
>> >
>> > "Eric Wainz" wrote:
>> >
>> >> We have been using SQL 2005 reporting services for a while but
>> >> recently
>> >> when
>> >> some one tries to print a report they will get a BSOD and the machine
>> >> reboots.
>> >>
>> >> Any Ideas'?
>> >>
>>|||It appears to be a print driver issue due to some recent update. If you
change your print drivers to PCL 5e it won't crash any longer.
ana9 had the answer, but the reason is still not figured out.
"Rockn" <Rockn@.newsgroups.nospam> wrote in message
news:%23rNh2sQfHHA.284@.TK2MSFTNGP05.phx.gbl...
> Is that a PLC 5e driver or something else?
>
> "ana9" <ana9@.discussions.microsoft.com> wrote in message
> news:27CF0AFF-AC34-4E24-81B8-34C5D446BA1F@.microsoft.com...
>>I rolled back the security updates and re-installed the active x driver to
>>no
>> avail. All the printers use the PCL6 driver but crashes only occur when
>> trying to print to an HP4250...
>>
>> "Rockn" wrote:
>> I fixed one of the computers using System Restore to a date before the
>> errors and it took care of his. I haven't narrowed it down yet, but I
>> have
>> also tried removing all Windows updates for today and it still didn't
>> fix
>> another users issue. I'll keep plugging away at it.
>> "ana9" <ana9@.discussions.microsoft.com> wrote in message
>> news:093ABBB0-B29D-47FD-82A5-3AD3FC109510@.microsoft.com...
>> > I'm having the same issue with RS 2000. Microsoft, we need a
>> > hotfix...
>> >
>> > "Eric Wainz" wrote:
>> >
>> >> We have been using SQL 2005 reporting services for a while but
>> >> recently
>> >> when
>> >> some one tries to print a report they will get a BSOD and the machine
>> >> reboots.
>> >>
>> >> Any Ideas'?
>> >>
>>
>|||It doesn't appear to be a general print driver issue. As I said, only the HP
4250's have this problem. Do you see this as well, or does it effect all
your printers regardless of manufacturer?
"Rockn" wrote:
> It appears to be a print driver issue due to some recent update. If you
> change your print drivers to PCL 5e it won't crash any longer.
> ana9 had the answer, but the reason is still not figured out.
> "Rockn" <Rockn@.newsgroups.nospam> wrote in message
> news:%23rNh2sQfHHA.284@.TK2MSFTNGP05.phx.gbl...
> > Is that a PLC 5e driver or something else?
> >
> >
> > "ana9" <ana9@.discussions.microsoft.com> wrote in message
> > news:27CF0AFF-AC34-4E24-81B8-34C5D446BA1F@.microsoft.com...
> >>I rolled back the security updates and re-installed the active x driver to
> >>no
> >> avail. All the printers use the PCL6 driver but crashes only occur when
> >> trying to print to an HP4250...
> >>
> >>
> >> "Rockn" wrote:
> >>
> >> I fixed one of the computers using System Restore to a date before the
> >> errors and it took care of his. I haven't narrowed it down yet, but I
> >> have
> >> also tried removing all Windows updates for today and it still didn't
> >> fix
> >> another users issue. I'll keep plugging away at it.
> >>
> >> "ana9" <ana9@.discussions.microsoft.com> wrote in message
> >> news:093ABBB0-B29D-47FD-82A5-3AD3FC109510@.microsoft.com...
> >> > I'm having the same issue with RS 2000. Microsoft, we need a
> >> > hotfix...
> >> >
> >> > "Eric Wainz" wrote:
> >> >
> >> >> We have been using SQL 2005 reporting services for a while but
> >> >> recently
> >> >> when
> >> >> some one tries to print a report they will get a BSOD and the machine
> >> >> reboots.
> >> >>
> >> >> Any Ideas'?
> >> >>
> >>
> >>
> >>
> >
> >
>
>|||It only affects printers using the PCL 6 driver. If I print to any of the
others using a PCL 5e driver it works. All of our printers are HP.
"ana9" <ana9@.discussions.microsoft.com> wrote in message
news:7FEEEDFD-FBC1-45D8-915D-087F066D3108@.microsoft.com...
> It doesn't appear to be a general print driver issue. As I said, only the
HP
> 4250's have this problem. Do you see this as well, or does it effect all
> your printers regardless of manufacturer?
> "Rockn" wrote:
> > It appears to be a print driver issue due to some recent update. If you
> > change your print drivers to PCL 5e it won't crash any longer.
> > ana9 had the answer, but the reason is still not figured out.
> >
> > "Rockn" <Rockn@.newsgroups.nospam> wrote in message
> > news:%23rNh2sQfHHA.284@.TK2MSFTNGP05.phx.gbl...
> > > Is that a PLC 5e driver or something else?
> > >
> > >
> > > "ana9" <ana9@.discussions.microsoft.com> wrote in message
> > > news:27CF0AFF-AC34-4E24-81B8-34C5D446BA1F@.microsoft.com...
> > >>I rolled back the security updates and re-installed the active x
driver to
> > >>no
> > >> avail. All the printers use the PCL6 driver but crashes only occur
when
> > >> trying to print to an HP4250...
> > >>
> > >>
> > >> "Rockn" wrote:
> > >>
> > >> I fixed one of the computers using System Restore to a date before
the
> > >> errors and it took care of his. I haven't narrowed it down yet, but
I
> > >> have
> > >> also tried removing all Windows updates for today and it still
didn't
> > >> fix
> > >> another users issue. I'll keep plugging away at it.
> > >>
> > >> "ana9" <ana9@.discussions.microsoft.com> wrote in message
> > >> news:093ABBB0-B29D-47FD-82A5-3AD3FC109510@.microsoft.com...
> > >> > I'm having the same issue with RS 2000. Microsoft, we need a
> > >> > hotfix...
> > >> >
> > >> > "Eric Wainz" wrote:
> > >> >
> > >> >> We have been using SQL 2005 reporting services for a while but
> > >> >> recently
> > >> >> when
> > >> >> some one tries to print a report they will get a BSOD and the
machine
> > >> >> reboots.
> > >> >>
> > >> >> Any Ideas'?
> > >> >>
> > >>
> > >>
> > >>
> > >
> > >
> >
> >
> >|||Remove security patch KB925902 or MS07-017 related to GDI+. This was just
realeased. I understand a hot patch may be available as early as Monday.
As a pre-caution read why this security update was published before
removing. Might be more of a risk to remove that to have the end users export
to pdf then print which has been my work around.
John
"Rockn" wrote:
> It only affects printers using the PCL 6 driver. If I print to any of the
> others using a PCL 5e driver it works. All of our printers are HP.
> "ana9" <ana9@.discussions.microsoft.com> wrote in message
> news:7FEEEDFD-FBC1-45D8-915D-087F066D3108@.microsoft.com...
> > It doesn't appear to be a general print driver issue. As I said, only the
> HP
> > 4250's have this problem. Do you see this as well, or does it effect all
> > your printers regardless of manufacturer?
> >
> > "Rockn" wrote:
> >
> > > It appears to be a print driver issue due to some recent update. If you
> > > change your print drivers to PCL 5e it won't crash any longer.
> > > ana9 had the answer, but the reason is still not figured out.
> > >
> > > "Rockn" <Rockn@.newsgroups.nospam> wrote in message
> > > news:%23rNh2sQfHHA.284@.TK2MSFTNGP05.phx.gbl...
> > > > Is that a PLC 5e driver or something else?
> > > >
> > > >
> > > > "ana9" <ana9@.discussions.microsoft.com> wrote in message
> > > > news:27CF0AFF-AC34-4E24-81B8-34C5D446BA1F@.microsoft.com...
> > > >>I rolled back the security updates and re-installed the active x
> driver to
> > > >>no
> > > >> avail. All the printers use the PCL6 driver but crashes only occur
> when
> > > >> trying to print to an HP4250...
> > > >>
> > > >>
> > > >> "Rockn" wrote:
> > > >>
> > > >> I fixed one of the computers using System Restore to a date before
> the
> > > >> errors and it took care of his. I haven't narrowed it down yet, but
> I
> > > >> have
> > > >> also tried removing all Windows updates for today and it still
> didn't
> > > >> fix
> > > >> another users issue. I'll keep plugging away at it.
> > > >>
> > > >> "ana9" <ana9@.discussions.microsoft.com> wrote in message
> > > >> news:093ABBB0-B29D-47FD-82A5-3AD3FC109510@.microsoft.com...
> > > >> > I'm having the same issue with RS 2000. Microsoft, we need a
> > > >> > hotfix...
> > > >> >
> > > >> > "Eric Wainz" wrote:
> > > >> >
> > > >> >> We have been using SQL 2005 reporting services for a while but
> > > >> >> recently
> > > >> >> when
> > > >> >> some one tries to print a report they will get a BSOD and the
> machine
> > > >> >> reboots.
> > > >> >>
> > > >> >> Any Ideas'?
> > > >> >>
> > > >>
> > > >>
> > > >>
> > > >
> > > >
> > >
> > >
> > >
>
>|||That did the trick, you are the man!!
"John" <John@.discussions.microsoft.com> wrote in message
news:3B16020C-2B19-40F9-BF4D-811DC1995D95@.microsoft.com...
> Remove security patch KB925902 or MS07-017 related to GDI+. This was just
> realeased. I understand a hot patch may be available as early as Monday.
> As a pre-caution read why this security update was published before
> removing. Might be more of a risk to remove that to have the end users
> export
> to pdf then print which has been my work around.
> John
> "Rockn" wrote:
>> It only affects printers using the PCL 6 driver. If I print to any of the
>> others using a PCL 5e driver it works. All of our printers are HP.
>> "ana9" <ana9@.discussions.microsoft.com> wrote in message
>> news:7FEEEDFD-FBC1-45D8-915D-087F066D3108@.microsoft.com...
>> > It doesn't appear to be a general print driver issue. As I said, only
>> > the
>> HP
>> > 4250's have this problem. Do you see this as well, or does it effect
>> > all
>> > your printers regardless of manufacturer?
>> >
>> > "Rockn" wrote:
>> >
>> > > It appears to be a print driver issue due to some recent update. If
>> > > you
>> > > change your print drivers to PCL 5e it won't crash any longer.
>> > > ana9 had the answer, but the reason is still not figured out.
>> > >
>> > > "Rockn" <Rockn@.newsgroups.nospam> wrote in message
>> > > news:%23rNh2sQfHHA.284@.TK2MSFTNGP05.phx.gbl...
>> > > > Is that a PLC 5e driver or something else?
>> > > >
>> > > >
>> > > > "ana9" <ana9@.discussions.microsoft.com> wrote in message
>> > > > news:27CF0AFF-AC34-4E24-81B8-34C5D446BA1F@.microsoft.com...
>> > > >>I rolled back the security updates and re-installed the active x
>> driver to
>> > > >>no
>> > > >> avail. All the printers use the PCL6 driver but crashes only
>> > > >> occur
>> when
>> > > >> trying to print to an HP4250...
>> > > >>
>> > > >>
>> > > >> "Rockn" wrote:
>> > > >>
>> > > >> I fixed one of the computers using System Restore to a date
>> > > >> before
>> the
>> > > >> errors and it took care of his. I haven't narrowed it down yet,
>> > > >> but
>> I
>> > > >> have
>> > > >> also tried removing all Windows updates for today and it still
>> didn't
>> > > >> fix
>> > > >> another users issue. I'll keep plugging away at it.
>> > > >>
>> > > >> "ana9" <ana9@.discussions.microsoft.com> wrote in message
>> > > >> news:093ABBB0-B29D-47FD-82A5-3AD3FC109510@.microsoft.com...
>> > > >> > I'm having the same issue with RS 2000. Microsoft, we need a
>> > > >> > hotfix...
>> > > >> >
>> > > >> > "Eric Wainz" wrote:
>> > > >> >
>> > > >> >> We have been using SQL 2005 reporting services for a while but
>> > > >> >> recently
>> > > >> >> when
>> > > >> >> some one tries to print a report they will get a BSOD and the
>> machine
>> > > >> >> reboots.
>> > > >> >>
>> > > >> >> Any Ideas'?
>> > > >> >>
>> > > >>
>> > > >>
>> > > >>
>> > > >
>> > > >
>> > >
>> > >
>> > >
>>|||Please review this article http://support.microsoft.com/kb/935843/. It has two patches, one for Windows 2000 and another one for Windows XP. The crashing will stop after you apply this patch
From http://www.developmentnow.com/g/115_2007_4_0_0_955642/Blue-Screen-of-Death-BSOD-when-printing.ht
Posted via DevelopmentNow.com Group
http://www.developmentnow.com
Showing posts with label machine. Show all posts
Showing posts with label machine. Show all posts
Monday, March 19, 2012
Sunday, March 11, 2012
Blocking SQL server by machine name?
Hello,
I've Windows 2000 server with SQL 2000 server running.
I have a SQL user (let's call miniSa) which is mostly "sa" on one SQL box.
And that account is used to all over the places (VB apps,Web app, DTS
connection). Now I know that a person shouldn't be access to the SQL box bu
t
he does using the account. Only way I can track down him is from SQL profil
e
with his machine name.
Is there a way that I can block the SQL box only from a specific machine nam
e?
Thank you in advance.
SangHun"SangHunJung" <SangHunJung@.discussions.microsoft.com> wrote in message
news:F23A84F9-6350-4BE8-B002-62A9BD320BCB@.microsoft.com...
> I've Windows 2000 server with SQL 2000 server running.
> I have a SQL user (let's call miniSa) which is mostly "sa" on one SQL box.
> And that account is used to all over the places (VB apps,Web app, DTS
> connection). Now I know that a person shouldn't be access to the SQL box
but
> he does using the account. Only way I can track down him is from SQL
profile
> with his machine name.
> Is there a way that I can block the SQL box only from a specific machine
name?
It's kind of ugly, but you could do TCP/IP filtering on the server level and
block the IP address of the computer that your "SQL user" uses. A better way
would be a review of the security implementation, eliminate this commonly
used account and implement Windows Authentication with nt group membership.
Steve|||Thanks for the reply Steve.
Using TCP/IP Filtering is not an option because of DHCP server. I may use
MAC address but that way that user may not use all the apps in the server.
I
don't want that happen either. I want just SQL server databases access
denied from the PC.
I will work on the whole problem but I need some time and ofcourse runing
several projects, support developers, and admin issues......tough.
Any other suggestions?
SangHun
"Steve Thompson" wrote:
> "SangHunJung" <SangHunJung@.discussions.microsoft.com> wrote in message
> news:F23A84F9-6350-4BE8-B002-62A9BD320BCB@.microsoft.com...
> but
> profile
> name?
> It's kind of ugly, but you could do TCP/IP filtering on the server level a
nd
> block the IP address of the computer that your "SQL user" uses. A better w
ay
> would be a review of the security implementation, eliminate this commonly
> used account and implement Windows Authentication with nt group membership
.
> Steve
>
>|||
> I will work on the whole problem but I need some time and ofcourse runing
> several projects, support developers, and admin issues......tough.
> Any other suggestions?
Yes, I still recommend my previous suggestion, some times there are no
+easy+ solutions. Sorry.
Steve
[vbcol=seagreen]
commonly[vbcol=seagreen]
membership.|||You can use IPSec to block a particular machine from contacting another
machine on the network.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.
I've Windows 2000 server with SQL 2000 server running.
I have a SQL user (let's call miniSa) which is mostly "sa" on one SQL box.
And that account is used to all over the places (VB apps,Web app, DTS
connection). Now I know that a person shouldn't be access to the SQL box bu
t
he does using the account. Only way I can track down him is from SQL profil
e
with his machine name.
Is there a way that I can block the SQL box only from a specific machine nam
e?
Thank you in advance.
SangHun"SangHunJung" <SangHunJung@.discussions.microsoft.com> wrote in message
news:F23A84F9-6350-4BE8-B002-62A9BD320BCB@.microsoft.com...
> I've Windows 2000 server with SQL 2000 server running.
> I have a SQL user (let's call miniSa) which is mostly "sa" on one SQL box.
> And that account is used to all over the places (VB apps,Web app, DTS
> connection). Now I know that a person shouldn't be access to the SQL box
but
> he does using the account. Only way I can track down him is from SQL
profile
> with his machine name.
> Is there a way that I can block the SQL box only from a specific machine
name?
It's kind of ugly, but you could do TCP/IP filtering on the server level and
block the IP address of the computer that your "SQL user" uses. A better way
would be a review of the security implementation, eliminate this commonly
used account and implement Windows Authentication with nt group membership.
Steve|||Thanks for the reply Steve.
Using TCP/IP Filtering is not an option because of DHCP server. I may use
MAC address but that way that user may not use all the apps in the server.
I
don't want that happen either. I want just SQL server databases access
denied from the PC.
I will work on the whole problem but I need some time and ofcourse runing
several projects, support developers, and admin issues......tough.
Any other suggestions?
SangHun
"Steve Thompson" wrote:
> "SangHunJung" <SangHunJung@.discussions.microsoft.com> wrote in message
> news:F23A84F9-6350-4BE8-B002-62A9BD320BCB@.microsoft.com...
> but
> profile
> name?
> It's kind of ugly, but you could do TCP/IP filtering on the server level a
nd
> block the IP address of the computer that your "SQL user" uses. A better w
ay
> would be a review of the security implementation, eliminate this commonly
> used account and implement Windows Authentication with nt group membership
.
> Steve
>
>|||
> I will work on the whole problem but I need some time and ofcourse runing
> several projects, support developers, and admin issues......tough.
> Any other suggestions?
Yes, I still recommend my previous suggestion, some times there are no
+easy+ solutions. Sorry.
Steve
[vbcol=seagreen]
commonly[vbcol=seagreen]
membership.|||You can use IPSec to block a particular machine from contacting another
machine on the network.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.
Thursday, March 8, 2012
blocking all connections for final cut over to new SQL server machine
Hi ALL,
I'm replaceing the old SQL server machine to the new & better SQL server
machine. i already done all the moves but in the final cut over planning, i
need some help. How can i restrict all users and applications from connecting
to the old machine. so that in the down time i can take the Final
Transactional log backup and restore to the new SQL server machine. i know i
can use Single user move or Change IP address to the old machine or i can
denay all users access. BUT i don't know which one is better way to do and
why?
are there any other way of doing this?
Any feedback will be greatly appreciated.
THANKS
Nick
Message posted via droptable.com
http://www.droptable.com/Uwe/Forums...erver/200508/1
Good stuff
http://vyaskn.tripod.com/moving_sql_server.htm
"Nick via droptable.com" <forum@.droptable.com> wrote in message
news:534E920C33D81@.droptable.com...
> Hi ALL,
> I'm replaceing the old SQL server machine to the new & better SQL server
> machine. i already done all the moves but in the final cut over planning,
> i
> need some help. How can i restrict all users and applications from
> connecting
> to the old machine. so that in the down time i can take the Final
> Transactional log backup and restore to the new SQL server machine. i know
> i
> can use Single user move or Change IP address to the old machine or i can
> denay all users access. BUT i don't know which one is better way to do and
> why?
> are there any other way of doing this?
> Any feedback will be greatly appreciated.
> THANKS
> Nick
>
> --
> Message posted via droptable.com
> http://www.droptable.com/Uwe/Forums...erver/200508/1
I'm replaceing the old SQL server machine to the new & better SQL server
machine. i already done all the moves but in the final cut over planning, i
need some help. How can i restrict all users and applications from connecting
to the old machine. so that in the down time i can take the Final
Transactional log backup and restore to the new SQL server machine. i know i
can use Single user move or Change IP address to the old machine or i can
denay all users access. BUT i don't know which one is better way to do and
why?
are there any other way of doing this?
Any feedback will be greatly appreciated.
THANKS
Nick
Message posted via droptable.com
http://www.droptable.com/Uwe/Forums...erver/200508/1
Good stuff
http://vyaskn.tripod.com/moving_sql_server.htm
"Nick via droptable.com" <forum@.droptable.com> wrote in message
news:534E920C33D81@.droptable.com...
> Hi ALL,
> I'm replaceing the old SQL server machine to the new & better SQL server
> machine. i already done all the moves but in the final cut over planning,
> i
> need some help. How can i restrict all users and applications from
> connecting
> to the old machine. so that in the down time i can take the Final
> Transactional log backup and restore to the new SQL server machine. i know
> i
> can use Single user move or Change IP address to the old machine or i can
> denay all users access. BUT i don't know which one is better way to do and
> why?
> are there any other way of doing this?
> Any feedback will be greatly appreciated.
> THANKS
> Nick
>
> --
> Message posted via droptable.com
> http://www.droptable.com/Uwe/Forums...erver/200508/1
Labels:
blocking,
connections,
cut,
database,
final,
machine,
microsoft,
moves,
mysql,
old,
oracle,
replaceing,
server,
servermachine,
sql
blocking all connections for final cut over to new SQL server machine
Hi ALL,
I'm replaceing the old SQL server machine to the new & better SQL server
machine. i already done all the moves but in the final cut over planning, i
need some help. How can i restrict all users and applications from connectin
g
to the old machine. so that in the down time i can take the Final
Transactional log backup and restore to the new SQL server machine. i know i
can use Single user move or Change IP address to the old machine or i can
denay all users access. BUT i don't know which one is better way to do and
why?
are there any other way of doing this?
Any feedback will be greatly appreciated.
THANKS
Nick
Message posted via droptable.com
http://www.droptable.com/Uwe/Forum...server/200508/1Good stuff
http://vyaskn.tripod.com/moving_sql_server.htm
"Nick via droptable.com" <forum@.droptable.com> wrote in message
news:534E920C33D81@.droptable.com...
> Hi ALL,
> I'm replaceing the old SQL server machine to the new & better SQL server
> machine. i already done all the moves but in the final cut over planning,
> i
> need some help. How can i restrict all users and applications from
> connecting
> to the old machine. so that in the down time i can take the Final
> Transactional log backup and restore to the new SQL server machine. i know
> i
> can use Single user move or Change IP address to the old machine or i can
> denay all users access. BUT i don't know which one is better way to do and
> why?
> are there any other way of doing this?
> Any feedback will be greatly appreciated.
> THANKS
> Nick
>
> --
> Message posted via droptable.com
> http://www.droptable.com/Uwe/Forum...server/200508/1
I'm replaceing the old SQL server machine to the new & better SQL server
machine. i already done all the moves but in the final cut over planning, i
need some help. How can i restrict all users and applications from connectin
g
to the old machine. so that in the down time i can take the Final
Transactional log backup and restore to the new SQL server machine. i know i
can use Single user move or Change IP address to the old machine or i can
denay all users access. BUT i don't know which one is better way to do and
why?
are there any other way of doing this?
Any feedback will be greatly appreciated.
THANKS
Nick
Message posted via droptable.com
http://www.droptable.com/Uwe/Forum...server/200508/1Good stuff
http://vyaskn.tripod.com/moving_sql_server.htm
"Nick via droptable.com" <forum@.droptable.com> wrote in message
news:534E920C33D81@.droptable.com...
> Hi ALL,
> I'm replaceing the old SQL server machine to the new & better SQL server
> machine. i already done all the moves but in the final cut over planning,
> i
> need some help. How can i restrict all users and applications from
> connecting
> to the old machine. so that in the down time i can take the Final
> Transactional log backup and restore to the new SQL server machine. i know
> i
> can use Single user move or Change IP address to the old machine or i can
> denay all users access. BUT i don't know which one is better way to do and
> why?
> are there any other way of doing this?
> Any feedback will be greatly appreciated.
> THANKS
> Nick
>
> --
> Message posted via droptable.com
> http://www.droptable.com/Uwe/Forum...server/200508/1
Labels:
blocking,
connections,
cut,
database,
final,
machine,
microsoft,
moves,
mysql,
old,
oracle,
replaceing,
server,
servermachine,
sql
blocking all connections for final cut over to new SQL server machine
Hi ALL,
I'm replaceing the old SQL server machine to the new & better SQL server
machine. i already done all the moves but in the final cut over planning, i
need some help. How can i restrict all users and applications from connecting
to the old machine. so that in the down time i can take the Final
Transactional log backup and restore to the new SQL server machine. i know i
can use Single user move or Change IP address to the old machine or i can
denay all users access. BUT i don't know which one is better way to do and
why?
are there any other way of doing this?
Any feedback will be greatly appreciated.
THANKS
Nick
--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200508/1Good stuff
http://vyaskn.tripod.com/moving_sql_server.htm
"Nick via SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:534E920C33D81@.SQLMonster.com...
> Hi ALL,
> I'm replaceing the old SQL server machine to the new & better SQL server
> machine. i already done all the moves but in the final cut over planning,
> i
> need some help. How can i restrict all users and applications from
> connecting
> to the old machine. so that in the down time i can take the Final
> Transactional log backup and restore to the new SQL server machine. i know
> i
> can use Single user move or Change IP address to the old machine or i can
> denay all users access. BUT i don't know which one is better way to do and
> why?
> are there any other way of doing this?
> Any feedback will be greatly appreciated.
> THANKS
> Nick
>
> --
> Message posted via SQLMonster.com
> http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200508/1
I'm replaceing the old SQL server machine to the new & better SQL server
machine. i already done all the moves but in the final cut over planning, i
need some help. How can i restrict all users and applications from connecting
to the old machine. so that in the down time i can take the Final
Transactional log backup and restore to the new SQL server machine. i know i
can use Single user move or Change IP address to the old machine or i can
denay all users access. BUT i don't know which one is better way to do and
why?
are there any other way of doing this?
Any feedback will be greatly appreciated.
THANKS
Nick
--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200508/1Good stuff
http://vyaskn.tripod.com/moving_sql_server.htm
"Nick via SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:534E920C33D81@.SQLMonster.com...
> Hi ALL,
> I'm replaceing the old SQL server machine to the new & better SQL server
> machine. i already done all the moves but in the final cut over planning,
> i
> need some help. How can i restrict all users and applications from
> connecting
> to the old machine. so that in the down time i can take the Final
> Transactional log backup and restore to the new SQL server machine. i know
> i
> can use Single user move or Change IP address to the old machine or i can
> denay all users access. BUT i don't know which one is better way to do and
> why?
> are there any other way of doing this?
> Any feedback will be greatly appreciated.
> THANKS
> Nick
>
> --
> Message posted via SQLMonster.com
> http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200508/1
Sunday, February 19, 2012
Blank Report after deployment
I'm having a bit of a problem with Report viewer but only after deployment. On my machine and various test machines (using IE6 and 7 and Firefox) all the reports in the program work fine.
However after we've deployed this project to a customer the reports are showing up as blank in report viewer. If we export them to pdf they show up in the pdf correctly.
We are using Cassini rather than IIS on the test system but we've installed this on a pc here to test and that seems to be working.
Anyone had similar issues? I know it could be many different things but I don't have a lot of info on the PC thats having problems.
Is this over ssl? What do you mean by blank?|||No its all running locally at this point so no SSL. When I say blank I mean the report Viewer is showing (and I can export to PDF/Excel which works fine) but I can't actually see the report report viewer. Its just a big white box under the report viewer toolbar.Sunday, February 12, 2012
Bizarre performance hit
I create backups of a remote, production database and copy it after compression to a local,
development machine.
The remote machine is a Intel P4, 3.20GHz + 1G. The development machine is an AMD X2 3800+ dual
processor with 2G memory. Subjectively, I feel the development machine is noticeably faster in most
ways.
On the remote machine, I execute a SP which inserts approximately 6000 records. From the profiler, I
see each insertion takes about 50 Reads and about 0 Duration, which is acceptable.
After synchronizing the database logins with the those in the Master table on the development
machine, I execute the same SP on the development machine. The Reads are about 7500 and the Duration
around 3200!
Can anyone suggest reasons why this differential might occur? I really do need help. I'm not a DBA
but a developer. But it doesn't take a DBA to know that this won't fly.
TIA
Run sp_updatestats after a restore and then try it.
Andrew J. Kelly SQL MVP
"larzeb" <larzeb@.community.nospam> wrote in message
news:5os5k15iub07uqubpdqb8acgg7vcaq0grj@.4ax.com...
>I create backups of a remote, production database and copy it after
>compression to a local,
> development machine.
> The remote machine is a Intel P4, 3.20GHz + 1G. The development machine is
> an AMD X2 3800+ dual
> processor with 2G memory. Subjectively, I feel the development machine is
> noticeably faster in most
> ways.
> On the remote machine, I execute a SP which inserts approximately 6000
> records. From the profiler, I
> see each insertion takes about 50 Reads and about 0 Duration, which is
> acceptable.
> After synchronizing the database logins with the those in the Master table
> on the development
> machine, I execute the same SP on the development machine. The Reads are
> about 7500 and the Duration
> around 3200!
> Can anyone suggest reasons why this differential might occur? I really do
> need help. I'm not a DBA
> but a developer. But it doesn't take a DBA to know that this won't fly.
> TIA
|||Thanks for the reply, Andrew. I'm sorry to say it had no effect.
On Tue, 4 Oct 2005 18:28:55 -0400, "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote:
>Run sp_updatestats after a restore and then try it.
|||Are you sure there were no indexes added to the remote machine between the
time the backup was created and now? If the stats are the same (try running
in on the remote machine and see if it changes) then they should be the same
plan. Can you post the code for the sp?
Andrew J. Kelly SQL MVP
"larzeb" <larzeb@.community.nospam> wrote in message
news:bg46k11u0j542q5ua7dddol0g2fqfi58jt@.4ax.com... [vbcol=seagreen]
> Thanks for the reply, Andrew. I'm sorry to say it had no effect.
> On Tue, 4 Oct 2005 18:28:55 -0400, "Andrew J. Kelly"
> <sqlmvpnooospam@.shadhawk.com> wrote:
|||May be optimizer is not using the right indexes, you can try forcing the index.
Mohammed.
"Andrew J. Kelly" wrote:
> Are you sure there were no indexes added to the remote machine between the
> time the backup was created and now? If the stats are the same (try running
> in on the remote machine and see if it changes) then they should be the same
> plan. Can you post the code for the sp?
> --
> Andrew J. Kelly SQL MVP
>
> "larzeb" <larzeb@.community.nospam> wrote in message
> news:bg46k11u0j542q5ua7dddol0g2fqfi58jt@.4ax.com...
>
>
|||You did run sp_updatestats in the correct database context not the default
for [master]?
i.e.
USE [MyDB]
GO
exec sp_updatestats
Nik Marshall-Blank MCSD/MCDBA
Linz, Austria
"larzeb" <larzeb@.community.nospam> wrote in message
news:bg46k11u0j542q5ua7dddol0g2fqfi58jt@.4ax.com... [vbcol=seagreen]
> Thanks for the reply, Andrew. I'm sorry to say it had no effect.
> On Tue, 4 Oct 2005 18:28:55 -0400, "Andrew J. Kelly"
> <sqlmvpnooospam@.shadhawk.com> wrote:
|||Andrew,
Sorry for the delay - DSL down for over 24 hours.
No changes made to anything execpt restoring DB, syncying user ids from Master, and running the
sp_updatestats. I also went to the remote, production machine and copied the BAK file to DVD, rather
than use the compressed BAK. The results were the same.
The SP and associated table definitions follow. I abridged some of the tables for simplicity.
exec usp_Mailings_Ins @.MailCampaignDetailID = 68, @.AddressID = 1639896, @.PersonID = 1659603,
@.BatchID = 411, @.TrayNo = 1, @.SerialNo = 3, @.NextMailDate = 'Dec 31 2100 12:00AM', @.OEL =
N'****************AUTO**5-DIGIT 90210', @.MailID = @.P1 output
select @.P1
CREATE PROCEDURE [dbo].usp_Mailings_Ins
@.MailCampaignDetailID int,
@.AddressID int,
@.PersonID int,
@.BatchID int,
@.TrayNo int,
@.SerialNo int,
@.NextMailDate DATETIME,
@.OEL varchar(50),
@.MailID int OUTPUT
AS
INSERT INTO [dbo].[Mailings] (
[MailCampaignDetailID],
[AddressID],
[PersonID],
[BatchID],
[TrayNo],
[SerialNo],
NextMailDate,
OEL
) VALUES (
@.MailCampaignDetailID,
@.AddressID,
@.PersonID,
@.BatchID,
@.TrayNo,
@.SerialNo,
@.NextMailDate,
@.OEL
)
SET @.MailID = SCOPE_IDENTITY()
GO
CREATE TABLE [dbo].[MailingBatch] (
[BatchID] [int] IDENTITY (1, 1) NOT NULL ,
[CompID] [int] NOT NULL ,
[MailCampaignDetailID] [int] NOT NULL ,
[BatchType] [int] NOT NULL ,
[PostageType] [int] NULL ,
[Cost] [decimal](18, 0) NOT NULL ,
[parameters] [varchar] (2000) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[dateAdded] [datetime] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[MailCampaignDetail] (
[MailCampaignDetailID] [int] IDENTITY (1, 1) NOT NULL ,
[MailCampaignID] [int] NOT NULL ,
...
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[AddressValid] (
[AddressID] [int] NOT NULL ,
...
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Person] (
[PersonID] [int] IDENTITY (1, 1) NOT NULL ,
[AddressID] [int] NOT NULL ,
...
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Mailings] (
[MailID] [int] IDENTITY (1, 1) NOT NULL ,
[MailCampaignDetailID] [int] NOT NULL ,
[AddressID] [int] NOT NULL ,
[PersonID] [int] NOT NULL ,
[BatchID] [int] NULL ,
[TrayNo] [int] NULL ,
[SerialNo] [int] NULL ,
[NextMailDate] [datetime] NULL ,
[MailDate] [smalldatetime] NOT NULL ,
[OEL] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MailingBatch] WITH NOCHECK ADD
CONSTRAINT [PK_Batch] PRIMARY KEY CLUSTERED
(
[BatchID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MailCampaignDetail] WITH NOCHECK ADD
CONSTRAINT [PK_MailCampaignDetail] PRIMARY KEY CLUSTERED
(
[MailCampaignDetailID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AddressValid] WITH NOCHECK ADD
CONSTRAINT [PK_AddressValid] PRIMARY KEY CLUSTERED
(
[AddressID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Person] WITH NOCHECK ADD
CONSTRAINT [PK_Person] PRIMARY KEY CLUSTERED
(
[PersonID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Mailings] WITH NOCHECK ADD
CONSTRAINT [PK_Mailings] PRIMARY KEY CLUSTERED
(
[MailID]
) ON [PRIMARY]
GO
CREATE INDEX [IX_Mailings_BatchID] ON [dbo].[Mailings]([BatchID], [SerialNo]) ON [PRIMARY]
GO
CREATE INDEX [IX_Mailings_PersonID] ON [dbo].[Mailings]([PersonID]) ON [PRIMARY]
GO
CREATE INDEX [IX_Mailings_MCDID_AddressID] ON [dbo].[Mailings]([MailCampaignDetailID],
[AddressID]) ON [PRIMARY]
GO
CREATE INDEX [IX_Mailings_AddressID] ON [dbo].[Mailings]([AddressID]) ON [PRIMARY]
GO
CREATE INDEX [Mailings27] ON [dbo].[Mailings]([AddressID], [MailCampaignDetailID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Mailings] ADD
CONSTRAINT [FK_Mailings_AddressValid] FOREIGN KEY
(
[AddressID]
) REFERENCES [dbo].[AddressValid] (
[AddressID]
),
CONSTRAINT [FK_Mailings_MCD] FOREIGN KEY
(
[MailCampaignDetailID]
) REFERENCES [dbo].[MailCampaignDetail] (
[MailCampaignDetailID]
),
CONSTRAINT [FK_Mailings_Person] FOREIGN KEY
(
[PersonID]
) REFERENCES [dbo].[Person] (
[PersonID]
)
GO
On Tue, 4 Oct 2005 19:54:56 -0400, "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote:
>Are you sure there were no indexes added to the remote machine between the
>time the backup was created and now? If the stats are the same (try running
>in on the remote machine and see if it changes) then they should be the same
>plan. Can you post the code for the sp?
|||I was sure I ran sp_updatestats against the appropriate DB.
On Wed, 05 Oct 2005 06:13:44 GMT, "Nik Marshall-Blank" <Nik@.here.com> wrote:
>You did run sp_updatestats in the correct database context not the default
>for [master]?
>i.e.
>USE [MyDB]
>GO
>exec sp_updatestats
|||Mohammed,
I'm afraid I don't know how to "force" an index. Can you give me an example?
On Tue, 4 Oct 2005 18:08:03 -0700, "Mohammed" <Mohammed@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>May be optimizer is not using the right indexes, you can try forcing the index.
>Mohammed.
>"Andrew J. Kelly" wrote:
|||Well one thing I see is that you should put SET NOCOUNT ON at the beginning
of your sp but that should be the same on both.
Andrew J. Kelly SQL MVP
"larzeb" <larzeb@.community.nospam> wrote in message
news:fs4bk1de83u04keblbk0qnnr0hit4fvtae@.4ax.com... [vbcol=seagreen]
> Andrew,
> Sorry for the delay - DSL down for over 24 hours.
> No changes made to anything execpt restoring DB, syncying user ids from
> Master, and running the
> sp_updatestats. I also went to the remote, production machine and copied
> the BAK file to DVD, rather
> than use the compressed BAK. The results were the same.
> The SP and associated table definitions follow. I abridged some of the
> tables for simplicity.
> exec usp_Mailings_Ins @.MailCampaignDetailID = 68, @.AddressID = 1639896,
> @.PersonID = 1659603,
> @.BatchID = 411, @.TrayNo = 1, @.SerialNo = 3, @.NextMailDate = 'Dec 31 2100
> 12:00AM', @.OEL =
> N'****************AUTO**5-DIGIT 90210', @.MailID = @.P1 output
> select @.P1
> CREATE PROCEDURE [dbo].usp_Mailings_Ins
> @.MailCampaignDetailID int,
> @.AddressID int,
> @.PersonID int,
> @.BatchID int,
> @.TrayNo int,
> @.SerialNo int,
> @.NextMailDate DATETIME,
> @.OEL varchar(50),
> @.MailID int OUTPUT
> AS
> INSERT INTO [dbo].[Mailings] (
> [MailCampaignDetailID],
> [AddressID],
> [PersonID],
> [BatchID],
> [TrayNo],
> [SerialNo],
> NextMailDate,
> OEL
> ) VALUES (
> @.MailCampaignDetailID,
> @.AddressID,
> @.PersonID,
> @.BatchID,
> @.TrayNo,
> @.SerialNo,
> @.NextMailDate,
> @.OEL
> )
> SET @.MailID = SCOPE_IDENTITY()
> GO
> CREATE TABLE [dbo].[MailingBatch] (
> [BatchID] [int] IDENTITY (1, 1) NOT NULL ,
> [CompID] [int] NOT NULL ,
> [MailCampaignDetailID] [int] NOT NULL ,
> [BatchType] [int] NOT NULL ,
> [PostageType] [int] NULL ,
> [Cost] [decimal](18, 0) NOT NULL ,
> [parameters] [varchar] (2000) COLLATE SQL_Latin1_General_CP1_CI_AS NOT
> NULL ,
> [dateAdded] [datetime] NOT NULL
> ) ON [PRIMARY]
> GO
> CREATE TABLE [dbo].[MailCampaignDetail] (
> [MailCampaignDetailID] [int] IDENTITY (1, 1) NOT NULL ,
> [MailCampaignID] [int] NOT NULL ,
> ...
> ) ON [PRIMARY]
> GO
> CREATE TABLE [dbo].[AddressValid] (
> [AddressID] [int] NOT NULL ,
> ...
> ) ON [PRIMARY]
> GO
> CREATE TABLE [dbo].[Person] (
> [PersonID] [int] IDENTITY (1, 1) NOT NULL ,
> [AddressID] [int] NOT NULL ,
> ...
> ) ON [PRIMARY]
> GO
> CREATE TABLE [dbo].[Mailings] (
> [MailID] [int] IDENTITY (1, 1) NOT NULL ,
> [MailCampaignDetailID] [int] NOT NULL ,
> [AddressID] [int] NOT NULL ,
> [PersonID] [int] NOT NULL ,
> [BatchID] [int] NULL ,
> [TrayNo] [int] NULL ,
> [SerialNo] [int] NULL ,
> [NextMailDate] [datetime] NULL ,
> [MailDate] [smalldatetime] NOT NULL ,
> [OEL] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[MailingBatch] WITH NOCHECK ADD
> CONSTRAINT [PK_Batch] PRIMARY KEY CLUSTERED
> (
> [BatchID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[MailCampaignDetail] WITH NOCHECK ADD
> CONSTRAINT [PK_MailCampaignDetail] PRIMARY KEY CLUSTERED
> (
> [MailCampaignDetailID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[AddressValid] WITH NOCHECK ADD
> CONSTRAINT [PK_AddressValid] PRIMARY KEY CLUSTERED
> (
> [AddressID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[Person] WITH NOCHECK ADD
> CONSTRAINT [PK_Person] PRIMARY KEY CLUSTERED
> (
> [PersonID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[Mailings] WITH NOCHECK ADD
> CONSTRAINT [PK_Mailings] PRIMARY KEY CLUSTERED
> (
> [MailID]
> ) ON [PRIMARY]
> GO
> CREATE INDEX [IX_Mailings_BatchID] ON [dbo].[Mailings]([BatchID],
> [SerialNo]) ON [PRIMARY]
> GO
> CREATE INDEX [IX_Mailings_PersonID] ON [dbo].[Mailings]([PersonID]) ON
> [PRIMARY]
> GO
> CREATE INDEX [IX_Mailings_MCDID_AddressID] ON
> [dbo].[Mailings]([MailCampaignDetailID],
> [AddressID]) ON [PRIMARY]
> GO
> CREATE INDEX [IX_Mailings_AddressID] ON [dbo].[Mailings]([AddressID]) ON
> [PRIMARY]
> GO
> CREATE INDEX [Mailings27] ON [dbo].[Mailings]([AddressID],
> [MailCampaignDetailID]) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[Mailings] ADD
> CONSTRAINT [FK_Mailings_AddressValid] FOREIGN KEY
> (
> [AddressID]
> ) REFERENCES [dbo].[AddressValid] (
> [AddressID]
> ),
> CONSTRAINT [FK_Mailings_MCD] FOREIGN KEY
> (
> [MailCampaignDetailID]
> ) REFERENCES [dbo].[MailCampaignDetail] (
> [MailCampaignDetailID]
> ),
> CONSTRAINT [FK_Mailings_Person] FOREIGN KEY
> (
> [PersonID]
> ) REFERENCES [dbo].[Person] (
> [PersonID]
> )
> GO
>
> On Tue, 4 Oct 2005 19:54:56 -0400, "Andrew J. Kelly"
> <sqlmvpnooospam@.shadhawk.com> wrote:
development machine.
The remote machine is a Intel P4, 3.20GHz + 1G. The development machine is an AMD X2 3800+ dual
processor with 2G memory. Subjectively, I feel the development machine is noticeably faster in most
ways.
On the remote machine, I execute a SP which inserts approximately 6000 records. From the profiler, I
see each insertion takes about 50 Reads and about 0 Duration, which is acceptable.
After synchronizing the database logins with the those in the Master table on the development
machine, I execute the same SP on the development machine. The Reads are about 7500 and the Duration
around 3200!
Can anyone suggest reasons why this differential might occur? I really do need help. I'm not a DBA
but a developer. But it doesn't take a DBA to know that this won't fly.
TIA
Run sp_updatestats after a restore and then try it.
Andrew J. Kelly SQL MVP
"larzeb" <larzeb@.community.nospam> wrote in message
news:5os5k15iub07uqubpdqb8acgg7vcaq0grj@.4ax.com...
>I create backups of a remote, production database and copy it after
>compression to a local,
> development machine.
> The remote machine is a Intel P4, 3.20GHz + 1G. The development machine is
> an AMD X2 3800+ dual
> processor with 2G memory. Subjectively, I feel the development machine is
> noticeably faster in most
> ways.
> On the remote machine, I execute a SP which inserts approximately 6000
> records. From the profiler, I
> see each insertion takes about 50 Reads and about 0 Duration, which is
> acceptable.
> After synchronizing the database logins with the those in the Master table
> on the development
> machine, I execute the same SP on the development machine. The Reads are
> about 7500 and the Duration
> around 3200!
> Can anyone suggest reasons why this differential might occur? I really do
> need help. I'm not a DBA
> but a developer. But it doesn't take a DBA to know that this won't fly.
> TIA
|||Thanks for the reply, Andrew. I'm sorry to say it had no effect.
On Tue, 4 Oct 2005 18:28:55 -0400, "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote:
>Run sp_updatestats after a restore and then try it.
|||Are you sure there were no indexes added to the remote machine between the
time the backup was created and now? If the stats are the same (try running
in on the remote machine and see if it changes) then they should be the same
plan. Can you post the code for the sp?
Andrew J. Kelly SQL MVP
"larzeb" <larzeb@.community.nospam> wrote in message
news:bg46k11u0j542q5ua7dddol0g2fqfi58jt@.4ax.com... [vbcol=seagreen]
> Thanks for the reply, Andrew. I'm sorry to say it had no effect.
> On Tue, 4 Oct 2005 18:28:55 -0400, "Andrew J. Kelly"
> <sqlmvpnooospam@.shadhawk.com> wrote:
|||May be optimizer is not using the right indexes, you can try forcing the index.
Mohammed.
"Andrew J. Kelly" wrote:
> Are you sure there were no indexes added to the remote machine between the
> time the backup was created and now? If the stats are the same (try running
> in on the remote machine and see if it changes) then they should be the same
> plan. Can you post the code for the sp?
> --
> Andrew J. Kelly SQL MVP
>
> "larzeb" <larzeb@.community.nospam> wrote in message
> news:bg46k11u0j542q5ua7dddol0g2fqfi58jt@.4ax.com...
>
>
|||You did run sp_updatestats in the correct database context not the default
for [master]?
i.e.
USE [MyDB]
GO
exec sp_updatestats
Nik Marshall-Blank MCSD/MCDBA
Linz, Austria
"larzeb" <larzeb@.community.nospam> wrote in message
news:bg46k11u0j542q5ua7dddol0g2fqfi58jt@.4ax.com... [vbcol=seagreen]
> Thanks for the reply, Andrew. I'm sorry to say it had no effect.
> On Tue, 4 Oct 2005 18:28:55 -0400, "Andrew J. Kelly"
> <sqlmvpnooospam@.shadhawk.com> wrote:
|||Andrew,
Sorry for the delay - DSL down for over 24 hours.
No changes made to anything execpt restoring DB, syncying user ids from Master, and running the
sp_updatestats. I also went to the remote, production machine and copied the BAK file to DVD, rather
than use the compressed BAK. The results were the same.
The SP and associated table definitions follow. I abridged some of the tables for simplicity.
exec usp_Mailings_Ins @.MailCampaignDetailID = 68, @.AddressID = 1639896, @.PersonID = 1659603,
@.BatchID = 411, @.TrayNo = 1, @.SerialNo = 3, @.NextMailDate = 'Dec 31 2100 12:00AM', @.OEL =
N'****************AUTO**5-DIGIT 90210', @.MailID = @.P1 output
select @.P1
CREATE PROCEDURE [dbo].usp_Mailings_Ins
@.MailCampaignDetailID int,
@.AddressID int,
@.PersonID int,
@.BatchID int,
@.TrayNo int,
@.SerialNo int,
@.NextMailDate DATETIME,
@.OEL varchar(50),
@.MailID int OUTPUT
AS
INSERT INTO [dbo].[Mailings] (
[MailCampaignDetailID],
[AddressID],
[PersonID],
[BatchID],
[TrayNo],
[SerialNo],
NextMailDate,
OEL
) VALUES (
@.MailCampaignDetailID,
@.AddressID,
@.PersonID,
@.BatchID,
@.TrayNo,
@.SerialNo,
@.NextMailDate,
@.OEL
)
SET @.MailID = SCOPE_IDENTITY()
GO
CREATE TABLE [dbo].[MailingBatch] (
[BatchID] [int] IDENTITY (1, 1) NOT NULL ,
[CompID] [int] NOT NULL ,
[MailCampaignDetailID] [int] NOT NULL ,
[BatchType] [int] NOT NULL ,
[PostageType] [int] NULL ,
[Cost] [decimal](18, 0) NOT NULL ,
[parameters] [varchar] (2000) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[dateAdded] [datetime] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[MailCampaignDetail] (
[MailCampaignDetailID] [int] IDENTITY (1, 1) NOT NULL ,
[MailCampaignID] [int] NOT NULL ,
...
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[AddressValid] (
[AddressID] [int] NOT NULL ,
...
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Person] (
[PersonID] [int] IDENTITY (1, 1) NOT NULL ,
[AddressID] [int] NOT NULL ,
...
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Mailings] (
[MailID] [int] IDENTITY (1, 1) NOT NULL ,
[MailCampaignDetailID] [int] NOT NULL ,
[AddressID] [int] NOT NULL ,
[PersonID] [int] NOT NULL ,
[BatchID] [int] NULL ,
[TrayNo] [int] NULL ,
[SerialNo] [int] NULL ,
[NextMailDate] [datetime] NULL ,
[MailDate] [smalldatetime] NOT NULL ,
[OEL] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MailingBatch] WITH NOCHECK ADD
CONSTRAINT [PK_Batch] PRIMARY KEY CLUSTERED
(
[BatchID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MailCampaignDetail] WITH NOCHECK ADD
CONSTRAINT [PK_MailCampaignDetail] PRIMARY KEY CLUSTERED
(
[MailCampaignDetailID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AddressValid] WITH NOCHECK ADD
CONSTRAINT [PK_AddressValid] PRIMARY KEY CLUSTERED
(
[AddressID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Person] WITH NOCHECK ADD
CONSTRAINT [PK_Person] PRIMARY KEY CLUSTERED
(
[PersonID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Mailings] WITH NOCHECK ADD
CONSTRAINT [PK_Mailings] PRIMARY KEY CLUSTERED
(
[MailID]
) ON [PRIMARY]
GO
CREATE INDEX [IX_Mailings_BatchID] ON [dbo].[Mailings]([BatchID], [SerialNo]) ON [PRIMARY]
GO
CREATE INDEX [IX_Mailings_PersonID] ON [dbo].[Mailings]([PersonID]) ON [PRIMARY]
GO
CREATE INDEX [IX_Mailings_MCDID_AddressID] ON [dbo].[Mailings]([MailCampaignDetailID],
[AddressID]) ON [PRIMARY]
GO
CREATE INDEX [IX_Mailings_AddressID] ON [dbo].[Mailings]([AddressID]) ON [PRIMARY]
GO
CREATE INDEX [Mailings27] ON [dbo].[Mailings]([AddressID], [MailCampaignDetailID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Mailings] ADD
CONSTRAINT [FK_Mailings_AddressValid] FOREIGN KEY
(
[AddressID]
) REFERENCES [dbo].[AddressValid] (
[AddressID]
),
CONSTRAINT [FK_Mailings_MCD] FOREIGN KEY
(
[MailCampaignDetailID]
) REFERENCES [dbo].[MailCampaignDetail] (
[MailCampaignDetailID]
),
CONSTRAINT [FK_Mailings_Person] FOREIGN KEY
(
[PersonID]
) REFERENCES [dbo].[Person] (
[PersonID]
)
GO
On Tue, 4 Oct 2005 19:54:56 -0400, "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote:
>Are you sure there were no indexes added to the remote machine between the
>time the backup was created and now? If the stats are the same (try running
>in on the remote machine and see if it changes) then they should be the same
>plan. Can you post the code for the sp?
|||I was sure I ran sp_updatestats against the appropriate DB.
On Wed, 05 Oct 2005 06:13:44 GMT, "Nik Marshall-Blank" <Nik@.here.com> wrote:
>You did run sp_updatestats in the correct database context not the default
>for [master]?
>i.e.
>USE [MyDB]
>GO
>exec sp_updatestats
|||Mohammed,
I'm afraid I don't know how to "force" an index. Can you give me an example?
On Tue, 4 Oct 2005 18:08:03 -0700, "Mohammed" <Mohammed@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>May be optimizer is not using the right indexes, you can try forcing the index.
>Mohammed.
>"Andrew J. Kelly" wrote:
|||Well one thing I see is that you should put SET NOCOUNT ON at the beginning
of your sp but that should be the same on both.
Andrew J. Kelly SQL MVP
"larzeb" <larzeb@.community.nospam> wrote in message
news:fs4bk1de83u04keblbk0qnnr0hit4fvtae@.4ax.com... [vbcol=seagreen]
> Andrew,
> Sorry for the delay - DSL down for over 24 hours.
> No changes made to anything execpt restoring DB, syncying user ids from
> Master, and running the
> sp_updatestats. I also went to the remote, production machine and copied
> the BAK file to DVD, rather
> than use the compressed BAK. The results were the same.
> The SP and associated table definitions follow. I abridged some of the
> tables for simplicity.
> exec usp_Mailings_Ins @.MailCampaignDetailID = 68, @.AddressID = 1639896,
> @.PersonID = 1659603,
> @.BatchID = 411, @.TrayNo = 1, @.SerialNo = 3, @.NextMailDate = 'Dec 31 2100
> 12:00AM', @.OEL =
> N'****************AUTO**5-DIGIT 90210', @.MailID = @.P1 output
> select @.P1
> CREATE PROCEDURE [dbo].usp_Mailings_Ins
> @.MailCampaignDetailID int,
> @.AddressID int,
> @.PersonID int,
> @.BatchID int,
> @.TrayNo int,
> @.SerialNo int,
> @.NextMailDate DATETIME,
> @.OEL varchar(50),
> @.MailID int OUTPUT
> AS
> INSERT INTO [dbo].[Mailings] (
> [MailCampaignDetailID],
> [AddressID],
> [PersonID],
> [BatchID],
> [TrayNo],
> [SerialNo],
> NextMailDate,
> OEL
> ) VALUES (
> @.MailCampaignDetailID,
> @.AddressID,
> @.PersonID,
> @.BatchID,
> @.TrayNo,
> @.SerialNo,
> @.NextMailDate,
> @.OEL
> )
> SET @.MailID = SCOPE_IDENTITY()
> GO
> CREATE TABLE [dbo].[MailingBatch] (
> [BatchID] [int] IDENTITY (1, 1) NOT NULL ,
> [CompID] [int] NOT NULL ,
> [MailCampaignDetailID] [int] NOT NULL ,
> [BatchType] [int] NOT NULL ,
> [PostageType] [int] NULL ,
> [Cost] [decimal](18, 0) NOT NULL ,
> [parameters] [varchar] (2000) COLLATE SQL_Latin1_General_CP1_CI_AS NOT
> NULL ,
> [dateAdded] [datetime] NOT NULL
> ) ON [PRIMARY]
> GO
> CREATE TABLE [dbo].[MailCampaignDetail] (
> [MailCampaignDetailID] [int] IDENTITY (1, 1) NOT NULL ,
> [MailCampaignID] [int] NOT NULL ,
> ...
> ) ON [PRIMARY]
> GO
> CREATE TABLE [dbo].[AddressValid] (
> [AddressID] [int] NOT NULL ,
> ...
> ) ON [PRIMARY]
> GO
> CREATE TABLE [dbo].[Person] (
> [PersonID] [int] IDENTITY (1, 1) NOT NULL ,
> [AddressID] [int] NOT NULL ,
> ...
> ) ON [PRIMARY]
> GO
> CREATE TABLE [dbo].[Mailings] (
> [MailID] [int] IDENTITY (1, 1) NOT NULL ,
> [MailCampaignDetailID] [int] NOT NULL ,
> [AddressID] [int] NOT NULL ,
> [PersonID] [int] NOT NULL ,
> [BatchID] [int] NULL ,
> [TrayNo] [int] NULL ,
> [SerialNo] [int] NULL ,
> [NextMailDate] [datetime] NULL ,
> [MailDate] [smalldatetime] NOT NULL ,
> [OEL] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[MailingBatch] WITH NOCHECK ADD
> CONSTRAINT [PK_Batch] PRIMARY KEY CLUSTERED
> (
> [BatchID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[MailCampaignDetail] WITH NOCHECK ADD
> CONSTRAINT [PK_MailCampaignDetail] PRIMARY KEY CLUSTERED
> (
> [MailCampaignDetailID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[AddressValid] WITH NOCHECK ADD
> CONSTRAINT [PK_AddressValid] PRIMARY KEY CLUSTERED
> (
> [AddressID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[Person] WITH NOCHECK ADD
> CONSTRAINT [PK_Person] PRIMARY KEY CLUSTERED
> (
> [PersonID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[Mailings] WITH NOCHECK ADD
> CONSTRAINT [PK_Mailings] PRIMARY KEY CLUSTERED
> (
> [MailID]
> ) ON [PRIMARY]
> GO
> CREATE INDEX [IX_Mailings_BatchID] ON [dbo].[Mailings]([BatchID],
> [SerialNo]) ON [PRIMARY]
> GO
> CREATE INDEX [IX_Mailings_PersonID] ON [dbo].[Mailings]([PersonID]) ON
> [PRIMARY]
> GO
> CREATE INDEX [IX_Mailings_MCDID_AddressID] ON
> [dbo].[Mailings]([MailCampaignDetailID],
> [AddressID]) ON [PRIMARY]
> GO
> CREATE INDEX [IX_Mailings_AddressID] ON [dbo].[Mailings]([AddressID]) ON
> [PRIMARY]
> GO
> CREATE INDEX [Mailings27] ON [dbo].[Mailings]([AddressID],
> [MailCampaignDetailID]) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[Mailings] ADD
> CONSTRAINT [FK_Mailings_AddressValid] FOREIGN KEY
> (
> [AddressID]
> ) REFERENCES [dbo].[AddressValid] (
> [AddressID]
> ),
> CONSTRAINT [FK_Mailings_MCD] FOREIGN KEY
> (
> [MailCampaignDetailID]
> ) REFERENCES [dbo].[MailCampaignDetail] (
> [MailCampaignDetailID]
> ),
> CONSTRAINT [FK_Mailings_Person] FOREIGN KEY
> (
> [PersonID]
> ) REFERENCES [dbo].[Person] (
> [PersonID]
> )
> GO
>
> On Tue, 4 Oct 2005 19:54:56 -0400, "Andrew J. Kelly"
> <sqlmvpnooospam@.shadhawk.com> wrote:
Bizarre performance hit
I create backups of a remote, production database and copy it after compress
ion to a local,
development machine.
The remote machine is a Intel P4, 3.20GHz + 1G. The development machine is a
n AMD X2 3800+ dual
processor with 2G memory. Subjectively, I feel the development machine is no
ticeably faster in most
ways.
On the remote machine, I execute a SP which inserts approximately 6000 recor
ds. From the profiler, I
see each insertion takes about 50 Reads and about 0 Duration, which is accep
table.
After synchronizing the database logins with the those in the Master table o
n the development
machine, I execute the same SP on the development machine. The Reads are abo
ut 7500 and the Duration
around 3200!
Can anyone suggest reasons why this differential might occur? I really do ne
ed help. I'm not a DBA
but a developer. But it doesn't take a DBA to know that this won't fly.
TIARun sp_updatestats after a restore and then try it.
Andrew J. Kelly SQL MVP
"larzeb" <larzeb@.community.nospam> wrote in message
news:5os5k15iub07uqubpdqb8acgg7vcaq0grj@.
4ax.com...
>I create backups of a remote, production database and copy it after
>compression to a local,
> development machine.
> The remote machine is a Intel P4, 3.20GHz + 1G. The development machine is
> an AMD X2 3800+ dual
> processor with 2G memory. Subjectively, I feel the development machine is
> noticeably faster in most
> ways.
> On the remote machine, I execute a SP which inserts approximately 6000
> records. From the profiler, I
> see each insertion takes about 50 Reads and about 0 Duration, which is
> acceptable.
> After synchronizing the database logins with the those in the Master table
> on the development
> machine, I execute the same SP on the development machine. The Reads are
> about 7500 and the Duration
> around 3200!
> Can anyone suggest reasons why this differential might occur? I really do
> need help. I'm not a DBA
> but a developer. But it doesn't take a DBA to know that this won't fly.
> TIA|||Thanks for the reply, Andrew. I'm sorry to say it had no effect.
On Tue, 4 Oct 2005 18:28:55 -0400, "Andrew J. Kelly" <sqlmvpnooospam@.shadhaw
k.com> wrote:
>Run sp_updatestats after a restore and then try it.|||Are you sure there were no indexes added to the remote machine between the
time the backup was created and now? If the stats are the same (try running
in on the remote machine and see if it changes) then they should be the same
plan. Can you post the code for the sp?
Andrew J. Kelly SQL MVP
"larzeb" <larzeb@.community.nospam> wrote in message
news:bg46k11u0j542q5ua7dddol0g2fqfi58jt@.
4ax.com...[vbcol=seagreen]
> Thanks for the reply, Andrew. I'm sorry to say it had no effect.
> On Tue, 4 Oct 2005 18:28:55 -0400, "Andrew J. Kelly"
> <sqlmvpnooospam@.shadhawk.com> wrote:
>|||May be optimizer is not using the right indexes, you can try forcing the ind
ex.
Mohammed.
"Andrew J. Kelly" wrote:
> Are you sure there were no indexes added to the remote machine between the
> time the backup was created and now? If the stats are the same (try runni
ng
> in on the remote machine and see if it changes) then they should be the sa
me
> plan. Can you post the code for the sp?
> --
> Andrew J. Kelly SQL MVP
>
> "larzeb" <larzeb@.community.nospam> wrote in message
> news:bg46k11u0j542q5ua7dddol0g2fqfi58jt@.
4ax.com...
>
>|||You did run sp_updatestats in the correct database context not the default
for [master]?
i.e.
USE [MyDB]
GO
exec sp_updatestats
Nik Marshall-Blank MCSD/MCDBA
Linz, Austria
"larzeb" <larzeb@.community.nospam> wrote in message
news:bg46k11u0j542q5ua7dddol0g2fqfi58jt@.
4ax.com...[vbcol=seagreen]
> Thanks for the reply, Andrew. I'm sorry to say it had no effect.
> On Tue, 4 Oct 2005 18:28:55 -0400, "Andrew J. Kelly"
> <sqlmvpnooospam@.shadhawk.com> wrote:
>|||Andrew,
Sorry for the delay - DSL down for over 24 hours.
No changes made to anything execpt restoring DB, syncying user ids from Mast
er, and running the
sp_updatestats. I also went to the remote, production machine and copied the
BAK file to DVD, rather
than use the compressed BAK. The results were the same.
The SP and associated table definitions follow. I abridged some of the table
s for simplicity.
exec usp_Mailings_Ins @.MailCampaignDetailID = 68, @.AddressID = 1639896, @.Per
sonID = 1659603,
@.BatchID = 411, @.TrayNo = 1, @.SerialNo = 3, @.NextMailDate = 'Dec 31 2100 12:
00AM', @.OEL =
N'****************AUTO**5-DIGIT 90210', @.MailID = @.P1 output
select @.P1
CREATE PROCEDURE [dbo].usp_Mailings_Ins
@.MailCampaignDetailID int,
@.AddressID int,
@.PersonID int,
@.BatchID int,
@.TrayNo int,
@.SerialNo int,
@.NextMailDate DATETIME,
@.OEL varchar(50),
@.MailID int OUTPUT
AS
INSERT INTO [dbo].[Mailings] (
[MailCampaignDetailID],
[AddressID],
[PersonID],
[BatchID],
[TrayNo],
[SerialNo],
NextMailDate,
OEL
) VALUES (
@.MailCampaignDetailID,
@.AddressID,
@.PersonID,
@.BatchID,
@.TrayNo,
@.SerialNo,
@.NextMailDate,
@.OEL
)
SET @.MailID = SCOPE_IDENTITY()
GO
CREATE TABLE [dbo].[MailingBatch] (
[BatchID] [int] IDENTITY (1, 1) NOT NULL ,
[CompID] [int] NOT NULL ,
[MailCampaignDetailID] [int] NOT NULL ,
[BatchType] [int] NOT NULL ,
[PostageType] [int] NULL ,
[Cost] [decimal](18, 0) NOT NULL ,
[parameters] [varchar] (2000) COLLATE SQL_Latin1_General_CP1_CI_AS N
OT NULL ,
[dateAdded] [datetime] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[MailCampaignDetail] (
[MailCampaignDetailID] [int] IDENTITY (1, 1) NOT NULL ,
[MailCampaignID] [int] NOT NULL ,
..
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[AddressValid] (
[AddressID] [int] NOT NULL ,
..
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Person] (
[PersonID] [int] IDENTITY (1, 1) NOT NULL ,
[AddressID] [int] NOT NULL ,
..
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Mailings] (
[MailID] [int] IDENTITY (1, 1) NOT NULL ,
[MailCampaignDetailID] [int] NOT NULL ,
[AddressID] [int] NOT NULL ,
[PersonID] [int] NOT NULL ,
[BatchID] [int] NULL ,
[TrayNo] [int] NULL ,
[SerialNo] [int] NULL ,
[NextMailDate] [datetime] NULL ,
[MailDate] [smalldatetime] NOT NULL ,
[OEL] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MailingBatch] WITH NOCHECK ADD
CONSTRAINT [PK_Batch] PRIMARY KEY CLUSTERED
(
[BatchID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MailCampaignDetail] WITH NOCHECK ADD
CONSTRAINT [PK_MailCampaignDetail] PRIMARY KEY CLUSTERED
(
[MailCampaignDetailID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AddressValid] WITH NOCHECK ADD
CONSTRAINT [PK_AddressValid] PRIMARY KEY CLUSTERED
(
[AddressID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Person] WITH NOCHECK ADD
CONSTRAINT [PK_Person] PRIMARY KEY CLUSTERED
(
[PersonID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Mailings] WITH NOCHECK ADD
CONSTRAINT [PK_Mailings] PRIMARY KEY CLUSTERED
(
[MailID]
) ON [PRIMARY]
GO
CREATE INDEX [IX_Mailings_BatchID] ON [dbo].[Mailings]([Bat
chID], [SerialNo]) ON [PRIMARY]
GO
CREATE INDEX [IX_Mailings_PersonID] ON [dbo].[Mailings]([Pe
rsonID]) ON [PRIMARY]
GO
CREATE INDEX [IX_Mailings_MCDID_AddressID] ON [dbo].[Mailings](
[MailCampaignDetailID],
[AddressID]) ON [PRIMARY]
GO
CREATE INDEX [IX_Mailings_AddressID] ON [dbo].[Mailings]([A
ddressID]) ON [PRIMARY]
GO
CREATE INDEX [Mailings27] ON [dbo].[Mailings]([AddressID],
[MailCampaignDetailID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Mailings] ADD
CONSTRAINT [FK_Mailings_AddressValid] FOREIGN KEY
(
[AddressID]
) REFERENCES [dbo].[AddressValid] (
[AddressID]
),
CONSTRAINT [FK_Mailings_MCD] FOREIGN KEY
(
[MailCampaignDetailID]
) REFERENCES [dbo].[MailCampaignDetail] (
[MailCampaignDetailID]
),
CONSTRAINT [FK_Mailings_Person] FOREIGN KEY
(
[PersonID]
) REFERENCES [dbo].[Person] (
[PersonID]
)
GO
On Tue, 4 Oct 2005 19:54:56 -0400, "Andrew J. Kelly" <sqlmvpnooospam@.shadhaw
k.com> wrote:
>Are you sure there were no indexes added to the remote machine between the
>time the backup was created and now? If the stats are the same (try runnin
g
>in on the remote machine and see if it changes) then they should be the sam
e
>plan. Can you post the code for the sp?|||I was sure I ran sp_updatestats against the appropriate DB.
On Wed, 05 Oct 2005 06:13:44 GMT, "Nik Marshall-Blank" <Nik@.here.com> wrote:
>You did run sp_updatestats in the correct database context not the default
>for [master]?
>i.e.
>USE [MyDB]
>GO
>exec sp_updatestats|||Mohammed,
I'm afraid I don't know how to "force" an index. Can you give me an example?
On Tue, 4 Oct 2005 18:08:03 -0700, "Mohammed" <Mohammed@.discussions.microsof
t.com> wrote:
[vbcol=seagreen]
>May be optimizer is not using the right indexes, you can try forcing the in
dex.
>Mohammed.
>"Andrew J. Kelly" wrote:
>|||Well one thing I see is that you should put SET NOCOUNT ON at the beginning
of your sp but that should be the same on both.
Andrew J. Kelly SQL MVP
"larzeb" <larzeb@.community.nospam> wrote in message
news:fs4bk1de83u04keblbk0qnnr0hit4fvtae@.
4ax.com...[vbcol=seagreen]
> Andrew,
> Sorry for the delay - DSL down for over 24 hours.
> No changes made to anything execpt restoring DB, syncying user ids from
> Master, and running the
> sp_updatestats. I also went to the remote, production machine and copied
> the BAK file to DVD, rather
> than use the compressed BAK. The results were the same.
> The SP and associated table definitions follow. I abridged some of the
> tables for simplicity.
> exec usp_Mailings_Ins @.MailCampaignDetailID = 68, @.AddressID = 1639896,
> @.PersonID = 1659603,
> @.BatchID = 411, @.TrayNo = 1, @.SerialNo = 3, @.NextMailDate = 'Dec 31 2100
> 12:00AM', @.OEL =
> N'****************AUTO**5-DIGIT 90210', @.MailID = @.P1 output
> select @.P1
> CREATE PROCEDURE [dbo].usp_Mailings_Ins
> @.MailCampaignDetailID int,
> @.AddressID int,
> @.PersonID int,
> @.BatchID int,
> @.TrayNo int,
> @.SerialNo int,
> @.NextMailDate DATETIME,
> @.OEL varchar(50),
> @.MailID int OUTPUT
> AS
> INSERT INTO [dbo].[Mailings] (
> [MailCampaignDetailID],
> [AddressID],
> [PersonID],
> [BatchID],
> [TrayNo],
> [SerialNo],
> NextMailDate,
> OEL
> ) VALUES (
> @.MailCampaignDetailID,
> @.AddressID,
> @.PersonID,
> @.BatchID,
> @.TrayNo,
> @.SerialNo,
> @.NextMailDate,
> @.OEL
> )
> SET @.MailID = SCOPE_IDENTITY()
> GO
> CREATE TABLE [dbo].[MailingBatch] (
> [BatchID] [int] IDENTITY (1, 1) NOT NULL ,
> [CompID] [int] NOT NULL ,
> [MailCampaignDetailID] [int] NOT NULL ,
> [BatchType] [int] NOT NULL ,
> [PostageType] [int] NULL ,
> [Cost] [decimal](18, 0) NOT NULL ,
> [parameters] [varchar] (2000) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT
> NULL ,
> [dateAdded] [datetime] NOT NULL
> ) ON [PRIMARY]
> GO
> CREATE TABLE [dbo].[MailCampaignDetail] (
> [MailCampaignDetailID] [int] IDENTITY (1, 1) NOT NULL ,
> [MailCampaignID] [int] NOT NULL ,
> ...
> ) ON [PRIMARY]
> GO
> CREATE TABLE [dbo].[AddressValid] (
> [AddressID] [int] NOT NULL ,
> ...
> ) ON [PRIMARY]
> GO
> CREATE TABLE [dbo].[Person] (
> [PersonID] [int] IDENTITY (1, 1) NOT NULL ,
> [AddressID] [int] NOT NULL ,
> ...
> ) ON [PRIMARY]
> GO
> CREATE TABLE [dbo].[Mailings] (
> [MailID] [int] IDENTITY (1, 1) NOT NULL ,
> [MailCampaignDetailID] [int] NOT NULL ,
> [AddressID] [int] NOT NULL ,
> [PersonID] [int] NOT NULL ,
> [BatchID] [int] NULL ,
> [TrayNo] [int] NULL ,
> [SerialNo] [int] NULL ,
> [NextMailDate] [datetime] NULL ,
> [MailDate] [smalldatetime] NOT NULL ,
> [OEL] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[MailingBatch] WITH NOCHECK ADD
> CONSTRAINT [PK_Batch] PRIMARY KEY CLUSTERED
> (
> [BatchID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[MailCampaignDetail] WITH NOCHECK ADD
> CONSTRAINT [PK_MailCampaignDetail] PRIMARY KEY CLUSTERED
> (
> [MailCampaignDetailID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[AddressValid] WITH NOCHECK ADD
> CONSTRAINT [PK_AddressValid] PRIMARY KEY CLUSTERED
> (
> [AddressID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[Person] WITH NOCHECK ADD
> CONSTRAINT [PK_Person] PRIMARY KEY CLUSTERED
> (
> [PersonID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[Mailings] WITH NOCHECK ADD
> CONSTRAINT [PK_Mailings] PRIMARY KEY CLUSTERED
> (
> [MailID]
> ) ON [PRIMARY]
> GO
> CREATE INDEX [IX_Mailings_BatchID] ON [dbo].[Mailings]([B
atchID],
> [SerialNo]) ON [PRIMARY]
> GO
> CREATE INDEX [IX_Mailings_PersonID] ON [dbo].[Mailings]([
PersonID]) ON
> [PRIMARY]
> GO
> CREATE INDEX [IX_Mailings_MCDID_AddressID] ON
> [dbo].[Mailings]([MailCampaignDetailID],
> [AddressID]) ON [PRIMARY]
> GO
> CREATE INDEX [IX_Mailings_AddressID] ON [dbo].[Mailings]([
;AddressID]) ON
> [PRIMARY]
> GO
> CREATE INDEX [Mailings27] ON [dbo].[Mailings]([AddressID]
,
> [MailCampaignDetailID]) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[Mailings] ADD
> CONSTRAINT [FK_Mailings_AddressValid] FOREIGN KEY
> (
> [AddressID]
> ) REFERENCES [dbo].[AddressValid] (
> [AddressID]
> ),
> CONSTRAINT [FK_Mailings_MCD] FOREIGN KEY
> (
> [MailCampaignDetailID]
> ) REFERENCES [dbo].[MailCampaignDetail] (
> [MailCampaignDetailID]
> ),
> CONSTRAINT [FK_Mailings_Person] FOREIGN KEY
> (
> [PersonID]
> ) REFERENCES [dbo].[Person] (
> [PersonID]
> )
> GO
>
> On Tue, 4 Oct 2005 19:54:56 -0400, "Andrew J. Kelly"
> <sqlmvpnooospam@.shadhawk.com> wrote:
>
ion to a local,
development machine.
The remote machine is a Intel P4, 3.20GHz + 1G. The development machine is a
n AMD X2 3800+ dual
processor with 2G memory. Subjectively, I feel the development machine is no
ticeably faster in most
ways.
On the remote machine, I execute a SP which inserts approximately 6000 recor
ds. From the profiler, I
see each insertion takes about 50 Reads and about 0 Duration, which is accep
table.
After synchronizing the database logins with the those in the Master table o
n the development
machine, I execute the same SP on the development machine. The Reads are abo
ut 7500 and the Duration
around 3200!
Can anyone suggest reasons why this differential might occur? I really do ne
ed help. I'm not a DBA
but a developer. But it doesn't take a DBA to know that this won't fly.
TIARun sp_updatestats after a restore and then try it.
Andrew J. Kelly SQL MVP
"larzeb" <larzeb@.community.nospam> wrote in message
news:5os5k15iub07uqubpdqb8acgg7vcaq0grj@.
4ax.com...
>I create backups of a remote, production database and copy it after
>compression to a local,
> development machine.
> The remote machine is a Intel P4, 3.20GHz + 1G. The development machine is
> an AMD X2 3800+ dual
> processor with 2G memory. Subjectively, I feel the development machine is
> noticeably faster in most
> ways.
> On the remote machine, I execute a SP which inserts approximately 6000
> records. From the profiler, I
> see each insertion takes about 50 Reads and about 0 Duration, which is
> acceptable.
> After synchronizing the database logins with the those in the Master table
> on the development
> machine, I execute the same SP on the development machine. The Reads are
> about 7500 and the Duration
> around 3200!
> Can anyone suggest reasons why this differential might occur? I really do
> need help. I'm not a DBA
> but a developer. But it doesn't take a DBA to know that this won't fly.
> TIA|||Thanks for the reply, Andrew. I'm sorry to say it had no effect.
On Tue, 4 Oct 2005 18:28:55 -0400, "Andrew J. Kelly" <sqlmvpnooospam@.shadhaw
k.com> wrote:
>Run sp_updatestats after a restore and then try it.|||Are you sure there were no indexes added to the remote machine between the
time the backup was created and now? If the stats are the same (try running
in on the remote machine and see if it changes) then they should be the same
plan. Can you post the code for the sp?
Andrew J. Kelly SQL MVP
"larzeb" <larzeb@.community.nospam> wrote in message
news:bg46k11u0j542q5ua7dddol0g2fqfi58jt@.
4ax.com...[vbcol=seagreen]
> Thanks for the reply, Andrew. I'm sorry to say it had no effect.
> On Tue, 4 Oct 2005 18:28:55 -0400, "Andrew J. Kelly"
> <sqlmvpnooospam@.shadhawk.com> wrote:
>|||May be optimizer is not using the right indexes, you can try forcing the ind
ex.
Mohammed.
"Andrew J. Kelly" wrote:
> Are you sure there were no indexes added to the remote machine between the
> time the backup was created and now? If the stats are the same (try runni
ng
> in on the remote machine and see if it changes) then they should be the sa
me
> plan. Can you post the code for the sp?
> --
> Andrew J. Kelly SQL MVP
>
> "larzeb" <larzeb@.community.nospam> wrote in message
> news:bg46k11u0j542q5ua7dddol0g2fqfi58jt@.
4ax.com...
>
>|||You did run sp_updatestats in the correct database context not the default
for [master]?
i.e.
USE [MyDB]
GO
exec sp_updatestats
Nik Marshall-Blank MCSD/MCDBA
Linz, Austria
"larzeb" <larzeb@.community.nospam> wrote in message
news:bg46k11u0j542q5ua7dddol0g2fqfi58jt@.
4ax.com...[vbcol=seagreen]
> Thanks for the reply, Andrew. I'm sorry to say it had no effect.
> On Tue, 4 Oct 2005 18:28:55 -0400, "Andrew J. Kelly"
> <sqlmvpnooospam@.shadhawk.com> wrote:
>|||Andrew,
Sorry for the delay - DSL down for over 24 hours.
No changes made to anything execpt restoring DB, syncying user ids from Mast
er, and running the
sp_updatestats. I also went to the remote, production machine and copied the
BAK file to DVD, rather
than use the compressed BAK. The results were the same.
The SP and associated table definitions follow. I abridged some of the table
s for simplicity.
exec usp_Mailings_Ins @.MailCampaignDetailID = 68, @.AddressID = 1639896, @.Per
sonID = 1659603,
@.BatchID = 411, @.TrayNo = 1, @.SerialNo = 3, @.NextMailDate = 'Dec 31 2100 12:
00AM', @.OEL =
N'****************AUTO**5-DIGIT 90210', @.MailID = @.P1 output
select @.P1
CREATE PROCEDURE [dbo].usp_Mailings_Ins
@.MailCampaignDetailID int,
@.AddressID int,
@.PersonID int,
@.BatchID int,
@.TrayNo int,
@.SerialNo int,
@.NextMailDate DATETIME,
@.OEL varchar(50),
@.MailID int OUTPUT
AS
INSERT INTO [dbo].[Mailings] (
[MailCampaignDetailID],
[AddressID],
[PersonID],
[BatchID],
[TrayNo],
[SerialNo],
NextMailDate,
OEL
) VALUES (
@.MailCampaignDetailID,
@.AddressID,
@.PersonID,
@.BatchID,
@.TrayNo,
@.SerialNo,
@.NextMailDate,
@.OEL
)
SET @.MailID = SCOPE_IDENTITY()
GO
CREATE TABLE [dbo].[MailingBatch] (
[BatchID] [int] IDENTITY (1, 1) NOT NULL ,
[CompID] [int] NOT NULL ,
[MailCampaignDetailID] [int] NOT NULL ,
[BatchType] [int] NOT NULL ,
[PostageType] [int] NULL ,
[Cost] [decimal](18, 0) NOT NULL ,
[parameters] [varchar] (2000) COLLATE SQL_Latin1_General_CP1_CI_AS N
OT NULL ,
[dateAdded] [datetime] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[MailCampaignDetail] (
[MailCampaignDetailID] [int] IDENTITY (1, 1) NOT NULL ,
[MailCampaignID] [int] NOT NULL ,
..
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[AddressValid] (
[AddressID] [int] NOT NULL ,
..
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Person] (
[PersonID] [int] IDENTITY (1, 1) NOT NULL ,
[AddressID] [int] NOT NULL ,
..
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Mailings] (
[MailID] [int] IDENTITY (1, 1) NOT NULL ,
[MailCampaignDetailID] [int] NOT NULL ,
[AddressID] [int] NOT NULL ,
[PersonID] [int] NOT NULL ,
[BatchID] [int] NULL ,
[TrayNo] [int] NULL ,
[SerialNo] [int] NULL ,
[NextMailDate] [datetime] NULL ,
[MailDate] [smalldatetime] NOT NULL ,
[OEL] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MailingBatch] WITH NOCHECK ADD
CONSTRAINT [PK_Batch] PRIMARY KEY CLUSTERED
(
[BatchID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MailCampaignDetail] WITH NOCHECK ADD
CONSTRAINT [PK_MailCampaignDetail] PRIMARY KEY CLUSTERED
(
[MailCampaignDetailID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AddressValid] WITH NOCHECK ADD
CONSTRAINT [PK_AddressValid] PRIMARY KEY CLUSTERED
(
[AddressID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Person] WITH NOCHECK ADD
CONSTRAINT [PK_Person] PRIMARY KEY CLUSTERED
(
[PersonID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Mailings] WITH NOCHECK ADD
CONSTRAINT [PK_Mailings] PRIMARY KEY CLUSTERED
(
[MailID]
) ON [PRIMARY]
GO
CREATE INDEX [IX_Mailings_BatchID] ON [dbo].[Mailings]([Bat
chID], [SerialNo]) ON [PRIMARY]
GO
CREATE INDEX [IX_Mailings_PersonID] ON [dbo].[Mailings]([Pe
rsonID]) ON [PRIMARY]
GO
CREATE INDEX [IX_Mailings_MCDID_AddressID] ON [dbo].[Mailings](
[MailCampaignDetailID],
[AddressID]) ON [PRIMARY]
GO
CREATE INDEX [IX_Mailings_AddressID] ON [dbo].[Mailings]([A
ddressID]) ON [PRIMARY]
GO
CREATE INDEX [Mailings27] ON [dbo].[Mailings]([AddressID],
[MailCampaignDetailID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Mailings] ADD
CONSTRAINT [FK_Mailings_AddressValid] FOREIGN KEY
(
[AddressID]
) REFERENCES [dbo].[AddressValid] (
[AddressID]
),
CONSTRAINT [FK_Mailings_MCD] FOREIGN KEY
(
[MailCampaignDetailID]
) REFERENCES [dbo].[MailCampaignDetail] (
[MailCampaignDetailID]
),
CONSTRAINT [FK_Mailings_Person] FOREIGN KEY
(
[PersonID]
) REFERENCES [dbo].[Person] (
[PersonID]
)
GO
On Tue, 4 Oct 2005 19:54:56 -0400, "Andrew J. Kelly" <sqlmvpnooospam@.shadhaw
k.com> wrote:
>Are you sure there were no indexes added to the remote machine between the
>time the backup was created and now? If the stats are the same (try runnin
g
>in on the remote machine and see if it changes) then they should be the sam
e
>plan. Can you post the code for the sp?|||I was sure I ran sp_updatestats against the appropriate DB.
On Wed, 05 Oct 2005 06:13:44 GMT, "Nik Marshall-Blank" <Nik@.here.com> wrote:
>You did run sp_updatestats in the correct database context not the default
>for [master]?
>i.e.
>USE [MyDB]
>GO
>exec sp_updatestats|||Mohammed,
I'm afraid I don't know how to "force" an index. Can you give me an example?
On Tue, 4 Oct 2005 18:08:03 -0700, "Mohammed" <Mohammed@.discussions.microsof
t.com> wrote:
[vbcol=seagreen]
>May be optimizer is not using the right indexes, you can try forcing the in
dex.
>Mohammed.
>"Andrew J. Kelly" wrote:
>|||Well one thing I see is that you should put SET NOCOUNT ON at the beginning
of your sp but that should be the same on both.
Andrew J. Kelly SQL MVP
"larzeb" <larzeb@.community.nospam> wrote in message
news:fs4bk1de83u04keblbk0qnnr0hit4fvtae@.
4ax.com...[vbcol=seagreen]
> Andrew,
> Sorry for the delay - DSL down for over 24 hours.
> No changes made to anything execpt restoring DB, syncying user ids from
> Master, and running the
> sp_updatestats. I also went to the remote, production machine and copied
> the BAK file to DVD, rather
> than use the compressed BAK. The results were the same.
> The SP and associated table definitions follow. I abridged some of the
> tables for simplicity.
> exec usp_Mailings_Ins @.MailCampaignDetailID = 68, @.AddressID = 1639896,
> @.PersonID = 1659603,
> @.BatchID = 411, @.TrayNo = 1, @.SerialNo = 3, @.NextMailDate = 'Dec 31 2100
> 12:00AM', @.OEL =
> N'****************AUTO**5-DIGIT 90210', @.MailID = @.P1 output
> select @.P1
> CREATE PROCEDURE [dbo].usp_Mailings_Ins
> @.MailCampaignDetailID int,
> @.AddressID int,
> @.PersonID int,
> @.BatchID int,
> @.TrayNo int,
> @.SerialNo int,
> @.NextMailDate DATETIME,
> @.OEL varchar(50),
> @.MailID int OUTPUT
> AS
> INSERT INTO [dbo].[Mailings] (
> [MailCampaignDetailID],
> [AddressID],
> [PersonID],
> [BatchID],
> [TrayNo],
> [SerialNo],
> NextMailDate,
> OEL
> ) VALUES (
> @.MailCampaignDetailID,
> @.AddressID,
> @.PersonID,
> @.BatchID,
> @.TrayNo,
> @.SerialNo,
> @.NextMailDate,
> @.OEL
> )
> SET @.MailID = SCOPE_IDENTITY()
> GO
> CREATE TABLE [dbo].[MailingBatch] (
> [BatchID] [int] IDENTITY (1, 1) NOT NULL ,
> [CompID] [int] NOT NULL ,
> [MailCampaignDetailID] [int] NOT NULL ,
> [BatchType] [int] NOT NULL ,
> [PostageType] [int] NULL ,
> [Cost] [decimal](18, 0) NOT NULL ,
> [parameters] [varchar] (2000) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT
> NULL ,
> [dateAdded] [datetime] NOT NULL
> ) ON [PRIMARY]
> GO
> CREATE TABLE [dbo].[MailCampaignDetail] (
> [MailCampaignDetailID] [int] IDENTITY (1, 1) NOT NULL ,
> [MailCampaignID] [int] NOT NULL ,
> ...
> ) ON [PRIMARY]
> GO
> CREATE TABLE [dbo].[AddressValid] (
> [AddressID] [int] NOT NULL ,
> ...
> ) ON [PRIMARY]
> GO
> CREATE TABLE [dbo].[Person] (
> [PersonID] [int] IDENTITY (1, 1) NOT NULL ,
> [AddressID] [int] NOT NULL ,
> ...
> ) ON [PRIMARY]
> GO
> CREATE TABLE [dbo].[Mailings] (
> [MailID] [int] IDENTITY (1, 1) NOT NULL ,
> [MailCampaignDetailID] [int] NOT NULL ,
> [AddressID] [int] NOT NULL ,
> [PersonID] [int] NOT NULL ,
> [BatchID] [int] NULL ,
> [TrayNo] [int] NULL ,
> [SerialNo] [int] NULL ,
> [NextMailDate] [datetime] NULL ,
> [MailDate] [smalldatetime] NOT NULL ,
> [OEL] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[MailingBatch] WITH NOCHECK ADD
> CONSTRAINT [PK_Batch] PRIMARY KEY CLUSTERED
> (
> [BatchID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[MailCampaignDetail] WITH NOCHECK ADD
> CONSTRAINT [PK_MailCampaignDetail] PRIMARY KEY CLUSTERED
> (
> [MailCampaignDetailID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[AddressValid] WITH NOCHECK ADD
> CONSTRAINT [PK_AddressValid] PRIMARY KEY CLUSTERED
> (
> [AddressID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[Person] WITH NOCHECK ADD
> CONSTRAINT [PK_Person] PRIMARY KEY CLUSTERED
> (
> [PersonID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[Mailings] WITH NOCHECK ADD
> CONSTRAINT [PK_Mailings] PRIMARY KEY CLUSTERED
> (
> [MailID]
> ) ON [PRIMARY]
> GO
> CREATE INDEX [IX_Mailings_BatchID] ON [dbo].[Mailings]([B
atchID],
> [SerialNo]) ON [PRIMARY]
> GO
> CREATE INDEX [IX_Mailings_PersonID] ON [dbo].[Mailings]([
PersonID]) ON
> [PRIMARY]
> GO
> CREATE INDEX [IX_Mailings_MCDID_AddressID] ON
> [dbo].[Mailings]([MailCampaignDetailID],
> [AddressID]) ON [PRIMARY]
> GO
> CREATE INDEX [IX_Mailings_AddressID] ON [dbo].[Mailings]([
;AddressID]) ON
> [PRIMARY]
> GO
> CREATE INDEX [Mailings27] ON [dbo].[Mailings]([AddressID]
,
> [MailCampaignDetailID]) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[Mailings] ADD
> CONSTRAINT [FK_Mailings_AddressValid] FOREIGN KEY
> (
> [AddressID]
> ) REFERENCES [dbo].[AddressValid] (
> [AddressID]
> ),
> CONSTRAINT [FK_Mailings_MCD] FOREIGN KEY
> (
> [MailCampaignDetailID]
> ) REFERENCES [dbo].[MailCampaignDetail] (
> [MailCampaignDetailID]
> ),
> CONSTRAINT [FK_Mailings_Person] FOREIGN KEY
> (
> [PersonID]
> ) REFERENCES [dbo].[Person] (
> [PersonID]
> )
> GO
>
> On Tue, 4 Oct 2005 19:54:56 -0400, "Andrew J. Kelly"
> <sqlmvpnooospam@.shadhawk.com> wrote:
>
Bizarre performance hit
I create backups of a remote, production database and copy it after compression to a local,
development machine.
The remote machine is a Intel P4, 3.20GHz + 1G. The development machine is an AMD X2 3800+ dual
processor with 2G memory. Subjectively, I feel the development machine is noticeably faster in most
ways.
On the remote machine, I execute a SP which inserts approximately 6000 records. From the profiler, I
see each insertion takes about 50 Reads and about 0 Duration, which is acceptable.
After synchronizing the database logins with the those in the Master table on the development
machine, I execute the same SP on the development machine. The Reads are about 7500 and the Duration
around 3200!
Can anyone suggest reasons why this differential might occur? I really do need help. I'm not a DBA
but a developer. But it doesn't take a DBA to know that this won't fly.
TIARun sp_updatestats after a restore and then try it.
--
Andrew J. Kelly SQL MVP
"larzeb" <larzeb@.community.nospam> wrote in message
news:5os5k15iub07uqubpdqb8acgg7vcaq0grj@.4ax.com...
>I create backups of a remote, production database and copy it after
>compression to a local,
> development machine.
> The remote machine is a Intel P4, 3.20GHz + 1G. The development machine is
> an AMD X2 3800+ dual
> processor with 2G memory. Subjectively, I feel the development machine is
> noticeably faster in most
> ways.
> On the remote machine, I execute a SP which inserts approximately 6000
> records. From the profiler, I
> see each insertion takes about 50 Reads and about 0 Duration, which is
> acceptable.
> After synchronizing the database logins with the those in the Master table
> on the development
> machine, I execute the same SP on the development machine. The Reads are
> about 7500 and the Duration
> around 3200!
> Can anyone suggest reasons why this differential might occur? I really do
> need help. I'm not a DBA
> but a developer. But it doesn't take a DBA to know that this won't fly.
> TIA|||Thanks for the reply, Andrew. I'm sorry to say it had no effect.
On Tue, 4 Oct 2005 18:28:55 -0400, "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote:
>Run sp_updatestats after a restore and then try it.|||Are you sure there were no indexes added to the remote machine between the
time the backup was created and now? If the stats are the same (try running
in on the remote machine and see if it changes) then they should be the same
plan. Can you post the code for the sp?
--
Andrew J. Kelly SQL MVP
"larzeb" <larzeb@.community.nospam> wrote in message
news:bg46k11u0j542q5ua7dddol0g2fqfi58jt@.4ax.com...
> Thanks for the reply, Andrew. I'm sorry to say it had no effect.
> On Tue, 4 Oct 2005 18:28:55 -0400, "Andrew J. Kelly"
> <sqlmvpnooospam@.shadhawk.com> wrote:
>>Run sp_updatestats after a restore and then try it.|||May be optimizer is not using the right indexes, you can try forcing the index.
Mohammed.
"Andrew J. Kelly" wrote:
> Are you sure there were no indexes added to the remote machine between the
> time the backup was created and now? If the stats are the same (try running
> in on the remote machine and see if it changes) then they should be the same
> plan. Can you post the code for the sp?
> --
> Andrew J. Kelly SQL MVP
>
> "larzeb" <larzeb@.community.nospam> wrote in message
> news:bg46k11u0j542q5ua7dddol0g2fqfi58jt@.4ax.com...
> > Thanks for the reply, Andrew. I'm sorry to say it had no effect.
> >
> > On Tue, 4 Oct 2005 18:28:55 -0400, "Andrew J. Kelly"
> > <sqlmvpnooospam@.shadhawk.com> wrote:
> >
> >>Run sp_updatestats after a restore and then try it.
>
>|||You did run sp_updatestats in the correct database context not the default
for [master]?
i.e.
USE [MyDB]
GO
exec sp_updatestats
Nik Marshall-Blank MCSD/MCDBA
Linz, Austria
"larzeb" <larzeb@.community.nospam> wrote in message
news:bg46k11u0j542q5ua7dddol0g2fqfi58jt@.4ax.com...
> Thanks for the reply, Andrew. I'm sorry to say it had no effect.
> On Tue, 4 Oct 2005 18:28:55 -0400, "Andrew J. Kelly"
> <sqlmvpnooospam@.shadhawk.com> wrote:
>>Run sp_updatestats after a restore and then try it.|||Andrew,
Sorry for the delay - DSL down for over 24 hours.
No changes made to anything execpt restoring DB, syncying user ids from Master, and running the
sp_updatestats. I also went to the remote, production machine and copied the BAK file to DVD, rather
than use the compressed BAK. The results were the same.
The SP and associated table definitions follow. I abridged some of the tables for simplicity.
exec usp_Mailings_Ins @.MailCampaignDetailID = 68, @.AddressID = 1639896, @.PersonID = 1659603,
@.BatchID = 411, @.TrayNo = 1, @.SerialNo = 3, @.NextMailDate = 'Dec 31 2100 12:00AM', @.OEL =N'****************AUTO**5-DIGIT 90210', @.MailID = @.P1 output
select @.P1
CREATE PROCEDURE [dbo].usp_Mailings_Ins
@.MailCampaignDetailID int,
@.AddressID int,
@.PersonID int,
@.BatchID int,
@.TrayNo int,
@.SerialNo int,
@.NextMailDate DATETIME,
@.OEL varchar(50),
@.MailID int OUTPUT
AS
INSERT INTO [dbo].[Mailings] (
[MailCampaignDetailID],
[AddressID],
[PersonID],
[BatchID],
[TrayNo],
[SerialNo],
NextMailDate,
OEL
) VALUES (
@.MailCampaignDetailID,
@.AddressID,
@.PersonID,
@.BatchID,
@.TrayNo,
@.SerialNo,
@.NextMailDate,
@.OEL
)
SET @.MailID = SCOPE_IDENTITY()
GO
CREATE TABLE [dbo].[MailingBatch] (
[BatchID] [int] IDENTITY (1, 1) NOT NULL ,
[CompID] [int] NOT NULL ,
[MailCampaignDetailID] [int] NOT NULL ,
[BatchType] [int] NOT NULL ,
[PostageType] [int] NULL ,
[Cost] [decimal](18, 0) NOT NULL ,
[parameters] [varchar] (2000) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[dateAdded] [datetime] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[MailCampaignDetail] (
[MailCampaignDetailID] [int] IDENTITY (1, 1) NOT NULL ,
[MailCampaignID] [int] NOT NULL ,
...
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[AddressValid] (
[AddressID] [int] NOT NULL ,
...
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Person] (
[PersonID] [int] IDENTITY (1, 1) NOT NULL ,
[AddressID] [int] NOT NULL ,
...
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Mailings] (
[MailID] [int] IDENTITY (1, 1) NOT NULL ,
[MailCampaignDetailID] [int] NOT NULL ,
[AddressID] [int] NOT NULL ,
[PersonID] [int] NOT NULL ,
[BatchID] [int] NULL ,
[TrayNo] [int] NULL ,
[SerialNo] [int] NULL ,
[NextMailDate] [datetime] NULL ,
[MailDate] [smalldatetime] NOT NULL ,
[OEL] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MailingBatch] WITH NOCHECK ADD
CONSTRAINT [PK_Batch] PRIMARY KEY CLUSTERED
(
[BatchID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MailCampaignDetail] WITH NOCHECK ADD
CONSTRAINT [PK_MailCampaignDetail] PRIMARY KEY CLUSTERED
(
[MailCampaignDetailID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AddressValid] WITH NOCHECK ADD
CONSTRAINT [PK_AddressValid] PRIMARY KEY CLUSTERED
(
[AddressID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Person] WITH NOCHECK ADD
CONSTRAINT [PK_Person] PRIMARY KEY CLUSTERED
(
[PersonID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Mailings] WITH NOCHECK ADD
CONSTRAINT [PK_Mailings] PRIMARY KEY CLUSTERED
(
[MailID]
) ON [PRIMARY]
GO
CREATE INDEX [IX_Mailings_BatchID] ON [dbo].[Mailings]([BatchID], [SerialNo]) ON [PRIMARY]
GO
CREATE INDEX [IX_Mailings_PersonID] ON [dbo].[Mailings]([PersonID]) ON [PRIMARY]
GO
CREATE INDEX [IX_Mailings_MCDID_AddressID] ON [dbo].[Mailings]([MailCampaignDetailID],
[AddressID]) ON [PRIMARY]
GO
CREATE INDEX [IX_Mailings_AddressID] ON [dbo].[Mailings]([AddressID]) ON [PRIMARY]
GO
CREATE INDEX [Mailings27] ON [dbo].[Mailings]([AddressID], [MailCampaignDetailID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Mailings] ADD
CONSTRAINT [FK_Mailings_AddressValid] FOREIGN KEY
(
[AddressID]
) REFERENCES [dbo].[AddressValid] (
[AddressID]
),
CONSTRAINT [FK_Mailings_MCD] FOREIGN KEY
(
[MailCampaignDetailID]
) REFERENCES [dbo].[MailCampaignDetail] (
[MailCampaignDetailID]
),
CONSTRAINT [FK_Mailings_Person] FOREIGN KEY
(
[PersonID]
) REFERENCES [dbo].[Person] (
[PersonID]
)
GO
On Tue, 4 Oct 2005 19:54:56 -0400, "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote:
>Are you sure there were no indexes added to the remote machine between the
>time the backup was created and now? If the stats are the same (try running
>in on the remote machine and see if it changes) then they should be the same
>plan. Can you post the code for the sp?|||I was sure I ran sp_updatestats against the appropriate DB.
On Wed, 05 Oct 2005 06:13:44 GMT, "Nik Marshall-Blank" <Nik@.here.com> wrote:
>You did run sp_updatestats in the correct database context not the default
>for [master]?
>i.e.
>USE [MyDB]
>GO
>exec sp_updatestats|||Mohammed,
I'm afraid I don't know how to "force" an index. Can you give me an example?
On Tue, 4 Oct 2005 18:08:03 -0700, "Mohammed" <Mohammed@.discussions.microsoft.com> wrote:
>May be optimizer is not using the right indexes, you can try forcing the index.
>Mohammed.
>"Andrew J. Kelly" wrote:
>> Are you sure there were no indexes added to the remote machine between the
>> time the backup was created and now? If the stats are the same (try running
>> in on the remote machine and see if it changes) then they should be the same
>> plan. Can you post the code for the sp?
>> --
>> Andrew J. Kelly SQL MVP
>>
>> "larzeb" <larzeb@.community.nospam> wrote in message
>> news:bg46k11u0j542q5ua7dddol0g2fqfi58jt@.4ax.com...
>> > Thanks for the reply, Andrew. I'm sorry to say it had no effect.
>> >
>> > On Tue, 4 Oct 2005 18:28:55 -0400, "Andrew J. Kelly"
>> > <sqlmvpnooospam@.shadhawk.com> wrote:
>> >
>> >>Run sp_updatestats after a restore and then try it.
>>|||Well one thing I see is that you should put SET NOCOUNT ON at the beginning
of your sp but that should be the same on both.
Andrew J. Kelly SQL MVP
"larzeb" <larzeb@.community.nospam> wrote in message
news:fs4bk1de83u04keblbk0qnnr0hit4fvtae@.4ax.com...
> Andrew,
> Sorry for the delay - DSL down for over 24 hours.
> No changes made to anything execpt restoring DB, syncying user ids from
> Master, and running the
> sp_updatestats. I also went to the remote, production machine and copied
> the BAK file to DVD, rather
> than use the compressed BAK. The results were the same.
> The SP and associated table definitions follow. I abridged some of the
> tables for simplicity.
> exec usp_Mailings_Ins @.MailCampaignDetailID = 68, @.AddressID = 1639896,
> @.PersonID = 1659603,
> @.BatchID = 411, @.TrayNo = 1, @.SerialNo = 3, @.NextMailDate = 'Dec 31 2100
> 12:00AM', @.OEL => N'****************AUTO**5-DIGIT 90210', @.MailID = @.P1 output
> select @.P1
> CREATE PROCEDURE [dbo].usp_Mailings_Ins
> @.MailCampaignDetailID int,
> @.AddressID int,
> @.PersonID int,
> @.BatchID int,
> @.TrayNo int,
> @.SerialNo int,
> @.NextMailDate DATETIME,
> @.OEL varchar(50),
> @.MailID int OUTPUT
> AS
> INSERT INTO [dbo].[Mailings] (
> [MailCampaignDetailID],
> [AddressID],
> [PersonID],
> [BatchID],
> [TrayNo],
> [SerialNo],
> NextMailDate,
> OEL
> ) VALUES (
> @.MailCampaignDetailID,
> @.AddressID,
> @.PersonID,
> @.BatchID,
> @.TrayNo,
> @.SerialNo,
> @.NextMailDate,
> @.OEL
> )
> SET @.MailID = SCOPE_IDENTITY()
> GO
> CREATE TABLE [dbo].[MailingBatch] (
> [BatchID] [int] IDENTITY (1, 1) NOT NULL ,
> [CompID] [int] NOT NULL ,
> [MailCampaignDetailID] [int] NOT NULL ,
> [BatchType] [int] NOT NULL ,
> [PostageType] [int] NULL ,
> [Cost] [decimal](18, 0) NOT NULL ,
> [parameters] [varchar] (2000) COLLATE SQL_Latin1_General_CP1_CI_AS NOT
> NULL ,
> [dateAdded] [datetime] NOT NULL
> ) ON [PRIMARY]
> GO
> CREATE TABLE [dbo].[MailCampaignDetail] (
> [MailCampaignDetailID] [int] IDENTITY (1, 1) NOT NULL ,
> [MailCampaignID] [int] NOT NULL ,
> ...
> ) ON [PRIMARY]
> GO
> CREATE TABLE [dbo].[AddressValid] (
> [AddressID] [int] NOT NULL ,
> ...
> ) ON [PRIMARY]
> GO
> CREATE TABLE [dbo].[Person] (
> [PersonID] [int] IDENTITY (1, 1) NOT NULL ,
> [AddressID] [int] NOT NULL ,
> ...
> ) ON [PRIMARY]
> GO
> CREATE TABLE [dbo].[Mailings] (
> [MailID] [int] IDENTITY (1, 1) NOT NULL ,
> [MailCampaignDetailID] [int] NOT NULL ,
> [AddressID] [int] NOT NULL ,
> [PersonID] [int] NOT NULL ,
> [BatchID] [int] NULL ,
> [TrayNo] [int] NULL ,
> [SerialNo] [int] NULL ,
> [NextMailDate] [datetime] NULL ,
> [MailDate] [smalldatetime] NOT NULL ,
> [OEL] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[MailingBatch] WITH NOCHECK ADD
> CONSTRAINT [PK_Batch] PRIMARY KEY CLUSTERED
> (
> [BatchID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[MailCampaignDetail] WITH NOCHECK ADD
> CONSTRAINT [PK_MailCampaignDetail] PRIMARY KEY CLUSTERED
> (
> [MailCampaignDetailID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[AddressValid] WITH NOCHECK ADD
> CONSTRAINT [PK_AddressValid] PRIMARY KEY CLUSTERED
> (
> [AddressID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[Person] WITH NOCHECK ADD
> CONSTRAINT [PK_Person] PRIMARY KEY CLUSTERED
> (
> [PersonID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[Mailings] WITH NOCHECK ADD
> CONSTRAINT [PK_Mailings] PRIMARY KEY CLUSTERED
> (
> [MailID]
> ) ON [PRIMARY]
> GO
> CREATE INDEX [IX_Mailings_BatchID] ON [dbo].[Mailings]([BatchID],
> [SerialNo]) ON [PRIMARY]
> GO
> CREATE INDEX [IX_Mailings_PersonID] ON [dbo].[Mailings]([PersonID]) ON
> [PRIMARY]
> GO
> CREATE INDEX [IX_Mailings_MCDID_AddressID] ON
> [dbo].[Mailings]([MailCampaignDetailID],
> [AddressID]) ON [PRIMARY]
> GO
> CREATE INDEX [IX_Mailings_AddressID] ON [dbo].[Mailings]([AddressID]) ON
> [PRIMARY]
> GO
> CREATE INDEX [Mailings27] ON [dbo].[Mailings]([AddressID],
> [MailCampaignDetailID]) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[Mailings] ADD
> CONSTRAINT [FK_Mailings_AddressValid] FOREIGN KEY
> (
> [AddressID]
> ) REFERENCES [dbo].[AddressValid] (
> [AddressID]
> ),
> CONSTRAINT [FK_Mailings_MCD] FOREIGN KEY
> (
> [MailCampaignDetailID]
> ) REFERENCES [dbo].[MailCampaignDetail] (
> [MailCampaignDetailID]
> ),
> CONSTRAINT [FK_Mailings_Person] FOREIGN KEY
> (
> [PersonID]
> ) REFERENCES [dbo].[Person] (
> [PersonID]
> )
> GO
>
> On Tue, 4 Oct 2005 19:54:56 -0400, "Andrew J. Kelly"
> <sqlmvpnooospam@.shadhawk.com> wrote:
>>Are you sure there were no indexes added to the remote machine between the
>>time the backup was created and now? If the stats are the same (try
>>running
>>in on the remote machine and see if it changes) then they should be the
>>same
>>plan. Can you post the code for the sp?|||I began comparing the execution plans on each of the two machines. Of course, they were different.
One big difference was a Hash Match/Inner Join which has an estimated row count of 2,250,000 on the
development machine.
The execution plan says that it is doing an Index Scan on Addressvalid.Address21 and also on
UseCode.IX_UseCode which feeds the Hash Match/Inner Join:
|--Hash Match(Inner Join, HASH:([UseCode].[UseCodeID],
[UseCode].[CountyFipsID])=([AddressValid].[useCodeID], [AddressValid].[countyCodeFips]),
RESIDUAL:([AddressValid].[useCodeID]=[UseCode].[UseCodeID] AND
[AddressValid].[countyCodeFips]=[UseCode].[CountyFipsID]
|--Index Scan(OBJECT:([MailHouse].[dbo].[UseCode].[IX_UseCode]))
|--Index Scan(OBJECT:([MailHouse].[dbo].[AddressValid].[AddressValid21]))
Why is doing all this when it's supposed to be inserting rows in Mailings?
Why is the development machine doing this and the production not?
How can I get to two machines in sync?
Thanks for you help.
CREATE TABLE [dbo].[AddressValid] (
[AddressID] [int] NOT NULL,
[dataSourceID] [int] NOT NULL,
...
[useCodeID] [char] (6) NOT NULL,
...
[houseNo] [varchar] (10) NULL,
[preDir] [char] (2) NULL,
[streetName] [varchar] (28) NULL,
[streetSuffix] [char] (4) NULL,
[postDir] [char] (2) NULL,
[city] [varchar] (28) NULL,
[state] [char] (2) NULL,
[zip5] [char] (5) NULL,
[zip4] [char] (4) NULL,
[sud] [char] (4) NULL,
[unitNum] [varchar] (8) NULL,
...
[countyCodeFips] [char] (5) NULL,
...
[dateAdded] [smalldatetime] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AddressValid] WITH NOCHECK ADD
CONSTRAINT [PK_AddressValid] PRIMARY KEY CLUSTERED
(
[AddressID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AddressValid] WITH NOCHECK ADD
CONSTRAINT [IX_AddressValid] UNIQUE NONCLUSTERED
(
[streetName],
[houseNo],
[streetSuffix],
[preDir],
[postDir],
[zip5],
[zip4],
[sud],
[unitNum]
) ON [PRIMARY]
GO
CREATE INDEX [IX_Zip5] ON [dbo].[AddressValid]([zip5]) ON [PRIMARY]
GO
CREATE INDEX [AddressValid21] ON [dbo].[AddressValid]([AddressID], [useCodeID], [zip5],
[countyCodeFips]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AddressValid] ADD
CONSTRAINT [FK_AddressValid_AddressSource] FOREIGN KEY
(
[AddressID]
) REFERENCES [dbo].[AddressSource] (
[addressID]
),
CONSTRAINT [FK_AddressValid_datasource] FOREIGN KEY
(
[dataSourceID]
) REFERENCES [dbo].[datasource] (
[DataSourceID]
),
CONSTRAINT [FK_AddressValid_UseCode] FOREIGN KEY
(
[countyCodeFips],
[useCodeID]
) REFERENCES [dbo].[UseCode] (
[CountyFipsID],
[UseCodeID]
)
GO
CREATE TABLE [dbo].[UseCode] (
[UseCodePK] [int] IDENTITY (1, 1) NOT NULL,
[CountyFipsID] [char] (5) NOT NULL,
[UseCodeID] [char] (6) NOT NULL,
[descr] [varchar] (50) NOT NULL,
[dateAdded] [smalldatetime] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[UseCode] WITH NOCHECK ADD
CONSTRAINT [PK_UseCode] PRIMARY KEY CLUSTERED
(
[UseCodePK]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[UseCode] WITH NOCHECK ADD
CONSTRAINT [IX_UseCode] UNIQUE NONCLUSTERED
(
[CountyFipsID],
[UseCodeID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[UseCode] ADD
CONSTRAINT [FK_UseCode_CountyFips] FOREIGN KEY
(
[CountyFipsID]
) REFERENCES [dbo].[CountyFips] (
[CountyFipsID]
)
GO
On Thu, 6 Oct 2005 18:14:28 -0400, "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote:
>Well one thing I see is that you should put SET NOCOUNT ON at the beginning
>of your sp but that should be the same on both.|||Hello,
I have tested the issue on my side but I am unable to reproduce the issue.
To narrow down the issue, I suggest that you perform the following steps:
1. Restore the database on another known working machine using the same
backup file. The machine has the similar hardware configuration as the
remote machine. Check if you can reproduce the issue on another machine.
2. Create a new test database. Create some tables and a SP in the test
database to check if you can reproduce the issue on another database. Let
me know the results.
I hope the information is helpful.
Sophie Guo
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
=====================================================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.|||Sounds like you have referential integrity on some of the columns. In order
to enforce the RI it has to search the other tables. If they don't have
proper indexes it can be a real mess. If the schemas really are identical
(use a tool such as www.red-gate.com to verify) and the number of rows are
the same it would usually boil down to statistics being different. You say
you updated the ones on the dev server, what about the production?
--
Andrew J. Kelly SQL MVP
"larzeb" <larzeb@.community.nospam> wrote in message
news:58bbk11d1g82ein2issf0c878q6kjj6r6o@.4ax.com...
>I began comparing the execution plans on each of the two machines. Of
>course, they were different.
> One big difference was a Hash Match/Inner Join which has an estimated row
> count of 2,250,000 on the
> development machine.
> The execution plan says that it is doing an Index Scan on
> Addressvalid.Address21 and also on
> UseCode.IX_UseCode which feeds the Hash Match/Inner Join:
> |--Hash Match(Inner Join,
> HASH:([UseCode].[UseCodeID],
> [UseCode].[CountyFipsID])=([AddressValid].[useCodeID],
> [AddressValid].[countyCodeFips]),
> RESIDUAL:([AddressValid].[useCodeID]=[UseCode].[UseCodeID] AND
> [AddressValid].[countyCodeFips]=[UseCode].[CountyFipsID]
> |--Index
> Scan(OBJECT:([MailHouse].[dbo].[UseCode].[IX_UseCode]))
> |--Index
> Scan(OBJECT:([MailHouse].[dbo].[AddressValid].[AddressValid21]))
> Why is doing all this when it's supposed to be inserting rows in Mailings?
> Why is the development machine doing this and the production not?
> How can I get to two machines in sync?
> Thanks for you help.
> CREATE TABLE [dbo].[AddressValid] (
> [AddressID] [int] NOT NULL,
> [dataSourceID] [int] NOT NULL,
> ...
> [useCodeID] [char] (6) NOT NULL,
> ...
> [houseNo] [varchar] (10) NULL,
> [preDir] [char] (2) NULL,
> [streetName] [varchar] (28) NULL,
> [streetSuffix] [char] (4) NULL,
> [postDir] [char] (2) NULL,
> [city] [varchar] (28) NULL,
> [state] [char] (2) NULL,
> [zip5] [char] (5) NULL,
> [zip4] [char] (4) NULL,
> [sud] [char] (4) NULL,
> [unitNum] [varchar] (8) NULL,
> ...
> [countyCodeFips] [char] (5) NULL,
> ...
> [dateAdded] [smalldatetime] NOT NULL
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[AddressValid] WITH NOCHECK ADD
> CONSTRAINT [PK_AddressValid] PRIMARY KEY CLUSTERED
> (
> [AddressID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[AddressValid] WITH NOCHECK ADD
> CONSTRAINT [IX_AddressValid] UNIQUE NONCLUSTERED
> (
> [streetName],
> [houseNo],
> [streetSuffix],
> [preDir],
> [postDir],
> [zip5],
> [zip4],
> [sud],
> [unitNum]
> ) ON [PRIMARY]
> GO
> CREATE INDEX [IX_Zip5] ON [dbo].[AddressValid]([zip5]) ON [PRIMARY]
> GO
> CREATE INDEX [AddressValid21] ON [dbo].[AddressValid]([AddressID],
> [useCodeID], [zip5],
> [countyCodeFips]) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[AddressValid] ADD
> CONSTRAINT [FK_AddressValid_AddressSource] FOREIGN KEY
> (
> [AddressID]
> ) REFERENCES [dbo].[AddressSource] (
> [addressID]
> ),
> CONSTRAINT [FK_AddressValid_datasource] FOREIGN KEY
> (
> [dataSourceID]
> ) REFERENCES [dbo].[datasource] (
> [DataSourceID]
> ),
> CONSTRAINT [FK_AddressValid_UseCode] FOREIGN KEY
> (
> [countyCodeFips],
> [useCodeID]
> ) REFERENCES [dbo].[UseCode] (
> [CountyFipsID],
> [UseCodeID]
> )
> GO
> CREATE TABLE [dbo].[UseCode] (
> [UseCodePK] [int] IDENTITY (1, 1) NOT NULL,
> [CountyFipsID] [char] (5) NOT NULL,
> [UseCodeID] [char] (6) NOT NULL,
> [descr] [varchar] (50) NOT NULL,
> [dateAdded] [smalldatetime] NOT NULL
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[UseCode] WITH NOCHECK ADD
> CONSTRAINT [PK_UseCode] PRIMARY KEY CLUSTERED
> (
> [UseCodePK]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[UseCode] WITH NOCHECK ADD
> CONSTRAINT [IX_UseCode] UNIQUE NONCLUSTERED
> (
> [CountyFipsID],
> [UseCodeID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[UseCode] ADD
> CONSTRAINT [FK_UseCode_CountyFips] FOREIGN KEY
> (
> [CountyFipsID]
> ) REFERENCES [dbo].[CountyFips] (
> [CountyFipsID]
> )
> GO
>
> On Thu, 6 Oct 2005 18:14:28 -0400, "Andrew J. Kelly"
> <sqlmvpnooospam@.shadhawk.com> wrote:
>>Well one thing I see is that you should put SET NOCOUNT ON at the
>>beginning
>>of your sp but that should be the same on both.
development machine.
The remote machine is a Intel P4, 3.20GHz + 1G. The development machine is an AMD X2 3800+ dual
processor with 2G memory. Subjectively, I feel the development machine is noticeably faster in most
ways.
On the remote machine, I execute a SP which inserts approximately 6000 records. From the profiler, I
see each insertion takes about 50 Reads and about 0 Duration, which is acceptable.
After synchronizing the database logins with the those in the Master table on the development
machine, I execute the same SP on the development machine. The Reads are about 7500 and the Duration
around 3200!
Can anyone suggest reasons why this differential might occur? I really do need help. I'm not a DBA
but a developer. But it doesn't take a DBA to know that this won't fly.
TIARun sp_updatestats after a restore and then try it.
--
Andrew J. Kelly SQL MVP
"larzeb" <larzeb@.community.nospam> wrote in message
news:5os5k15iub07uqubpdqb8acgg7vcaq0grj@.4ax.com...
>I create backups of a remote, production database and copy it after
>compression to a local,
> development machine.
> The remote machine is a Intel P4, 3.20GHz + 1G. The development machine is
> an AMD X2 3800+ dual
> processor with 2G memory. Subjectively, I feel the development machine is
> noticeably faster in most
> ways.
> On the remote machine, I execute a SP which inserts approximately 6000
> records. From the profiler, I
> see each insertion takes about 50 Reads and about 0 Duration, which is
> acceptable.
> After synchronizing the database logins with the those in the Master table
> on the development
> machine, I execute the same SP on the development machine. The Reads are
> about 7500 and the Duration
> around 3200!
> Can anyone suggest reasons why this differential might occur? I really do
> need help. I'm not a DBA
> but a developer. But it doesn't take a DBA to know that this won't fly.
> TIA|||Thanks for the reply, Andrew. I'm sorry to say it had no effect.
On Tue, 4 Oct 2005 18:28:55 -0400, "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote:
>Run sp_updatestats after a restore and then try it.|||Are you sure there were no indexes added to the remote machine between the
time the backup was created and now? If the stats are the same (try running
in on the remote machine and see if it changes) then they should be the same
plan. Can you post the code for the sp?
--
Andrew J. Kelly SQL MVP
"larzeb" <larzeb@.community.nospam> wrote in message
news:bg46k11u0j542q5ua7dddol0g2fqfi58jt@.4ax.com...
> Thanks for the reply, Andrew. I'm sorry to say it had no effect.
> On Tue, 4 Oct 2005 18:28:55 -0400, "Andrew J. Kelly"
> <sqlmvpnooospam@.shadhawk.com> wrote:
>>Run sp_updatestats after a restore and then try it.|||May be optimizer is not using the right indexes, you can try forcing the index.
Mohammed.
"Andrew J. Kelly" wrote:
> Are you sure there were no indexes added to the remote machine between the
> time the backup was created and now? If the stats are the same (try running
> in on the remote machine and see if it changes) then they should be the same
> plan. Can you post the code for the sp?
> --
> Andrew J. Kelly SQL MVP
>
> "larzeb" <larzeb@.community.nospam> wrote in message
> news:bg46k11u0j542q5ua7dddol0g2fqfi58jt@.4ax.com...
> > Thanks for the reply, Andrew. I'm sorry to say it had no effect.
> >
> > On Tue, 4 Oct 2005 18:28:55 -0400, "Andrew J. Kelly"
> > <sqlmvpnooospam@.shadhawk.com> wrote:
> >
> >>Run sp_updatestats after a restore and then try it.
>
>|||You did run sp_updatestats in the correct database context not the default
for [master]?
i.e.
USE [MyDB]
GO
exec sp_updatestats
Nik Marshall-Blank MCSD/MCDBA
Linz, Austria
"larzeb" <larzeb@.community.nospam> wrote in message
news:bg46k11u0j542q5ua7dddol0g2fqfi58jt@.4ax.com...
> Thanks for the reply, Andrew. I'm sorry to say it had no effect.
> On Tue, 4 Oct 2005 18:28:55 -0400, "Andrew J. Kelly"
> <sqlmvpnooospam@.shadhawk.com> wrote:
>>Run sp_updatestats after a restore and then try it.|||Andrew,
Sorry for the delay - DSL down for over 24 hours.
No changes made to anything execpt restoring DB, syncying user ids from Master, and running the
sp_updatestats. I also went to the remote, production machine and copied the BAK file to DVD, rather
than use the compressed BAK. The results were the same.
The SP and associated table definitions follow. I abridged some of the tables for simplicity.
exec usp_Mailings_Ins @.MailCampaignDetailID = 68, @.AddressID = 1639896, @.PersonID = 1659603,
@.BatchID = 411, @.TrayNo = 1, @.SerialNo = 3, @.NextMailDate = 'Dec 31 2100 12:00AM', @.OEL =N'****************AUTO**5-DIGIT 90210', @.MailID = @.P1 output
select @.P1
CREATE PROCEDURE [dbo].usp_Mailings_Ins
@.MailCampaignDetailID int,
@.AddressID int,
@.PersonID int,
@.BatchID int,
@.TrayNo int,
@.SerialNo int,
@.NextMailDate DATETIME,
@.OEL varchar(50),
@.MailID int OUTPUT
AS
INSERT INTO [dbo].[Mailings] (
[MailCampaignDetailID],
[AddressID],
[PersonID],
[BatchID],
[TrayNo],
[SerialNo],
NextMailDate,
OEL
) VALUES (
@.MailCampaignDetailID,
@.AddressID,
@.PersonID,
@.BatchID,
@.TrayNo,
@.SerialNo,
@.NextMailDate,
@.OEL
)
SET @.MailID = SCOPE_IDENTITY()
GO
CREATE TABLE [dbo].[MailingBatch] (
[BatchID] [int] IDENTITY (1, 1) NOT NULL ,
[CompID] [int] NOT NULL ,
[MailCampaignDetailID] [int] NOT NULL ,
[BatchType] [int] NOT NULL ,
[PostageType] [int] NULL ,
[Cost] [decimal](18, 0) NOT NULL ,
[parameters] [varchar] (2000) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[dateAdded] [datetime] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[MailCampaignDetail] (
[MailCampaignDetailID] [int] IDENTITY (1, 1) NOT NULL ,
[MailCampaignID] [int] NOT NULL ,
...
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[AddressValid] (
[AddressID] [int] NOT NULL ,
...
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Person] (
[PersonID] [int] IDENTITY (1, 1) NOT NULL ,
[AddressID] [int] NOT NULL ,
...
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Mailings] (
[MailID] [int] IDENTITY (1, 1) NOT NULL ,
[MailCampaignDetailID] [int] NOT NULL ,
[AddressID] [int] NOT NULL ,
[PersonID] [int] NOT NULL ,
[BatchID] [int] NULL ,
[TrayNo] [int] NULL ,
[SerialNo] [int] NULL ,
[NextMailDate] [datetime] NULL ,
[MailDate] [smalldatetime] NOT NULL ,
[OEL] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MailingBatch] WITH NOCHECK ADD
CONSTRAINT [PK_Batch] PRIMARY KEY CLUSTERED
(
[BatchID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MailCampaignDetail] WITH NOCHECK ADD
CONSTRAINT [PK_MailCampaignDetail] PRIMARY KEY CLUSTERED
(
[MailCampaignDetailID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AddressValid] WITH NOCHECK ADD
CONSTRAINT [PK_AddressValid] PRIMARY KEY CLUSTERED
(
[AddressID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Person] WITH NOCHECK ADD
CONSTRAINT [PK_Person] PRIMARY KEY CLUSTERED
(
[PersonID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Mailings] WITH NOCHECK ADD
CONSTRAINT [PK_Mailings] PRIMARY KEY CLUSTERED
(
[MailID]
) ON [PRIMARY]
GO
CREATE INDEX [IX_Mailings_BatchID] ON [dbo].[Mailings]([BatchID], [SerialNo]) ON [PRIMARY]
GO
CREATE INDEX [IX_Mailings_PersonID] ON [dbo].[Mailings]([PersonID]) ON [PRIMARY]
GO
CREATE INDEX [IX_Mailings_MCDID_AddressID] ON [dbo].[Mailings]([MailCampaignDetailID],
[AddressID]) ON [PRIMARY]
GO
CREATE INDEX [IX_Mailings_AddressID] ON [dbo].[Mailings]([AddressID]) ON [PRIMARY]
GO
CREATE INDEX [Mailings27] ON [dbo].[Mailings]([AddressID], [MailCampaignDetailID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Mailings] ADD
CONSTRAINT [FK_Mailings_AddressValid] FOREIGN KEY
(
[AddressID]
) REFERENCES [dbo].[AddressValid] (
[AddressID]
),
CONSTRAINT [FK_Mailings_MCD] FOREIGN KEY
(
[MailCampaignDetailID]
) REFERENCES [dbo].[MailCampaignDetail] (
[MailCampaignDetailID]
),
CONSTRAINT [FK_Mailings_Person] FOREIGN KEY
(
[PersonID]
) REFERENCES [dbo].[Person] (
[PersonID]
)
GO
On Tue, 4 Oct 2005 19:54:56 -0400, "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote:
>Are you sure there were no indexes added to the remote machine between the
>time the backup was created and now? If the stats are the same (try running
>in on the remote machine and see if it changes) then they should be the same
>plan. Can you post the code for the sp?|||I was sure I ran sp_updatestats against the appropriate DB.
On Wed, 05 Oct 2005 06:13:44 GMT, "Nik Marshall-Blank" <Nik@.here.com> wrote:
>You did run sp_updatestats in the correct database context not the default
>for [master]?
>i.e.
>USE [MyDB]
>GO
>exec sp_updatestats|||Mohammed,
I'm afraid I don't know how to "force" an index. Can you give me an example?
On Tue, 4 Oct 2005 18:08:03 -0700, "Mohammed" <Mohammed@.discussions.microsoft.com> wrote:
>May be optimizer is not using the right indexes, you can try forcing the index.
>Mohammed.
>"Andrew J. Kelly" wrote:
>> Are you sure there were no indexes added to the remote machine between the
>> time the backup was created and now? If the stats are the same (try running
>> in on the remote machine and see if it changes) then they should be the same
>> plan. Can you post the code for the sp?
>> --
>> Andrew J. Kelly SQL MVP
>>
>> "larzeb" <larzeb@.community.nospam> wrote in message
>> news:bg46k11u0j542q5ua7dddol0g2fqfi58jt@.4ax.com...
>> > Thanks for the reply, Andrew. I'm sorry to say it had no effect.
>> >
>> > On Tue, 4 Oct 2005 18:28:55 -0400, "Andrew J. Kelly"
>> > <sqlmvpnooospam@.shadhawk.com> wrote:
>> >
>> >>Run sp_updatestats after a restore and then try it.
>>|||Well one thing I see is that you should put SET NOCOUNT ON at the beginning
of your sp but that should be the same on both.
Andrew J. Kelly SQL MVP
"larzeb" <larzeb@.community.nospam> wrote in message
news:fs4bk1de83u04keblbk0qnnr0hit4fvtae@.4ax.com...
> Andrew,
> Sorry for the delay - DSL down for over 24 hours.
> No changes made to anything execpt restoring DB, syncying user ids from
> Master, and running the
> sp_updatestats. I also went to the remote, production machine and copied
> the BAK file to DVD, rather
> than use the compressed BAK. The results were the same.
> The SP and associated table definitions follow. I abridged some of the
> tables for simplicity.
> exec usp_Mailings_Ins @.MailCampaignDetailID = 68, @.AddressID = 1639896,
> @.PersonID = 1659603,
> @.BatchID = 411, @.TrayNo = 1, @.SerialNo = 3, @.NextMailDate = 'Dec 31 2100
> 12:00AM', @.OEL => N'****************AUTO**5-DIGIT 90210', @.MailID = @.P1 output
> select @.P1
> CREATE PROCEDURE [dbo].usp_Mailings_Ins
> @.MailCampaignDetailID int,
> @.AddressID int,
> @.PersonID int,
> @.BatchID int,
> @.TrayNo int,
> @.SerialNo int,
> @.NextMailDate DATETIME,
> @.OEL varchar(50),
> @.MailID int OUTPUT
> AS
> INSERT INTO [dbo].[Mailings] (
> [MailCampaignDetailID],
> [AddressID],
> [PersonID],
> [BatchID],
> [TrayNo],
> [SerialNo],
> NextMailDate,
> OEL
> ) VALUES (
> @.MailCampaignDetailID,
> @.AddressID,
> @.PersonID,
> @.BatchID,
> @.TrayNo,
> @.SerialNo,
> @.NextMailDate,
> @.OEL
> )
> SET @.MailID = SCOPE_IDENTITY()
> GO
> CREATE TABLE [dbo].[MailingBatch] (
> [BatchID] [int] IDENTITY (1, 1) NOT NULL ,
> [CompID] [int] NOT NULL ,
> [MailCampaignDetailID] [int] NOT NULL ,
> [BatchType] [int] NOT NULL ,
> [PostageType] [int] NULL ,
> [Cost] [decimal](18, 0) NOT NULL ,
> [parameters] [varchar] (2000) COLLATE SQL_Latin1_General_CP1_CI_AS NOT
> NULL ,
> [dateAdded] [datetime] NOT NULL
> ) ON [PRIMARY]
> GO
> CREATE TABLE [dbo].[MailCampaignDetail] (
> [MailCampaignDetailID] [int] IDENTITY (1, 1) NOT NULL ,
> [MailCampaignID] [int] NOT NULL ,
> ...
> ) ON [PRIMARY]
> GO
> CREATE TABLE [dbo].[AddressValid] (
> [AddressID] [int] NOT NULL ,
> ...
> ) ON [PRIMARY]
> GO
> CREATE TABLE [dbo].[Person] (
> [PersonID] [int] IDENTITY (1, 1) NOT NULL ,
> [AddressID] [int] NOT NULL ,
> ...
> ) ON [PRIMARY]
> GO
> CREATE TABLE [dbo].[Mailings] (
> [MailID] [int] IDENTITY (1, 1) NOT NULL ,
> [MailCampaignDetailID] [int] NOT NULL ,
> [AddressID] [int] NOT NULL ,
> [PersonID] [int] NOT NULL ,
> [BatchID] [int] NULL ,
> [TrayNo] [int] NULL ,
> [SerialNo] [int] NULL ,
> [NextMailDate] [datetime] NULL ,
> [MailDate] [smalldatetime] NOT NULL ,
> [OEL] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[MailingBatch] WITH NOCHECK ADD
> CONSTRAINT [PK_Batch] PRIMARY KEY CLUSTERED
> (
> [BatchID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[MailCampaignDetail] WITH NOCHECK ADD
> CONSTRAINT [PK_MailCampaignDetail] PRIMARY KEY CLUSTERED
> (
> [MailCampaignDetailID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[AddressValid] WITH NOCHECK ADD
> CONSTRAINT [PK_AddressValid] PRIMARY KEY CLUSTERED
> (
> [AddressID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[Person] WITH NOCHECK ADD
> CONSTRAINT [PK_Person] PRIMARY KEY CLUSTERED
> (
> [PersonID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[Mailings] WITH NOCHECK ADD
> CONSTRAINT [PK_Mailings] PRIMARY KEY CLUSTERED
> (
> [MailID]
> ) ON [PRIMARY]
> GO
> CREATE INDEX [IX_Mailings_BatchID] ON [dbo].[Mailings]([BatchID],
> [SerialNo]) ON [PRIMARY]
> GO
> CREATE INDEX [IX_Mailings_PersonID] ON [dbo].[Mailings]([PersonID]) ON
> [PRIMARY]
> GO
> CREATE INDEX [IX_Mailings_MCDID_AddressID] ON
> [dbo].[Mailings]([MailCampaignDetailID],
> [AddressID]) ON [PRIMARY]
> GO
> CREATE INDEX [IX_Mailings_AddressID] ON [dbo].[Mailings]([AddressID]) ON
> [PRIMARY]
> GO
> CREATE INDEX [Mailings27] ON [dbo].[Mailings]([AddressID],
> [MailCampaignDetailID]) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[Mailings] ADD
> CONSTRAINT [FK_Mailings_AddressValid] FOREIGN KEY
> (
> [AddressID]
> ) REFERENCES [dbo].[AddressValid] (
> [AddressID]
> ),
> CONSTRAINT [FK_Mailings_MCD] FOREIGN KEY
> (
> [MailCampaignDetailID]
> ) REFERENCES [dbo].[MailCampaignDetail] (
> [MailCampaignDetailID]
> ),
> CONSTRAINT [FK_Mailings_Person] FOREIGN KEY
> (
> [PersonID]
> ) REFERENCES [dbo].[Person] (
> [PersonID]
> )
> GO
>
> On Tue, 4 Oct 2005 19:54:56 -0400, "Andrew J. Kelly"
> <sqlmvpnooospam@.shadhawk.com> wrote:
>>Are you sure there were no indexes added to the remote machine between the
>>time the backup was created and now? If the stats are the same (try
>>running
>>in on the remote machine and see if it changes) then they should be the
>>same
>>plan. Can you post the code for the sp?|||I began comparing the execution plans on each of the two machines. Of course, they were different.
One big difference was a Hash Match/Inner Join which has an estimated row count of 2,250,000 on the
development machine.
The execution plan says that it is doing an Index Scan on Addressvalid.Address21 and also on
UseCode.IX_UseCode which feeds the Hash Match/Inner Join:
|--Hash Match(Inner Join, HASH:([UseCode].[UseCodeID],
[UseCode].[CountyFipsID])=([AddressValid].[useCodeID], [AddressValid].[countyCodeFips]),
RESIDUAL:([AddressValid].[useCodeID]=[UseCode].[UseCodeID] AND
[AddressValid].[countyCodeFips]=[UseCode].[CountyFipsID]
|--Index Scan(OBJECT:([MailHouse].[dbo].[UseCode].[IX_UseCode]))
|--Index Scan(OBJECT:([MailHouse].[dbo].[AddressValid].[AddressValid21]))
Why is doing all this when it's supposed to be inserting rows in Mailings?
Why is the development machine doing this and the production not?
How can I get to two machines in sync?
Thanks for you help.
CREATE TABLE [dbo].[AddressValid] (
[AddressID] [int] NOT NULL,
[dataSourceID] [int] NOT NULL,
...
[useCodeID] [char] (6) NOT NULL,
...
[houseNo] [varchar] (10) NULL,
[preDir] [char] (2) NULL,
[streetName] [varchar] (28) NULL,
[streetSuffix] [char] (4) NULL,
[postDir] [char] (2) NULL,
[city] [varchar] (28) NULL,
[state] [char] (2) NULL,
[zip5] [char] (5) NULL,
[zip4] [char] (4) NULL,
[sud] [char] (4) NULL,
[unitNum] [varchar] (8) NULL,
...
[countyCodeFips] [char] (5) NULL,
...
[dateAdded] [smalldatetime] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AddressValid] WITH NOCHECK ADD
CONSTRAINT [PK_AddressValid] PRIMARY KEY CLUSTERED
(
[AddressID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AddressValid] WITH NOCHECK ADD
CONSTRAINT [IX_AddressValid] UNIQUE NONCLUSTERED
(
[streetName],
[houseNo],
[streetSuffix],
[preDir],
[postDir],
[zip5],
[zip4],
[sud],
[unitNum]
) ON [PRIMARY]
GO
CREATE INDEX [IX_Zip5] ON [dbo].[AddressValid]([zip5]) ON [PRIMARY]
GO
CREATE INDEX [AddressValid21] ON [dbo].[AddressValid]([AddressID], [useCodeID], [zip5],
[countyCodeFips]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AddressValid] ADD
CONSTRAINT [FK_AddressValid_AddressSource] FOREIGN KEY
(
[AddressID]
) REFERENCES [dbo].[AddressSource] (
[addressID]
),
CONSTRAINT [FK_AddressValid_datasource] FOREIGN KEY
(
[dataSourceID]
) REFERENCES [dbo].[datasource] (
[DataSourceID]
),
CONSTRAINT [FK_AddressValid_UseCode] FOREIGN KEY
(
[countyCodeFips],
[useCodeID]
) REFERENCES [dbo].[UseCode] (
[CountyFipsID],
[UseCodeID]
)
GO
CREATE TABLE [dbo].[UseCode] (
[UseCodePK] [int] IDENTITY (1, 1) NOT NULL,
[CountyFipsID] [char] (5) NOT NULL,
[UseCodeID] [char] (6) NOT NULL,
[descr] [varchar] (50) NOT NULL,
[dateAdded] [smalldatetime] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[UseCode] WITH NOCHECK ADD
CONSTRAINT [PK_UseCode] PRIMARY KEY CLUSTERED
(
[UseCodePK]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[UseCode] WITH NOCHECK ADD
CONSTRAINT [IX_UseCode] UNIQUE NONCLUSTERED
(
[CountyFipsID],
[UseCodeID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[UseCode] ADD
CONSTRAINT [FK_UseCode_CountyFips] FOREIGN KEY
(
[CountyFipsID]
) REFERENCES [dbo].[CountyFips] (
[CountyFipsID]
)
GO
On Thu, 6 Oct 2005 18:14:28 -0400, "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote:
>Well one thing I see is that you should put SET NOCOUNT ON at the beginning
>of your sp but that should be the same on both.|||Hello,
I have tested the issue on my side but I am unable to reproduce the issue.
To narrow down the issue, I suggest that you perform the following steps:
1. Restore the database on another known working machine using the same
backup file. The machine has the similar hardware configuration as the
remote machine. Check if you can reproduce the issue on another machine.
2. Create a new test database. Create some tables and a SP in the test
database to check if you can reproduce the issue on another database. Let
me know the results.
I hope the information is helpful.
Sophie Guo
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
=====================================================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.|||Sounds like you have referential integrity on some of the columns. In order
to enforce the RI it has to search the other tables. If they don't have
proper indexes it can be a real mess. If the schemas really are identical
(use a tool such as www.red-gate.com to verify) and the number of rows are
the same it would usually boil down to statistics being different. You say
you updated the ones on the dev server, what about the production?
--
Andrew J. Kelly SQL MVP
"larzeb" <larzeb@.community.nospam> wrote in message
news:58bbk11d1g82ein2issf0c878q6kjj6r6o@.4ax.com...
>I began comparing the execution plans on each of the two machines. Of
>course, they were different.
> One big difference was a Hash Match/Inner Join which has an estimated row
> count of 2,250,000 on the
> development machine.
> The execution plan says that it is doing an Index Scan on
> Addressvalid.Address21 and also on
> UseCode.IX_UseCode which feeds the Hash Match/Inner Join:
> |--Hash Match(Inner Join,
> HASH:([UseCode].[UseCodeID],
> [UseCode].[CountyFipsID])=([AddressValid].[useCodeID],
> [AddressValid].[countyCodeFips]),
> RESIDUAL:([AddressValid].[useCodeID]=[UseCode].[UseCodeID] AND
> [AddressValid].[countyCodeFips]=[UseCode].[CountyFipsID]
> |--Index
> Scan(OBJECT:([MailHouse].[dbo].[UseCode].[IX_UseCode]))
> |--Index
> Scan(OBJECT:([MailHouse].[dbo].[AddressValid].[AddressValid21]))
> Why is doing all this when it's supposed to be inserting rows in Mailings?
> Why is the development machine doing this and the production not?
> How can I get to two machines in sync?
> Thanks for you help.
> CREATE TABLE [dbo].[AddressValid] (
> [AddressID] [int] NOT NULL,
> [dataSourceID] [int] NOT NULL,
> ...
> [useCodeID] [char] (6) NOT NULL,
> ...
> [houseNo] [varchar] (10) NULL,
> [preDir] [char] (2) NULL,
> [streetName] [varchar] (28) NULL,
> [streetSuffix] [char] (4) NULL,
> [postDir] [char] (2) NULL,
> [city] [varchar] (28) NULL,
> [state] [char] (2) NULL,
> [zip5] [char] (5) NULL,
> [zip4] [char] (4) NULL,
> [sud] [char] (4) NULL,
> [unitNum] [varchar] (8) NULL,
> ...
> [countyCodeFips] [char] (5) NULL,
> ...
> [dateAdded] [smalldatetime] NOT NULL
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[AddressValid] WITH NOCHECK ADD
> CONSTRAINT [PK_AddressValid] PRIMARY KEY CLUSTERED
> (
> [AddressID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[AddressValid] WITH NOCHECK ADD
> CONSTRAINT [IX_AddressValid] UNIQUE NONCLUSTERED
> (
> [streetName],
> [houseNo],
> [streetSuffix],
> [preDir],
> [postDir],
> [zip5],
> [zip4],
> [sud],
> [unitNum]
> ) ON [PRIMARY]
> GO
> CREATE INDEX [IX_Zip5] ON [dbo].[AddressValid]([zip5]) ON [PRIMARY]
> GO
> CREATE INDEX [AddressValid21] ON [dbo].[AddressValid]([AddressID],
> [useCodeID], [zip5],
> [countyCodeFips]) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[AddressValid] ADD
> CONSTRAINT [FK_AddressValid_AddressSource] FOREIGN KEY
> (
> [AddressID]
> ) REFERENCES [dbo].[AddressSource] (
> [addressID]
> ),
> CONSTRAINT [FK_AddressValid_datasource] FOREIGN KEY
> (
> [dataSourceID]
> ) REFERENCES [dbo].[datasource] (
> [DataSourceID]
> ),
> CONSTRAINT [FK_AddressValid_UseCode] FOREIGN KEY
> (
> [countyCodeFips],
> [useCodeID]
> ) REFERENCES [dbo].[UseCode] (
> [CountyFipsID],
> [UseCodeID]
> )
> GO
> CREATE TABLE [dbo].[UseCode] (
> [UseCodePK] [int] IDENTITY (1, 1) NOT NULL,
> [CountyFipsID] [char] (5) NOT NULL,
> [UseCodeID] [char] (6) NOT NULL,
> [descr] [varchar] (50) NOT NULL,
> [dateAdded] [smalldatetime] NOT NULL
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[UseCode] WITH NOCHECK ADD
> CONSTRAINT [PK_UseCode] PRIMARY KEY CLUSTERED
> (
> [UseCodePK]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[UseCode] WITH NOCHECK ADD
> CONSTRAINT [IX_UseCode] UNIQUE NONCLUSTERED
> (
> [CountyFipsID],
> [UseCodeID]
> ) ON [PRIMARY]
> GO
> ALTER TABLE [dbo].[UseCode] ADD
> CONSTRAINT [FK_UseCode_CountyFips] FOREIGN KEY
> (
> [CountyFipsID]
> ) REFERENCES [dbo].[CountyFips] (
> [CountyFipsID]
> )
> GO
>
> On Thu, 6 Oct 2005 18:14:28 -0400, "Andrew J. Kelly"
> <sqlmvpnooospam@.shadhawk.com> wrote:
>>Well one thing I see is that you should put SET NOCOUNT ON at the
>>beginning
>>of your sp but that should be the same on both.
Subscribe to:
Posts (Atom)