Posts

Showing posts from 2016

Difference between clustered and nonclustered index

You really need to keep two issues apart: 1) the primary key is a logical construct - one of the candidate keys that uniquely and reliably identifies every row in your table. This can be anything, really - an INT, a GUID, a string - pick what makes most sense for your scenario.  2) the clustering key (the column or columns that define the "clustered index" on the table) - this is a physical storage-related thing, and here, a small, stable, ever-increasing data type is your best pick - INT or BIGINT as your default option. Another better explanation is below : A clustered index alters the way that the rows are stored. When you create a clustered index on a column (or a number of columns), SQL server sorts the table’s rows by that column(s). It is like a dictionary, where all words are sorted in alphabetical order in the entire book. A non-clustered index, on the other hand, does not alter the way the rows are stored in the table. It creates a completely different

What has changed in PHP 5.5.x

1.Generators added   Support for generators has been added via the yield keyword. Generators provide an easy way to implement simple iterators without the overhead or complexity of implementing a class that implements the Iterator interface. A simple example that reimplements the range() function as a generator (at least for positive step values): <?php function  xrange ( $start ,  $limit ,  $step  =  1 ) {     for ( $i  =  $start ;  $i  <=  $limit ;  $i  +=  $step ) {          yield $i ;     } } echo  'Single digit odd numbers: ' ; /*  * Note that an array is never created or returned,  * which saves memory.  */ foreach ( xrange ( 1 ,  9 ,  2 ) as  $number ) {     echo  " $number  " ; } echo  "\n" ; ?> The above example will output: Single digit odd numbers: 1 3 5 7 9      2. finally keyword added try - catch blocks now support a finally block for code that should be