Parameters | Clustered | Non-clustered |
---|---|---|
Use for | You can sort the records and store clustered index physically in memory as per the order. | A non-clustered index helps you to creates a logical order for data rows and uses pointers for physical data files. |
Storing method | Allows you to stores data pages in the leaf nodes of the index. | This indexing method never stores data pages in the leaf nodes of the index. |
Size | The size of the clustered index is quite large. | The size of the non-clustered index is small compared to the clustered index. |
Data accessing | Faster | Slower compared to the clustered index |
Additional disk space | Not Required | Required to store the index separately |
Type of key | By Default Primary Keys Of The Table is a Clustered Index. | It can be used with unique constraint on the table which acts as a composite key. |
Main feature | A clustered index can improve the performance of data retrieval. | It should be created on columns which are used in joins. |
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
public bool HasAccessTo(int profileValue, ApplicationRole roleToCheck){ | |
return (profileValue & roleToCheck) === roleToCheck | |
} | |
// Will result true | |
bool result= HasAccesTo(21,ApplicationRole.Contributor); | |
// Will result false | |
bool result= HasAccesTo(21,ApplicationRole.Administrator); |
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
public enum ApplicationRole | |
{ | |
Visitor=1, | |
Reader=2, | |
Contributor=4, | |
Administrator=8, | |
Owner=16 | |
} |
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
{ | |
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", | |
"final_space": true, | |
"console_title_template": "{{.Folder}}{{if .Root}} :: root{{end}} :: {{.Shell}}", | |
"tooltips": [ | |
{ | |
"type": "git", | |
"tips": [ | |
"git", | |
"gi", |
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
const postbox = "fhem.0.Postbox.state" | |
const deskLamp = "wled.0.84f3ebb2f0d2" | |
on('fhem.0.Postbox.state', _ => { | |
if (_.state.val == "closed") { | |
setState("".concat(deskLamp, ".on"), true); | |
setState("".concat(deskLamp, ".seg.0.fx"), 37); | |
setTimeout(() => { | |
setState("".concat(deskLamp, ".on"), false); | |
setState("".concat(deskLamp, ".seg.0.fx"), 0); |
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
public class RequestTool | |
{ | |
readonly readonly HttpClient client; | |
public DbRepo(HttpClient client) | |
{ | |
this.client = client; | |
} |
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
public class Startup : Startup | |
{ | |
static IAsyncPolicy<HttpResponseMessage> GetRetryPolicy() | |
{ | |
var retryWithJitterPolicy = HttpPolicyExtensions | |
.HandleTransientHttpError() | |
.OrResult(msg => msg.StatusCode == System.Net.HttpStatusCode.Forbidden) | |
.OrResult(msg => msg.StatusCode == System.Net.HttpStatusCode.Unauthorized) |
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
CREATE NONCLUSTERED INDEX [MyIndex] ON [dbo].[MyTable] ([Field]) INCLUDE ([Field2]) ON [INDEX] |
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
create table person | |
( | |
id bigint, | |
name varchar(500), | |
surname varchar(500) | |
) | |
on [PRIMARY] |
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 S.name as 'Schema', | |
T.name as 'Table', | |
I.name as 'Index', | |
DDIPS.avg_fragmentation_in_percent, | |
DDIPS.page_count | |
FROM sys.dm_db_index_physical_stats (DB_ID(), NULL, NULL, NULL, NULL) AS DDIPS | |
INNER JOIN sys.tables T on T.object_id = DDIPS.object_id | |
INNER JOIN sys.schemas S on T.schema_id = S.schema_id | |
INNER JOIN sys.indexes I ON I.object_id = DDIPS.object_id | |
AND DDIPS.index_id = I.index_id |