Skip to main content

Table Data Partition for Better Performance in SQL Server Data (With 2+ cr Records)

Dear Techies,

Today i am going practice DATA partition in sql server for better performance.
Please Follow the bellow steps for that.


  • Create a table where we will store 50 lacs records. 

  • Insert 50 lacs Sample Data using WHILE Loop

Declare @i int =0
While @i<5000000
BEGIN
Insert into DemoTableForPartition (Name,Address,Country,State,Education,Company)
values ('Test'+CONVERT(varchar,@i),'D-2017','India','UP','Master','Test Company')
SET @i=@i+1
END

  • Create Clone table for check difference.
select * into [DemoTableForWithoutPartition] from [DemoTableForPartition]





 --for ranges less than 4000 
ALTER DATABASE SIMPraDev ADD FILEGROUP FG1 
--for ranges between 4000 and 8000 
ALTER DATABASE SIMPraDev ADD FILEGROUP FG2 
--for ranges greater than 8000 
ALTER DATABASE SIMPraDev ADD FILEGROUP FG3 
ALTER DATABASE SIMPraDev ADD FILE(name='FG1',FILENAME='C:\tempfg1.ndf') TO FILEGROUP FG1 
--Add file to FG2 
ALTER DATABASE SIMPraDev ADD FILE(name='FG2',FILENAME='C:\tempfg2.ndf') TO FILEGROUP FG2 
--Add file to FG3 
ALTER DATABASE SIMPraDev ADD FILE(name='FG3',FILENAME='C:\tempfg3.ndf') TO FILEGROUP FG3

     

Comments

Popular posts from this blog

MVC Interview Questions

MVC Interview Questions What is MVC Application life cycle ? What is default route in MVC? What is Output Caching ? What are Route Constraints in MVC? What are the Benefits of Area in MVC? How do you implement Forms authentication in MVC? What are the Main Razor Syntax Rules? Define attribute based routing in MVC? What are HTML helpers in MVC? What does the MVC pattern define with 3 logical layers? What are the advantages of MVC? List the various return types of a controller action method. What are the types of filters? What are the Filters in MVC? What are the three segments for routing important? What is Route in MVC? what is the difference between ViewData and ViewBag? attribute based routing in MVC? What is GET and POST Actions Types? What is MVC (Model view controller)? What is Validation Summary in MVC? What’s new in the latest version of MVC? How to render html in Asp.net MVC view? Explain the concept of MVC Scaffolding? What is Bundling and Mini...

Azure Service Bus Vs Azure Web Job

MENU Home SUBSCRIBE Today, we will be talking about Azure service bus and how to use them with Webjobs. Azure Service Bus  is a messaging infrastructure that sits between applications allowing them to exchange messages for improved scale and resiliency. It offers the following capabilities: Queues: offers simple first in, first out guaranteed message delivery. When to use Azure Service Bus? Service Bus queues are a general-purpose technology that can be used for a wide variety of scenarios: Communication between web and worker roles in a multi-tier Azure application Communication between on-premises apps and Azure hosted apps in a hybrid solution Communication between components of a distributed application running on-premises in different organizations or departments of an organization There are also Topics and Relay capabiliteis but we will talk about them in the future. A figure that illustrates how Azure Service Bus works. There is a sender who send a mes...

Angular Step By Step Installation Process

# Angular Step By Step  Hello Techies,        In this post i am going to guide you to install Angular and create and run your first app. Please follow bellow steps.. Step 1 (Node NPM Installation) Node Js ( NPM)  should be installed on system. So for installation of Node Js follow bellow steps. Open  https://nodejs.org/en  .  Download stable Version (LTS) of Node js. After complete the installation open CMD and check the version. Step : 2 (Install Angular by NPM) Type " npm install -g @angular/cli "  2.  Select folder where you are going to create Angular Project.  3. Type ng new 'your app-name' EX:  ng new my-dream-app And Relax it will take some couple of minute to create app , because its downloading all the package from server by npm in you local system. Type : " cd my-dream-app " to select project which is created.  Now Type " ng serve " to run the project...