From jwcolby at colbyconsulting.com Wed Nov 3 18:02:15 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 03 Nov 2010 19:02:15 -0400 Subject: [dba-SQLServer] Limit SQL Server total CPU memory Message-ID: <4CD1E9F7.6090908@colbyconsulting.com> My SQL Server machine currently has 32 gigs of RAM and 8 processors. In the properties for the server, memory tab, I am telling SQL Server that it can have 26 gigs and 6 processors. I am currently running a microsoft VM on that server which needs 3 gigs and one processor, and I also want to leave the OS itself some memory (let's say 3 gigs). When I run a complex query I get physical memory usage climbing to 30.9 gigs (96%). I am wondering if I need to drop the memory assigned to SQL Server. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Wed Nov 3 18:57:43 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 03 Nov 2010 19:57:43 -0400 Subject: [dba-SQLServer] Limit SQL Server total CPU memory In-Reply-To: <4CD1E9F7.6090908@colbyconsulting.com> References: <4CD1E9F7.6090908@colbyconsulting.com> Message-ID: <4CD1F6F7.2010003@colbyconsulting.com> OK, I did pare back the memory to 24 gigs and now the same query only uses 90% of the memory. Of course it is back to back runs so it may already have cached some stuff. John W. Colby www.ColbyConsulting.com On 11/3/2010 7:02 PM, jwcolby wrote: > My SQL Server machine currently has 32 gigs of RAM and 8 processors. In the properties for the > server, memory tab, I am telling SQL Server that it can have 26 gigs and 6 processors. I am > currently running a microsoft VM on that server which needs 3 gigs and one processor, and I also > want to leave the OS itself some memory (let's say 3 gigs). > > When I run a complex query I get physical memory usage climbing to 30.9 gigs (96%). I am wondering > if I need to drop the memory assigned to SQL Server. > From jwcolby at colbyconsulting.com Wed Nov 3 20:22:11 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Wed, 03 Nov 2010 21:22:11 -0400 Subject: [dba-SQLServer] Comparative timings Message-ID: <4CD20AC3.2020308@colbyconsulting.com> I am processing an order for the client that i built this server for. One of the steps is to count the available records. The task, select 640K records from two related tables, 65 million names / addresses joined to 50 million records of demographics (the database from hell). Filter down to (male, high income, young) and (has kids or mail order buyers). The selection views return full name / address plus selection fields. Both tables have a clustered index on integer PK. The tables are joined on PK/FK (the key of the clustered index). Cover indexes on the selection fields. The tables are in separate databases, both databases on the same SSD (2 drive raid 0). The count simply counts the PKID of the selection view. The server was configured with 6 of 8 cores available to SQL Server and 24 gigs of RAM. The count ran consistently around 0:1:55 (one minute 55 secs). The system was only running the 6 cores around 20% -25% of capacity. I cut the processors assigned to 3 of 8 and reran the same count. The three assigned processors ran about 80% of capacity, but several of the processors not assigned to SQL Server also ran something, averaging about 30-40% of capacity. The time to do the count was about 3:36. I then cut the memory assigned to SQL Server to 12 gigs with 3 cores assigned. Again, the processors ran very similar to the last run, the three assigned to SQL Server ran around 60-80% but a couple of the other cores not assigned also did something significant - 30-40%. The time to do the count was 2:06. I then assigned 6 processors but 12 gigs of memory. The 6 processors assigned averaged around 80% for much of the time, but the total time was 1:53. I then jacked the memory back up to 24 gigs / 6 processors. Average core utilization dropped, the total time was 2:01. Just to see if it was an anomaly I dropped back down to 3 procs with 24 gigs of memory. 4:00 to process the count. And finally back to 12 gigs and 3 procs. 2:00 So 12 gigs and 3 cores produced equivalent results to 6 cores and 24 gigs (which I find fascinating and disturbing). 3 cores and 24 gigs put on a very poor show. And of course this test did not have the server doing anything else. I had intended to run a VM on the server though I am changing my mind. In preliminary tests, the vm did not perform as well as on the previous server. I believe it is probably a simple matter of clock speed. This server has 8 cores but they are clocked at 2 gigs. My previous server had only 4 cores but they were clocked at 3.2 gigs. The VM has always shown the best results with a single core and if the core is faster... So I will likely rebuild a server to just hold the vm. -- John W. Colby www.ColbyConsulting.com From Gustav at cactus.dk Thu Nov 4 01:38:50 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 04 Nov 2010 07:38:50 +0100 Subject: [dba-SQLServer] Comparative timings Message-ID: Hi John So 3 cores 12 GB runs at a speed only ~10% higher than that of 6 cores 24 GB. Interesting. Could you only run two instances ... /gustav >>> jwcolby at colbyconsulting.com 04-11-2010 02:22 >>> I am processing an order for the client that i built this server for. One of the steps is to count the available records. The task, select 640K records from two related tables, 65 million names / addresses joined to 50 million records of demographics (the database from hell). Filter down to (male, high income, young) and (has kids or mail order buyers). The selection views return full name / address plus selection fields. Both tables have a clustered index on integer PK. The tables are joined on PK/FK (the key of the clustered index). Cover indexes on the selection fields. The tables are in separate databases, both databases on the same SSD (2 drive raid 0). The count simply counts the PKID of the selection view. The server was configured with 6 of 8 cores available to SQL Server and 24 gigs of RAM. The count ran consistently around 0:1:55 (one minute 55 secs). The system was only running the 6 cores around 20% -25% of capacity. I cut the processors assigned to 3 of 8 and reran the same count. The three assigned processors ran about 80% of capacity, but several of the processors not assigned to SQL Server also ran something, averaging about 30-40% of capacity. The time to do the count was about 3:36. I then cut the memory assigned to SQL Server to 12 gigs with 3 cores assigned. Again, the processors ran very similar to the last run, the three assigned to SQL Server ran around 60-80% but a couple of the other cores not assigned also did something significant - 30-40%. The time to do the count was 2:06. I then assigned 6 processors but 12 gigs of memory. The 6 processors assigned averaged around 80% for much of the time, but the total time was 1:53. I then jacked the memory back up to 24 gigs / 6 processors. Average core utilization dropped, the total time was 2:01. Just to see if it was an anomaly I dropped back down to 3 procs with 24 gigs of memory. 4:00 to process the count. And finally back to 12 gigs and 3 procs. 2:00 So 12 gigs and 3 cores produced equivalent results to 6 cores and 24 gigs (which I find fascinating and disturbing). 3 cores and 24 gigs put on a very poor show. And of course this test did not have the server doing anything else. I had intended to run a VM on the server though I am changing my mind. In preliminary tests, the vm did not perform as well as on the previous server. I believe it is probably a simple matter of clock speed. This server has 8 cores but they are clocked at 2 gigs. My previous server had only 4 cores but they were clocked at 3.2 gigs. The VM has always shown the best results with a single core and if the core is faster... So I will likely rebuild a server to just hold the vm. -- John W. Colby www.ColbyConsulting.com From jwcolby at colbyconsulting.com Thu Nov 4 05:07:05 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 04 Nov 2010 06:07:05 -0400 Subject: [dba-SQLServer] Comparative timings In-Reply-To: References: Message-ID: <4CD285C9.1000701@colbyconsulting.com> Gustav, AFAIK I could run two instances. John W. Colby www.ColbyConsulting.com On 11/4/2010 2:38 AM, Gustav Brock wrote: > Hi John > > So 3 cores 12 GB runs at a speed only ~10% higher than that of 6 cores 24 GB. Interesting. > Could you only run two instances ... > > /gustav > > >>>> jwcolby at colbyconsulting.com 04-11-2010 02:22>>> > I am processing an order for the client that i built this server for. One of the steps is to count > the available records. > > The task, select 640K records from two related tables, 65 million names / addresses joined to 50 > million records of demographics (the database from hell). Filter down to (male, high income, young) > and (has kids or mail order buyers). The selection views return full name / address plus selection > fields. > > Both tables have a clustered index on integer PK. The tables are joined on PK/FK (the key of the > clustered index). Cover indexes on the selection fields. The tables are in separate databases, > both databases on the same SSD (2 drive raid 0). The count simply counts the PKID of the selection > view. > > The server was configured with 6 of 8 cores available to SQL Server and 24 gigs of RAM. The count > ran consistently around 0:1:55 (one minute 55 secs). The system was only running the 6 cores around > 20% -25% of capacity. > > I cut the processors assigned to 3 of 8 and reran the same count. The three assigned processors ran > about 80% of capacity, but several of the processors not assigned to SQL Server also ran something, > averaging about 30-40% of capacity. The time to do the count was about 3:36. > > I then cut the memory assigned to SQL Server to 12 gigs with 3 cores assigned. Again, the > processors ran very similar to the last run, the three assigned to SQL Server ran around 60-80% but > a couple of the other cores not assigned also did something significant - 30-40%. The time to do > the count was 2:06. > > I then assigned 6 processors but 12 gigs of memory. The 6 processors assigned averaged around 80% > for much of the time, but the total time was 1:53. > > I then jacked the memory back up to 24 gigs / 6 processors. Average core utilization dropped, the > total time was 2:01. > > Just to see if it was an anomaly I dropped back down to 3 procs with 24 gigs of memory. 4:00 to > process the count. > > And finally back to 12 gigs and 3 procs. 2:00 > > So 12 gigs and 3 cores produced equivalent results to 6 cores and 24 gigs (which I find fascinating > and disturbing). 3 cores and 24 gigs put on a very poor show. > > And of course this test did not have the server doing anything else. > > I had intended to run a VM on the server though I am changing my mind. In preliminary tests, the vm > did not perform as well as on the previous server. I believe it is probably a simple matter of > clock speed. This server has 8 cores but they are clocked at 2 gigs. My previous server had only 4 > cores but they were clocked at 3.2 gigs. The VM has always shown the best results with a single > core and if the core is faster... > > So I will likely rebuild a server to just hold the vm. > From Gustav at cactus.dk Thu Nov 4 05:43:25 2010 From: Gustav at cactus.dk (Gustav Brock) Date: Thu, 04 Nov 2010 11:43:25 +0100 Subject: [dba-SQLServer] Comparative timings Message-ID: Hi John I meant running the same job. But then you should be able to split it somehow. /gustav >>> jwcolby at colbyconsulting.com 04-11-2010 11:07 >>> Gustav, AFAIK I could run two instances. John W. Colby www.ColbyConsulting.com On 11/4/2010 2:38 AM, Gustav Brock wrote: > Hi John > > So 3 cores 12 GB runs at a speed only ~10% higher than that of 6 cores 24 GB. Interesting. > Could you only run two instances ... > > /gustav > > >>>> jwcolby at colbyconsulting.com 04-11-2010 02:22>>> > I am processing an order for the client that i built this server for. One of the steps is to count > the available records. > > The task, select 640K records from two related tables, 65 million names / addresses joined to 50 > million records of demographics (the database from hell). Filter down to (male, high income, young) > and (has kids or mail order buyers). The selection views return full name / address plus selection > fields. > > Both tables have a clustered index on integer PK. The tables are joined on PK/FK (the key of the > clustered index). Cover indexes on the selection fields. The tables are in separate databases, > both databases on the same SSD (2 drive raid 0). The count simply counts the PKID of the selection > view. > > The server was configured with 6 of 8 cores available to SQL Server and 24 gigs of RAM. The count > ran consistently around 0:1:55 (one minute 55 secs). The system was only running the 6 cores around > 20% -25% of capacity. > > I cut the processors assigned to 3 of 8 and reran the same count. The three assigned processors ran > about 80% of capacity, but several of the processors not assigned to SQL Server also ran something, > averaging about 30-40% of capacity. The time to do the count was about 3:36. > > I then cut the memory assigned to SQL Server to 12 gigs with 3 cores assigned. Again, the > processors ran very similar to the last run, the three assigned to SQL Server ran around 60-80% but > a couple of the other cores not assigned also did something significant - 30-40%. The time to do > the count was 2:06. > > I then assigned 6 processors but 12 gigs of memory. The 6 processors assigned averaged around 80% > for much of the time, but the total time was 1:53. > > I then jacked the memory back up to 24 gigs / 6 processors. Average core utilization dropped, the > total time was 2:01. > > Just to see if it was an anomaly I dropped back down to 3 procs with 24 gigs of memory. 4:00 to > process the count. > > And finally back to 12 gigs and 3 procs. 2:00 > > So 12 gigs and 3 cores produced equivalent results to 6 cores and 24 gigs (which I find fascinating > and disturbing). 3 cores and 24 gigs put on a very poor show. > > And of course this test did not have the server doing anything else. > > I had intended to run a VM on the server though I am changing my mind. In preliminary tests, the vm > did not perform as well as on the previous server. I believe it is probably a simple matter of > clock speed. This server has 8 cores but they are clocked at 2 gigs. My previous server had only 4 > cores but they were clocked at 3.2 gigs. The VM has always shown the best results with a single > core and if the core is faster... > > So I will likely rebuild a server to just hold the vm. > _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com From jwcolby at colbyconsulting.com Thu Nov 4 05:49:09 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 04 Nov 2010 06:49:09 -0400 Subject: [dba-SQLServer] Comparative timings In-Reply-To: References: Message-ID: <4CD28FA5.7040701@colbyconsulting.com> Well, the thing to remember is that this server could be very busy as it is. I have written about my 4 stage process for address validation, so I could have all kinds of processes running simultaneously. I believe that if I had processes exporting from SQL Server to CSV for address validation, other processes importing completed validation back in, as well as order processing, I would be keeping all cores very busy. John W. Colby www.ColbyConsulting.com On 11/4/2010 6:43 AM, Gustav Brock wrote: > Hi John > > I meant running the same job. But then you should be able to split it somehow. > > /gustav > > >>>> jwcolby at colbyconsulting.com 04-11-2010 11:07>>> > Gustav, > > AFAIK I could run two instances. > > John W. Colby > www.ColbyConsulting.com > > On 11/4/2010 2:38 AM, Gustav Brock wrote: >> Hi John >> >> So 3 cores 12 GB runs at a speed only ~10% higher than that of 6 cores 24 GB. Interesting. >> Could you only run two instances ... >> >> /gustav >> >> >>>>> jwcolby at colbyconsulting.com 04-11-2010 02:22>>> >> I am processing an order for the client that i built this server for. One of the steps is to count >> the available records. >> >> The task, select 640K records from two related tables, 65 million names / addresses joined to 50 >> million records of demographics (the database from hell). Filter down to (male, high income, young) >> and (has kids or mail order buyers). The selection views return full name / address plus selection >> fields. >> >> Both tables have a clustered index on integer PK. The tables are joined on PK/FK (the key of the >> clustered index). Cover indexes on the selection fields. The tables are in separate databases, >> both databases on the same SSD (2 drive raid 0). The count simply counts the PKID of the selection >> view. >> >> The server was configured with 6 of 8 cores available to SQL Server and 24 gigs of RAM. The count >> ran consistently around 0:1:55 (one minute 55 secs). The system was only running the 6 cores around >> 20% -25% of capacity. >> >> I cut the processors assigned to 3 of 8 and reran the same count. The three assigned processors ran >> about 80% of capacity, but several of the processors not assigned to SQL Server also ran something, >> averaging about 30-40% of capacity. The time to do the count was about 3:36. >> >> I then cut the memory assigned to SQL Server to 12 gigs with 3 cores assigned. Again, the >> processors ran very similar to the last run, the three assigned to SQL Server ran around 60-80% but >> a couple of the other cores not assigned also did something significant - 30-40%. The time to do >> the count was 2:06. >> >> I then assigned 6 processors but 12 gigs of memory. The 6 processors assigned averaged around 80% >> for much of the time, but the total time was 1:53. >> >> I then jacked the memory back up to 24 gigs / 6 processors. Average core utilization dropped, the >> total time was 2:01. >> >> Just to see if it was an anomaly I dropped back down to 3 procs with 24 gigs of memory. 4:00 to >> process the count. >> >> And finally back to 12 gigs and 3 procs. 2:00 >> >> So 12 gigs and 3 cores produced equivalent results to 6 cores and 24 gigs (which I find fascinating >> and disturbing). 3 cores and 24 gigs put on a very poor show. >> >> And of course this test did not have the server doing anything else. >> >> I had intended to run a VM on the server though I am changing my mind. In preliminary tests, the vm >> did not perform as well as on the previous server. I believe it is probably a simple matter of >> clock speed. This server has 8 cores but they are clocked at 2 gigs. My previous server had only 4 >> cores but they were clocked at 3.2 gigs. The VM has always shown the best results with a single >> core and if the core is faster... >> >> So I will likely rebuild a server to just hold the vm. >> > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From fhtapia at gmail.com Thu Nov 4 08:39:17 2010 From: fhtapia at gmail.com (Francisco Tapia) Date: Thu, 4 Nov 2010 06:39:17 -0700 Subject: [dba-SQLServer] Comparative timings In-Reply-To: <4CD20AC3.2020308@colbyconsulting.com> References: <4CD20AC3.2020308@colbyconsulting.com> Message-ID: John, Just curious but did you shut down the instance after each change or clear the buffers and cache to ensure proper benchmarking? You can clear the cache by running DBCC DROPCLEANBUFFERS, Then run DBCC FREEPROCCACHE, which clears the stored procedure cache. -Francisco http://bit.ly/sqlthis | Tsql and More... On Wed, Nov 3, 2010 at 6:22 PM, jwcolby wrote: > I am processing an order for the client that i built this server for. One > of the steps is to count > the available records. > > The task, select 640K records from two related tables, 65 million names / > addresses joined to 50 > million records of demographics (the database from hell). Filter down to > (male, high income, young) > and (has kids or mail order buyers). The selection views return full name > / address plus selection > fields. > > Both tables have a clustered index on integer PK. The tables are joined on > PK/FK (the key of the > clustered index). Cover indexes on the selection fields. The tables are > in separate databases, > both databases on the same SSD (2 drive raid 0). The count simply counts > the PKID of the selection > view. > > The server was configured with 6 of 8 cores available to SQL Server and 24 > gigs of RAM. The count > ran consistently around 0:1:55 (one minute 55 secs). The system was only > running the 6 cores around > 20% -25% of capacity. > > I cut the processors assigned to 3 of 8 and reran the same count. The > three assigned processors ran > about 80% of capacity, but several of the processors not assigned to SQL > Server also ran something, > averaging about 30-40% of capacity. The time to do the count was about > 3:36. > > I then cut the memory assigned to SQL Server to 12 gigs with 3 cores > assigned. Again, the > processors ran very similar to the last run, the three assigned to SQL > Server ran around 60-80% but > a couple of the other cores not assigned also did something significant - > 30-40%. The time to do > the count was 2:06. > > I then assigned 6 processors but 12 gigs of memory. The 6 processors > assigned averaged around 80% > for much of the time, but the total time was 1:53. > > I then jacked the memory back up to 24 gigs / 6 processors. Average core > utilization dropped, the > total time was 2:01. > > Just to see if it was an anomaly I dropped back down to 3 procs with 24 > gigs of memory. 4:00 to > process the count. > > And finally back to 12 gigs and 3 procs. 2:00 > > So 12 gigs and 3 cores produced equivalent results to 6 cores and 24 gigs > (which I find fascinating > and disturbing). 3 cores and 24 gigs put on a very poor show. > > And of course this test did not have the server doing anything else. > > I had intended to run a VM on the server though I am changing my mind. In > preliminary tests, the vm > did not perform as well as on the previous server. I believe it is > probably a simple matter of > clock speed. This server has 8 cores but they are clocked at 2 gigs. My > previous server had only 4 > cores but they were clocked at 3.2 gigs. The VM has always shown the best > results with a single > core and if the core is faster... > > So I will likely rebuild a server to just hold the vm. > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Thu Nov 4 08:50:13 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 04 Nov 2010 09:50:13 -0400 Subject: [dba-SQLServer] Comparative timings In-Reply-To: References: <4CD20AC3.2020308@colbyconsulting.com> Message-ID: <4CD2BA15.8070304@colbyconsulting.com> LOL, of course not. ;) It did appear to notice the memory changes, i.e. I could watch the memory used rise and fall out in task manager as SQL Server grabbed and released the memory. I no longer use stored procedures btw, all of this stuff was directly executing a view - select * from vCntXyZ in a query window. John W. Colby www.ColbyConsulting.com On 11/4/2010 9:39 AM, Francisco Tapia wrote: > John, > Just curious but did you shut down the instance after each change or clear > the buffers and cache to ensure proper benchmarking? > > You can clear the cache by running DBCC DROPCLEANBUFFERS, Then run DBCC > FREEPROCCACHE, which clears the stored procedure cache. > > -Francisco > http://bit.ly/sqlthis | Tsql and More... > > > > > On Wed, Nov 3, 2010 at 6:22 PM, jwcolby wrote: > >> I am processing an order for the client that i built this server for. One >> of the steps is to count >> the available records. >> >> The task, select 640K records from two related tables, 65 million names / >> addresses joined to 50 >> million records of demographics (the database from hell). Filter down to >> (male, high income, young) >> and (has kids or mail order buyers). The selection views return full name >> / address plus selection >> fields. >> >> Both tables have a clustered index on integer PK. The tables are joined on >> PK/FK (the key of the >> clustered index). Cover indexes on the selection fields. The tables are >> in separate databases, >> both databases on the same SSD (2 drive raid 0). The count simply counts >> the PKID of the selection >> view. >> >> The server was configured with 6 of 8 cores available to SQL Server and 24 >> gigs of RAM. The count >> ran consistently around 0:1:55 (one minute 55 secs). The system was only >> running the 6 cores around >> 20% -25% of capacity. >> >> I cut the processors assigned to 3 of 8 and reran the same count. The >> three assigned processors ran >> about 80% of capacity, but several of the processors not assigned to SQL >> Server also ran something, >> averaging about 30-40% of capacity. The time to do the count was about >> 3:36. >> >> I then cut the memory assigned to SQL Server to 12 gigs with 3 cores >> assigned. Again, the >> processors ran very similar to the last run, the three assigned to SQL >> Server ran around 60-80% but >> a couple of the other cores not assigned also did something significant - >> 30-40%. The time to do >> the count was 2:06. >> >> I then assigned 6 processors but 12 gigs of memory. The 6 processors >> assigned averaged around 80% >> for much of the time, but the total time was 1:53. >> >> I then jacked the memory back up to 24 gigs / 6 processors. Average core >> utilization dropped, the >> total time was 2:01. >> >> Just to see if it was an anomaly I dropped back down to 3 procs with 24 >> gigs of memory. 4:00 to >> process the count. >> >> And finally back to 12 gigs and 3 procs. 2:00 >> >> So 12 gigs and 3 cores produced equivalent results to 6 cores and 24 gigs >> (which I find fascinating >> and disturbing). 3 cores and 24 gigs put on a very poor show. >> >> And of course this test did not have the server doing anything else. >> >> I had intended to run a VM on the server though I am changing my mind. In >> preliminary tests, the vm >> did not perform as well as on the previous server. I believe it is >> probably a simple matter of >> clock speed. This server has 8 cores but they are clocked at 2 gigs. My >> previous server had only 4 >> cores but they were clocked at 3.2 gigs. The VM has always shown the best >> results with a single >> core and if the core is faster... >> >> So I will likely rebuild a server to just hold the vm. >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-SQLServer mailing list >> dba-SQLServer at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Thu Nov 4 09:51:48 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Thu, 04 Nov 2010 10:51:48 -0400 Subject: [dba-SQLServer] SQL Server - selecting preferred records Message-ID: <4CD2C884.3060708@colbyconsulting.com> I have a query where I need to select sets of records: (Children_0_3 and income in(XYZ)) (Children_4_7 and income in(XYZ)) . . etc. (Age in (1,2) and income in (ABC)) I need to select the first group, then the next etc until I total 540K records. Basically I need to select the records with something in any of the Children_X_Y fields and after that select from the last group. Is there a way to do that directly in SQL? -- John W. Colby www.ColbyConsulting.com From stuart at lexacorp.com.pg Thu Nov 4 18:16:32 2010 From: stuart at lexacorp.com.pg (Stuart McLachlan) Date: Fri, 05 Nov 2010 09:16:32 +1000 Subject: [dba-SQLServer] [AccessD] SQL Server - selecting preferred records In-Reply-To: <4CD2C884.3060708@colbyconsulting.com> References: <4CD2C884.3060708@colbyconsulting.com> Message-ID: <4CD33ED0.5280.9AE92FE@stuart.lexacorp.com.pg> Something like this? Select top 540000 from (select 1 as seq, RecordPK from table1 where (Children_0_3 and income in(XYZ)) or (Children_4_7 and income in(XYZ)) Order by Seq .... UNION select 2 as seq, RecordPK from table1 where (Age in (1,2) and income in (ABC))) On 4 Nov 2010 at 10:51, jwcolby wrote: > I have a query where I need to select sets of records: > > (Children_0_3 and income in(XYZ)) > (Children_4_7 and income in(XYZ)) > . > . > etc. > (Age in (1,2) and income in (ABC)) > > I need to select the first group, then the next etc until I total 540K > records. > > Basically I need to select the records with something in any of the > Children_X_Y fields and after that select from the last group. > > Is there a way to do that directly in SQL? > > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > From fhtapia at gmail.com Fri Nov 5 10:24:53 2010 From: fhtapia at gmail.com (Francisco Tapia) Date: Fri, 5 Nov 2010 08:24:53 -0700 Subject: [dba-SQLServer] SQL Server - selecting preferred records In-Reply-To: <4CD2C884.3060708@colbyconsulting.com> References: <4CD2C884.3060708@colbyconsulting.com> Message-ID: are you trying to select an even number of records within the 540k? or is the order fulfilled if the first group of records hits 540k? -Francisco http://bit.ly/sqlthis | Tsql and More... On Thu, Nov 4, 2010 at 7:51 AM, jwcolby wrote: > I have a query where I need to select sets of records: > > (Children_0_3 and income in(XYZ)) > (Children_4_7 and income in(XYZ)) > . > . > etc. > (Age in (1,2) and income in (ABC)) > > I need to select the first group, then the next etc until I total 540K > records. > > Basically I need to select the records with something in any of the > Children_X_Y fields > and after that select from the last group. > > Is there a way to do that directly in SQL? > > > -- > John W. Colby > www.ColbyConsulting.com > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From jwcolby at colbyconsulting.com Fri Nov 5 13:04:35 2010 From: jwcolby at colbyconsulting.com (jwcolby) Date: Fri, 05 Nov 2010 14:04:35 -0400 Subject: [dba-SQLServer] SQL Server - selecting preferred records In-Reply-To: References: <4CD2C884.3060708@colbyconsulting.com> Message-ID: <4CD44733.1080606@colbyconsulting.com> The order is fulfilled as soon as I get 540K, from wherever they might come from. John W. Colby www.ColbyConsulting.com On 11/5/2010 11:24 AM, Francisco Tapia wrote: > are you trying to select an even number of records within the 540k? or is > the order fulfilled if the first group of records hits 540k? > > > -Francisco > http://bit.ly/sqlthis | Tsql and More... > > > > > On Thu, Nov 4, 2010 at 7:51 AM, jwcolby wrote: > >> I have a query where I need to select sets of records: >> >> (Children_0_3 and income in(XYZ)) >> (Children_4_7 and income in(XYZ)) >> . >> . >> etc. >> (Age in (1,2) and income in (ABC)) >> >> I need to select the first group, then the next etc until I total 540K >> records. >> >> Basically I need to select the records with something in any of the >> Children_X_Y fields >> and after that select from the last group. >> >> Is there a way to do that directly in SQL? >> >> >> -- >> John W. Colby >> www.ColbyConsulting.com >> _______________________________________________ >> dba-SQLServer mailing list >> dba-SQLServer at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > From fhtapia at gmail.com Fri Nov 5 13:34:26 2010 From: fhtapia at gmail.com (Francisco Tapia) Date: Fri, 5 Nov 2010 11:34:26 -0700 Subject: [dba-SQLServer] SQL Server - selecting preferred records In-Reply-To: <4CD44733.1080606@colbyconsulting.com> References: <4CD2C884.3060708@colbyconsulting.com> <4CD44733.1080606@colbyconsulting.com> Message-ID: If that's the case why not do a Select top 540000 * from ( Select fields from table where criteria 1 Union Select fields from table where criteria 2 ... ) Sent from my mobile On Nov 5, 2010, at 11:04 AM, jwcolby wrote: > The order is fulfilled as soon as I get 540K, from wherever they might come from. > > John W. Colby > www.ColbyConsulting.com > > On 11/5/2010 11:24 AM, Francisco Tapia wrote: >> are you trying to select an even number of records within the 540k? or is >> the order fulfilled if the first group of records hits 540k? >> >> >> -Francisco >> http://bit.ly/sqlthis | Tsql and More... >> >> >> >> >> On Thu, Nov 4, 2010 at 7:51 AM, jwcolby wrote: >> >>> I have a query where I need to select sets of records: >>> >>> (Children_0_3 and income in(XYZ)) >>> (Children_4_7 and income in(XYZ)) >>> . >>> . >>> etc. >>> (Age in (1,2) and income in (ABC)) >>> >>> I need to select the first group, then the next etc until I total 540K >>> records. >>> >>> Basically I need to select the records with something in any of the >>> Children_X_Y fields >>> and after that select from the last group. >>> >>> Is there a way to do that directly in SQL? >>> >>> >>> -- >>> John W. Colby >>> www.ColbyConsulting.com >>> _______________________________________________ >>> dba-SQLServer mailing list >>> dba-SQLServer at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >>> http://www.databaseadvisors.com >>> >>> >> _______________________________________________ >> dba-SQLServer mailing list >> dba-SQLServer at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver >> http://www.databaseadvisors.com >> >> > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > From paul.hartland at googlemail.com Mon Nov 29 04:46:39 2010 From: paul.hartland at googlemail.com (Paul Hartland) Date: Mon, 29 Nov 2010 10:46:39 +0000 Subject: [dba-SQLServer] Reporting Services (2005) Subscriptions Message-ID: To all, We have a lot of reports on SSRS 2005, a fair amount of these have subscriptions and are automatically run on a daily/weekly basis. Is there a way to find out how many subscriptions contain a certain email address, and change or delete that email address ? i.e. where a subscription contains the email address oldname at address.co.ukreplace with with newname at address.co.uk Thanks in advance for any help on this. -- Paul Hartland paul.hartland at googlemail.com From David at sierranevada.com Mon Nov 29 12:23:45 2010 From: David at sierranevada.com (David Lewis) Date: Mon, 29 Nov 2010 10:23:45 -0800 Subject: [dba-SQLServer] Reporting services In-Reply-To: References: Message-ID: <01606FC26AD0E54B8348D886D0C074D33D799628B3@schwarz.sierranevada.corp> In the reportserver db there a number of tables that store all this data. You are interested mostly in ReportServer.dbo.Subscriptions, and the column is [ExtensionSettings]. dl ---------------------------------------------------------------------- Message: 1 Date: Mon, 29 Nov 2010 10:46:39 +0000 From: Paul Hartland Subject: [dba-SQLServer] Reporting Services (2005) Subscriptions To: SQLServerList Message-ID: Content-Type: text/plain; charset=ISO-8859-1 To all, We have a lot of reports on SSRS 2005, a fair amount of these have subscriptions and are automatically run on a daily/weekly basis. Is there a way to find out how many subscriptions contain a certain email address, and change or delete that email address ? i.e. where a subscription contains the email address oldname at address.co.ukreplace with with newname at address.co.uk Thanks in advance for any help on this. -- Paul Hartland paul.hartland at googlemail.com ------------------------------ The contents of this e-mail message and its attachments are covered by the Electronic Communications Privacy Act (18 U.S.C. 2510-2521) and are intended solely for the addressee(s) hereof. If you are not the named recipient, or the employee or agent responsible for delivering the message to the intended recipient, or if this message has been addressed to you in error, you are directed not to read, disclose, reproduce, distribute, disseminate or otherwise use this transmission. If you have received this communication in error, please notify us immediately by return e-mail or by telephone, 530-893-3520, and delete and/or destroy all copies of the message immediately. From paul.hartland at googlemail.com Tue Nov 30 01:17:03 2010 From: paul.hartland at googlemail.com (Paul Hartland) Date: Tue, 30 Nov 2010 07:17:03 +0000 Subject: [dba-SQLServer] Reporting services In-Reply-To: <01606FC26AD0E54B8348D886D0C074D33D799628B3@schwarz.sierranevada.corp> References: <01606FC26AD0E54B8348D886D0C074D33D799628B3@schwarz.sierranevada.corp> Message-ID: David, Thanks a lot, I was sure there must be a way to do it, but even my project manager said there wasnt. Makes my life so much easier. Thank you again. Paul On 29 November 2010 18:23, David Lewis wrote: > In the reportserver db there a number of tables that store all this data. > You are interested mostly in ReportServer.dbo.Subscriptions, and the column > is [ExtensionSettings]. dl > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 29 Nov 2010 10:46:39 +0000 > From: Paul Hartland > Subject: [dba-SQLServer] Reporting Services (2005) Subscriptions > To: SQLServerList > Message-ID: > > Content-Type: text/plain; charset=ISO-8859-1 > > To all, > > We have a lot of reports on SSRS 2005, a fair amount of these have > subscriptions and are automatically run on a daily/weekly basis. Is there > a > way to find out how many subscriptions contain a certain email address, and > change or delete that email address ? > > i.e. where a subscription contains the email address > oldname at address.co.ukreplace with with > newname at address.co.uk > > Thanks in advance for any help on this. > > -- > Paul Hartland > paul.hartland at googlemail.com > > > ------------------------------ > > > The contents of this e-mail message and its attachments are covered by the > Electronic Communications Privacy Act (18 U.S.C. 2510-2521) and are intended > solely for the addressee(s) hereof. If you are not the named recipient, or > the employee or agent responsible for delivering the message to the intended > recipient, or if this message has been addressed to you in error, you are > directed not to read, disclose, reproduce, distribute, disseminate or > otherwise use this transmission. If you have received this communication in > error, please notify us immediately by return e-mail or by telephone, > 530-893-3520, and delete and/or destroy all copies of the message > immediately. > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > > -- Paul Hartland paul.hartland at googlemail.com