- Don’t
SELECT *, Specify explicit column names (columnar store) - Avoid large JOINs (filter each table first)
- In PRESTO tables are joined in the order they are listed!!
- Join small tables earlier in the plan and leave larger fact tables to the end
- Avoid cross joins or 1 to many joins as these can degrade performance
- Order by and group by take time
- only use order by in subqueries if it is really necessary
- When using GROUP BY, order the columns by the highest cardinality (that is, most number of unique values) to the lowest.
This file contains hidden or 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
| /* | |
| * This work (Modern Encryption of a String C#, by James Tuley), | |
| * identified by James Tuley, is free of known copyright restrictions. | |
| * https://gist.github.com/4336842 | |
| * http://creativecommons.org/publicdomain/mark/1.0/ | |
| */ | |
| using System; | |
| using System.IO; | |
| using System.Text; |
This file contains hidden or 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
| /* Jquery function to create guids. | |
| * Guid code from | |
| * http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript | |
| */ | |
| (function ( $ ) { | |
| $.fn.newguid = function () { | |
| this.val('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { var r = Math.random() * 16 | 0, v = c == 'x' ? r : r & 0x3 | 0x8; return v.toString(16); })); | |
| return this; | |
| }; |
This file contains hidden or 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
| // http://msdn.microsoft.com/en-us/library/system.threading.tasks.task.whenall.aspx | |
| using System; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| static class TaskExtensions | |
| { | |
| public static Task<T[]> WhenAll<T>(this Task<T>[] tasks) | |
| { |
This file contains hidden or 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
| download this file... see: https://azure.microsoft.com/en-gb/documentation/articles/cloud-services-dotnet-install-dotnet/ |
This file contains hidden or 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
| using Org.BouncyCastle.Asn1.Pkcs; | |
| using Org.BouncyCastle.Asn1.Sec; | |
| using Org.BouncyCastle.Asn1.X509; | |
| using Org.BouncyCastle.Asn1.X9; | |
| using Org.BouncyCastle.Crypto; | |
| using Org.BouncyCastle.Crypto.Generators; | |
| using Org.BouncyCastle.Crypto.Operators; | |
| using Org.BouncyCastle.Crypto.Parameters; | |
| using Org.BouncyCastle.Math; | |
| using Org.BouncyCastle.Security; |
This file contains hidden or 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
| using System; | |
| using System.Security.Cryptography; | |
| /// <summary> | |
| /// Computes and verifies proof-of-work challenges inspired by Hashcash to deter denial of service attacks and other service abuses such as spam. | |
| /// </summary> | |
| public sealed class HashPuzzle | |
| { | |
| #region " Properties " |
This file contains hidden or 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
| <Project Sdk="Microsoft.NET.Sdk"> | |
| <PropertyGroup> | |
| <OutputType>Exe</OutputType> | |
| <TargetFramework>netcoreapp2.0</TargetFramework> | |
| <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> | |
| <RootNamespace></RootNamespace> | |
| <IsPackable>False</IsPackable> | |
| <NoWarn>CS0649;CS0169</NoWarn> | |
This file contains hidden or 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
| using Akka.Streams; | |
| using Akka.Streams.Stage; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| namespace Demo | |
| { | |
| sealed class PreFetch<T> : GraphStage<SourceShape<T>> |
This file contains hidden or 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
| listen 1935; | |
| max_connections 20; | |
| daemon on; | |
| pid /usr/local/srs/objs/srs.pid; | |
| srs_log_tank file; # console; | |
| srs_log_file /var/log/srs.log; | |
| ff_log_dir /dev/null; | |
| # can be: verbose, info, trace, warn, error | |
| srs_log_level warn; |
OlderNewer