 | A community of more than 1,600,000 database professionals and growing |
| Featured ContentsFeatured Script |
| Balloons and Data This editorial was originally published on Aug 8. 2013. It is being re-run as Steve is out of the office. We see a lot of questions at SQLServerCentral repeated over the years as workers new to the platform encounter some of the issues that many of us have dealt with repeatedly over the years. One of the more common questions that I see in the SQLServerCentral forums has to do with tempdb growth. Many people coming to the SQL Server platform realize tempdb is a workspace, but they don't always understand how it works. Many times I see questions where people don't understand why tempdb will grow from it's default size. Even more surprising is that they don't understand why it doesn't shrink back to the default size. After all, it contains temporary information, and when it's not being used, the size should shrink, right? If only that were true, it would make administration simpler, though performance might be worse. Many people view the files in a computer like balloons. We add data and they grow. We remove data, and they shrink. However that's not the model for SQL Server files. Our mdf/ldf/ndf files are allocations, and once we allocate space, we don't remove it if no data is present. The allocations are available for the next time we need them, minus the time we spent requesting and receiving the allocation from the Operating System. The space you need for tempdb is the peak space you need for the largest set of temporary operations in your workload. Even if all your data sets are small, say 100kb, if you have 1000 of them occurring at once, you'll need 100MB of space. With sorts, intermediate worktables, and more, you could easily have an average data set above 10kb, which is why your tempdb size might need to grow. Just like with any other database, you need to monitor the size and load for tempdb. Adjust it as needed, based on your requirements, so that it will be properly sized each time to start the instance. The administration level isn't high for tempdb, as long as you have monitoring in place and you periodically perform the administration to appropriately size your system. Steve Jones from SQLServerCentral.comJoin the debate, and respond to today's editorial on the forums |
|
| ADVERTISEMENT |  | How to track every change to your SQL Server database See who’s changing your database, alongside affected objects, date, time, and reason for the change with SQL Source Control. Get a full change history in your source control system. Learn more. |
|  | Could you help with some research? The Foundry team at Redgate want to hear about your experience with SQL Server asset management. Fill in this short survey to help out, and also to enter their prize draw for a $100 Amazon gift card. Complete survey. |
|
|
|
| |  | Daniel Calbimonte from SQLServerCentral.com This time we will compare different solutions to copy system folders using different SSIS tasks. More » |
 | There are many instances when dates and times don't show up at your doorstep in the format you'd like it to be, nor does the output of a query fit the needs of the people viewing it. One option is to format the data in the application itself. Another option is to use the built-in functions SQL Server provides to format the date string for you. More » |
 | Ed Elliott from SQLServerCentral Blogs I have been quite interested by vs code and have been using it more and more recently. I use it... More » |
 | Daniel Janik from SQLServerCentral Blogs Sometimes it helps to go back to the basics and indexing is always a great topic. SQL Server has a... More » |
|
|
| | Today's Question (by Steve Jones): When do checkpoints in SQL Server not run on instance startup? |
Think you know the answer? Click here, and find out if you are right.
We keep track of your score to give you bragging rights against your peers. This question is worth 1 point in this category: Administration. We'd love to give you credit for your own question and answer. To submit a QOTD, simply log in to the Contribution Center. |
|
|
| |
ADVERTISEMENT | Prepare for Microsoft Exam 70-762, Developing SQL Databases –and help demonstrate your real-world mastery of skills for building and implementing databases across organizations. Designed for database professionals who build and implement databases across organizations and who ensure high levels of data availability, Exam Ref focuses on the critical-thinking and decision-making acumen needed for success at the MCSA level. Get your copy from Amazon today. |  | |
|
|
|
|
|
| Yesterday's Question of the Day |
| Yesterday's Question (by Thomas Franz): You create a simple In-Memory-Table: CREATE TABLE dbo.test (id TINYINT NOT NULL CONSTRAINT PK_test PRIMARY KEY NONCLUSTERED HASH (id) WITH (BUCKET_COUNT = 512), ) WITH (MEMORY_OPTIMIZED = ON, DURABILITY = SCHEMA_ONLY); Which Index_ID will the following query return: SELECT * FROM sys.indexes AS i WHERE i.object_id = OBJECT_ID('dbo.test') PS: when you want to test it, you need at least SQL 2014 Enterprise / Developer or any edition of SQL 2016 SP1 and have to add an In-Memory-Filegroup to your database. Answer: 2 - default for the first non-clustered index Explanation: In-Memory-Tables can't be created without at least one index (either an HASH or an NONCLUSTERED index). Since the data of the table will be stored only once in the memory, regardles of the number of indexes (they are only "pointer lists" to the next entry), they do not to count as HEAP -> answer 0 is wrong. Furthermore In-Memory-Tables does not support CLUSTERED indexes (aswere 1 is wrong). And because I created at least one index (and have a In-Memory-Filegroup in my database) both queries runs without an error, so the correct answer is Index_ID = 2. You have be aware of this unusual behavior, when you e.g. want to filter sys.indexes or sys.partitions for the "main" index of a table by using WHERE index_id < 2 , since this will return no rows for In-Memory-Tables References: click here
» Discuss this question and answer on the forums |
|
|
| | Andy Robertson from SQLServerCentral.com This script creates a table of functions. Then uses the sys.dm_sql_referencing_entities table function to find all the dependent objects for each function. The result is a table of functions with empty columns if the are no dependent objects or details of each dependent object. More » |
|
|
| Database Pros Who Need Your Help |
| Here's a few of the new posts today on the forums. To see more, visit the forums. Distribution Cleanup job Issue - My Distribution DB is keep on growing and the Distribution clean job fails with the below error. I have added the... owner of db file - Hi, I just checked and the owner of db file of a critical db server is blank, when I set it... How to use 'between' in CASE statement? - Hi Friends, I am trying to wirte a filter condition in WHERE clause like CASE WHEN GETDATE() = 'first of this month' THEN 'DATE... Summarize field by week of the month - Hi Guys! Hope you can help me with this. I have 3 tables as: table 1 A B C1 1 1/1/17 10 2 1/7/17 20 3... Slow Full Text Search on New Server - Got a new SQL Server, running SQL 2016 on Windows Server 2016. This VMWare at our hosting site. Server properties show... Batch Transaction (Begin Trans/Commit Trans) - DML Operation - Hi , I have a very Huge table (millions of the rows). I am performing a batch operation on it via... SignalR Deadlock - The below select is causing deadlock on our production box. How can i avoid this? The same query is running from... Drop/Create objects versus Alter - I am trying to put together some standards documents for development on a new team, and I received some sage... Why would SQL throw a Severity 016 alert?? following a successful db restore? - Hi all, Does anyone know why would SQL throwing a Severity 016 alert following a successful db restore, and what I... Single Node MSSQL 2012 cluster to Always on - We need to migrate one of our MSSQL instances in Production . The outgoing replication is to Informatica and is very... Extracting Episode Start and End Dates From Multiple Assignments - Hello, We have a Staff/Program Assignment that captures to whom and what program a particular patient is assigned. It's a historical... Querying Postcodes gracefully - Recently I've been getting an influx of requests asking me if I can find clients on our system that have... UNPIVOTING Columns - I have a table that looks like this: Memory consumption- Windows or SQL Server - Good morning Experts, How to find whether Windows is consuming high memory or SQL Server is consuming high memory Reporting Services: Special characters used in email addresses in subscription cause an error - Hi I'm struggling with a rare problem in the mail address in subscriptions in Reporting Services. Here in Denmark we, like in... ETL Processes and SOX - I've managed to largely avoid SOX ... up until now. I'd like to solicit opinions from those who know about this stuff. Consider... Skip last row EXCEL ssis Conditional Split - hi Hi I am using visual studio to write an ssis package Visual studio 2010 it imports and excel sheet of data... Copy data from flat file with multiple headers - Hi, I am trying to copy data from a flat file (CSV) which has multiple headers between the row values to... No PKs on fact tables - I just inherited a data warehouse where none of the fact tables have a primary key (all fact tables are... The OUTPUT clause - Looking for a couple articles here. One on basics of OUTPUT for inserts and deletes. One for updates and combining... |
|
| This email has been sent to newsletter@newslettercollector.com. To be removed from this list, please click here. If you have any problems leaving the list, please contact the webmaster@sqlservercentral.com.
| This newsletter was sent to you because you signed up at SQLServerCentral.com. Feel free to forward this to any colleagues that you think might be interested. If you have received this email from a colleague, you can register to receive it here.
| This transmission is ©2017 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. Contact: webmaster@sqlservercentral.com |
|
|