This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
t .NAME AS TableName, | |
i .name as indexName, | |
p .[Rows], | |
sum(a .total_pages) as TotalPages , | |
sum(a .used_pages) as UsedPages , | |
sum(a .data_pages) as DataPages , | |
(sum( a.total_pages ) * 8) / 1024 as TotalSpaceMB, | |
(sum( a.used_pages ) * 8) / 1024 as UsedSpaceMB, | |
(sum( a.data_pages ) * 8) / 1024 as DataSpaceMB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`cd $(dirname $0) && pwd` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
----- Esc ----- | |
Quick change directory: Esc + c | |
Quick change directory history: Esc + c and then Esc + h | |
Quick change directory previous entry: Esc + c and then Esc + p | |
Command line history: Esc + h | |
Command line previous command: Esc + p | |
View change: Esc + t (each time you do this shortcut a new directory view will appear) | |
Print current working directory in command line: Esc + a | |
Switch between background command line and MC: Ctrl + o | |
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Key Bingings - Eclipse / Spring Source Tool Suite | |
Source: http://zeroturnaround.com/rebellabs/top-java-ide-keyboard-shortcuts-for-eclipse-intellij-idea-netbeans/ | |
Eclipse STS | |
SEARCH | |
Find Usages ⌘ + Shift + G ⌘ + Shift + G | |
Find / Replace in file ⌘ + F ⌘ + F | |
Find / Replace in projects Ctrl + H Ctrl + H | |
Find next ⌘ + K ⌘ + K |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
SCHEMA_NAME(schema_id) AS SchemaName, | |
OBJECT_NAME(o.object_id) AS ObjectName, | |
type AS ObjectType, | |
s.name AS StatsName, | |
STATS_DATE(o.object_id, stats_id) AS StatsDate | |
FROM sys.stats s | |
INNER JOIN sys.objects o ON o.object_id=s.object_id | |
WHERE OBJECTPROPERTY(o.object_id, N'ISMSShipped') = 0 | |
AND LEFT(s.Name, 4) != '_WA_' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
OBJECT_NAME(ind.OBJECT_ID) AS TableName, | |
ind.name AS IndexName, | |
indexstats.index_type_desc AS IndexType, | |
indexstats.avg_fragmentation_in_percent | |
FROM sys.dm_db_index_physical_stats(DB_ID(), NULL, NULL, NULL, NULL) indexstats | |
INNER JOIN sys.indexes ind ON ind.object_id = indexstats.object_id AND ind.index_id = indexstats.index_id | |
WHERE indexstats.avg_fragmentation_in_percent > 30--You can specify the percent as you want | |
ORDER BY | |
indexstats.avg_fragmentation_in_percent DESC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Source: http://simplesqlserver.com/2013/11/20/indexing-fundamentals/ | |
DECLARE @TableName VarChar(100) | |
SELECT @TableName = '%' | |
SELECT TableName = i.SchemaName + '.' + i.TableName | |
, IndexName = ISNULL(i.IndexName, '[' + Lower(i.IndexType) + ']') | |
--, SeekUpdateRatio = CASE WHEN i.User_Updates > 0 THEN CAST(i.User_Seeks / CAST(i.User_Updates as DEC(20,1)) as DEC(20,2)) ELSE 0 END | |
, i.User_Updates | |
, i.User_Seeks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- DO NOT RUN this script on Production environment | |
-- Clear the plan cache | |
dbcc freeproccache | |
-- Look at the cached query plans | |
select st.text,* | |
from sys.dm_exec_cached_plans cp | |
cross apply sys.dm_exec_sql_text(cp.plan_handle) st | |
where (st.text like '%select * from Person.Address%') | |
and st.text not like '%select st.text%' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT TOP 1000000 | |
IDENTITY(INT,1,1) AS UniqueInt, | |
CAST(NEWID() AS VARCHAR(36)) AS UniqueVarChar | |
INTO #TestTable | |
FROM Master.sys.All_Columns ac1 | |
CROSS JOIN Master.sys.All_Columns ac2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure("2") do |config| | |
config.vm.define "lb" do |lb| | |
lb.vm.box = "centos65" | |
lb.vm.host_name = "lb" | |
lb.vm.network "private_network", ip: "192.168.0.20" | |
lb.vm.network :forwarded_port, guest: 22, host: 2220, id: "ssh", auto_correct: true | |
lb.vm.network :forwarded_port, guest: 80, host: 9099, id: "web", auto_correct: true | |
config.vm.provider :virtualbox do |vb| |
OlderNewer