<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>CODE SPREAD</title> <atom:link href="http://codespread.com/feed" rel="self" type="application/rss+xml" /><link>http://codespread.com</link> <description>Simple Concepts of Coding &#124; Programming</description> <lastBuildDate>Sat, 08 Jun 2013 06:30:03 +0000</lastBuildDate> <language>en-US</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>My first introduction to Java Applets</title><link>http://codespread.com/my-first-introduction-to-java-applets.html</link> <comments>http://codespread.com/my-first-introduction-to-java-applets.html#comments</comments> <pubDate>Sat, 08 Jun 2013 06:30:03 +0000</pubDate> <dc:creator>swatiS</dc:creator> <category><![CDATA["Technical" Series]]></category> <category><![CDATA[applet]]></category> <category><![CDATA[java]]></category><guid
isPermaLink="false">http://codespread.com/?p=1616</guid> <description><![CDATA[What is it? An applet is a class file that is written to display graphics in web browser. We embed applets using &#60;APPLET&#62; HTML tags. When run in a web page, java applets are downloaded automatically and run by the web browser. Now we will see how applet works using AWT(Abstract Windowing Toolkit) : Most.....<div
class='yarpp-related-rss'>Related posts:<ol><li><a
href='http://codespread.com/c-boxing-and-un-boxing.html' rel='bookmark' title='C# &#8211; Box(ing) and Un-box(ing)'>C# &#8211; Box(ing) and Un-box(ing)</a></li><li><a
href='http://codespread.com/interview-series-polymorphism-question.html' rel='bookmark' title='Interview Series: Polymorphism Question- Answer Updated'>Interview Series: Polymorphism Question- Answer Updated</a></li><li><a
href='http://codespread.com/asp-net-more-about-cookies.html' rel='bookmark' title='Asp.Net: More about Cookies'>Asp.Net: More about Cookies</a></li></ol></div> ]]></description> <content:encoded><![CDATA[<h3>What is it?</h3><p>An applet is a class file that is written to display graphics in web browser. We embed applets using &lt;APPLET&gt; HTML tags. When run in a web page, java applets are downloaded automatically and run by the web browser.</p><p>Now we will see how applet works using AWT(Abstract Windowing Toolkit) :</p><p>Most basic AWT class is java.awt.Componenet class, which all AWT visual components are based on. This class is directly derived from java.lang.object class. Another important AWT class is Container class. This class is derived from AWT Component class and it is the basis of AWT Containers, which can hold other components.</p><h3 align="center"><strong><span
style="text-decoration: underline;">Hierarchy of APPLETS</span></strong></h3><p>java.lang.object</p><p>&#8212;&#8212;&#8211; java.awt.Component</p><p>&#8212;&#8212; java.awt.Container</p><p>&#8212;&#8211; java.awt.Panel</p><p>&#8212;&#8212; java.applet.Applet</p><p>Example:</p><pre>

import java.applet.Applet

import java.awt.*;

/*

&lt;Applet

CODE=applet.class

WIDTH=300

HEIGHT=200&gt;

&lt;Applet/&gt;

*/

public class applet extends Applet

{

public void paint(Graphics g)

{

g.drawString("Hello, Welcome to the java world!!");

}

}

</pre><h3><strong>Explanation:</strong></h3><p>Paint method is used to display message in the applet. It is inherited from Component class. When applet is displayed paint method is called and we can place the code for drawing the applet in that method. This method is passed as object of the Graphics class. This object supports a method “drawString” which is used to draw string of text in the applet.</p><p>Graphics class is an AWT class, sowe import AWT class when we override the default paint method of the applet class.</p><h3 align="center"><strong><span
style="text-decoration: underline;">Attributes of &lt;APPLET&gt; tag</span></strong></h3><pre>

&lt;APPLET

[CODEBASE =  URL]

CODE = filename

[ALT = alternateText]

[NAME = instancename]

WIDTH = pixels

HEIGHT = pixels

[ALIGN = alignment]

[VSPACE = pixels]

[HSPACE = pixels]

&gt;

[&lt;PARAM  NAME = name  VALUE = value &gt;]

&lt;/APPLET&gt;

</pre><h3><strong><span
style="text-decoration: underline;">Explanation :</span></strong></h3><ul><li><strong>CODEBASE</strong> – The URL that specifies the directory in which the applet code is to be found.</li><li><strong>CODE</strong> – The name of the applet file, including the extension .class.</li><li><strong>ALT</strong> – The text to be displayed if a browser supports applets but cant run this one for some reason.</li><li><strong>NAME</strong> – The name of the applet in the web browser. Applets must be given names if we want other applets to be able to find &amp; interact with them.</li><li><strong>WIDTH</strong> – The width of the space reserved for the applet.</li><li><strong>HEIGHT</strong> – The height of the space reserved for the applet.</li><li><strong>ALIGN</strong> – Specifies the alignment of the applet. LEFT, RIGHT, TOP, BOTTOM, MIDDLE, BASELINE, TEXTTOP, ABSMIDDLE or ABSBOTTOM.</li><li><strong>VSPACE</strong> – The space allocated above &amp; below the applet.</li><li><strong>HSPACE</strong> – The space allocated to the right &amp; left around the applet.</li><li><strong>PARAM </strong><strong>NAME</strong> – The name of a parameter to pass to the applet.</li><li><strong>PARAM  VALUE</strong> -  The value of a parameter.</li></ul><p>The result of the above code appears as :</p><div
id="attachment_1617" class="wp-caption alignnone" style="width: 602px"><a
href="/wp-content/uploads/2013/06/applet.png"><img
class="size-full wp-image-1617" title="java applet" src="/wp-content/uploads/2013/06/applet.png" alt="java applet" width="592" height="467" /></a><p
class="wp-caption-text">java applet</p></div><p>&nbsp;</p><div
class='yarpp-related-rss'><p>Related posts:</p><ol><li><a
href='http://codespread.com/c-boxing-and-un-boxing.html' rel='bookmark' title='C# &#8211; Box(ing) and Un-box(ing)'>C# &#8211; Box(ing) and Un-box(ing)</a></li><li><a
href='http://codespread.com/interview-series-polymorphism-question.html' rel='bookmark' title='Interview Series: Polymorphism Question- Answer Updated'>Interview Series: Polymorphism Question- Answer Updated</a></li><li><a
href='http://codespread.com/asp-net-more-about-cookies.html' rel='bookmark' title='Asp.Net: More about Cookies'>Asp.Net: More about Cookies</a></li></ol></div> ]]></content:encoded> <wfw:commentRss>http://codespread.com/my-first-introduction-to-java-applets.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Short Note on HTTP-GET, HTTP-POST and SOAP</title><link>http://codespread.com/short-note-on-http-get-http-post-and-soap.html</link> <comments>http://codespread.com/short-note-on-http-get-http-post-and-soap.html#comments</comments> <pubDate>Fri, 24 May 2013 13:55:14 +0000</pubDate> <dc:creator>Admin</dc:creator> <category><![CDATA["Interview" Series]]></category> <category><![CDATA[HTTP-GET]]></category> <category><![CDATA[HTTP-POST]]></category> <category><![CDATA[SOAP]]></category><guid
isPermaLink="false">http://codespread.com/?p=1611</guid> <description><![CDATA[Web service/WCF services/Rest Services may support HTTP-GET, HTTP-POST or SOAP protocols, which is the underlying way, where request-response communication happens between a client and server. HTTP-GET: Client requests a resource from server. Server sends the resource to the client as a response. HTTP-POST: Client submits a resource to the server. Server sends the acknowledgement to.....<div
class='yarpp-related-rss'>Related posts:<ol><li><a
href='http://codespread.com/rest-representational-state-transfer.html' rel='bookmark' title='REST- REpresentational State Transfer'>REST- REpresentational State Transfer</a></li><li><a
href='http://codespread.com/wcf-part-1-why-wcf.html' rel='bookmark' title='WCF Part 1: Why WCF?'>WCF Part 1: Why WCF?</a></li><li><a
href='http://codespread.com/note-gzipstream.html' rel='bookmark' title='Note: GZipStream'>Note: GZipStream</a></li></ol></div> ]]></description> <content:encoded><![CDATA[<p>Web service/WCF services/Rest Services may support HTTP-GET, HTTP-POST or SOAP protocols, which is the underlying way, where request-response communication happens between a client and server.</p><h3>HTTP-GET:</h3><p>Client requests a resource from server.<br
/> Server sends the resource to the client as a response.</p><h3>HTTP-POST:</h3><p>Client submits a resource to the server.<br
/> Server sends the acknowledgement to the client as a response.</p><h3>SOAP:</h3><p>Exchange of structured information between server and client.<br
/> Wider than HTTP-GET and HTTP-POST.<br
/> Can handle any communication in a distributive environment</p><p>*Note: A resource can be image,text file etc.</p><div
class='yarpp-related-rss'><p>Related posts:</p><ol><li><a
href='http://codespread.com/rest-representational-state-transfer.html' rel='bookmark' title='REST- REpresentational State Transfer'>REST- REpresentational State Transfer</a></li><li><a
href='http://codespread.com/wcf-part-1-why-wcf.html' rel='bookmark' title='WCF Part 1: Why WCF?'>WCF Part 1: Why WCF?</a></li><li><a
href='http://codespread.com/note-gzipstream.html' rel='bookmark' title='Note: GZipStream'>Note: GZipStream</a></li></ol></div> ]]></content:encoded> <wfw:commentRss>http://codespread.com/short-note-on-http-get-http-post-and-soap.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>SQL : Transactions and ACID properties.</title><link>http://codespread.com/sql-transactions-and-acid-properties.html</link> <comments>http://codespread.com/sql-transactions-and-acid-properties.html#comments</comments> <pubDate>Sat, 18 May 2013 09:25:56 +0000</pubDate> <dc:creator>Admin</dc:creator> <category><![CDATA["Technical" Series]]></category> <category><![CDATA[ACID]]></category> <category><![CDATA[SQL]]></category> <category><![CDATA[Transactions]]></category><guid
isPermaLink="false">http://codespread.com/?p=1605</guid> <description><![CDATA[There are always two point of views of transactions. First, the user point of view, for example, customer went to an ATM to retrieve some amount. For him, the transaction might look like, For a developer or admin, the transaction will be, But did we estimate any failure condition in both of the cases shown.....<div
class='yarpp-related-rss'>Related posts:<ol><li><a
href='http://codespread.com/sql-fry-pivot-and-unpivot.html' rel='bookmark' title='SQL fry: PIVOT and UNPIVOT'>SQL fry: PIVOT and UNPIVOT</a></li><li><a
href='http://codespread.com/magic-wand-object-relational-mapping.html' rel='bookmark' title='Magic Wand: Object-relational mapping'>Magic Wand: Object-relational mapping</a></li><li><a
href='http://codespread.com/how-to-make-a-connection-between-c-and-mysql.html' rel='bookmark' title='How to make a Connection between c# and mysql?'>How to make a Connection between c# and mysql?</a></li></ol></div> ]]></description> <content:encoded><![CDATA[<p>There are always two point of views of transactions. First, the user point of view, for example, customer went to an ATM to retrieve some amount. For him, the transaction might look like,</p><p><a
href="http://codespread.com/wp-content/uploads/2013/05/Transacation.png"><img
style="display: inline; border-width: 0px;" title="Transacation" src="http://codespread.com/wp-content/uploads/2013/05/Transacation_thumb.png" alt="Transacation" width="244" height="163" border="0" /></a></p><p>For a developer or admin, the transaction will be,</p><p><a
href="http://codespread.com/wp-content/uploads/2013/05/DevTransaction1.png"><img
style="display: inline; border-width: 0px;" title="DevTransaction" src="http://codespread.com/wp-content/uploads/2013/05/DevTransaction_thumb.png" alt="DevTransaction" width="244" height="159" border="0" /></a></p><p><strong>But did we estimate any failure condition in both of the cases shown above?</strong></p><p><strong>No.</strong></p><p>So these cases do not follow the basic expectation of transaction that is to save from any kind of failure. Now, with our experience, we can define that Transaction is an ‘Expectation’ of a user and a developer. ‘Expectation of success’.</p><p>We also have a theoretical definition, which is very good for interview purpose and available everywhere on different sites.</p><p>“ Database transaction is collection of SQL queries which are fired sequentially to perform a single unit of work. To succeed, all queries should successfully run. If the sequences breaks with a failed query, then the unit of work will not happen and all the previous successfully run queries will also revert back.”</p><p>Here the aim is to successfully run the task or not run it at all.</p><p>To achieve this operation, all the best practices/concepts available were merged and laid the foundation of ACID rules, which should be followed to achieve any kind of successful transaction.</p><h3>What are ACID properties or concepts?</h3><p>First of all, they are concepts and not implementations. There are three part of implementation: Transaction, Commit and RollBack.</p><p>A=<strong>Atomicity </strong>: A single unit of work has to be atomic, either all steps of transaction completes so its a success or none of them like it never began. Failure is not an option.</p><p>To achieve a successful transaction, Commit statement should fire. or if any step fails, then a RollBack statement should fire, like the transaction never began.</p><p>C=<strong>Consistency :</strong> Consistency is more a related term and requires for a valid state of the database. A unit of work forms a transaction but there might be dependency which follows after a successful transaction or are beyond that unit of work. For example, a customer having multiple accounts, transfers money from his one account to other. In one case, the account was deducted the requested amount but other account was not updated with the new amount. It will leave the database in half finished state, which is not a desirable state. So database should remain consistent after a transaction.</p><p>I=<strong>Isolation : </strong>This concept is more related to exclusivity of transactions. When a transaction is happening, this transaction should have exclusive rights to perform the transaction. No other transaction should interfere with this transaction. To implement the concept, we can use Isolation levels in database.</p><p>D=<strong>Durability : </strong>This concept guarantees the availability of data after the transaction. It can be use of database backups and transaction logs that facilitate the restoration of committed transactions or hardware fail safe methods. The aim is clear which is ‘Never lose any data’.</p><h3>Transaction Implementation Examples:</h3><p>There are following commands used to control transactions.</p><p><strong>COMMIT:</strong> Successful Transaction.</p><pre>

BEGIN TRANSACTION

UPDATE Savings SET min_Amount=500

COMMIT TRANSACTION

</pre><p><strong>ROLLBACK:</strong> No transaction if any step fails.</p><pre>

BEGIN CATCH

&lt;..........&gt;

ROLLBACK TRANSACTION

END CATCH

</pre><p><strong>SAVEPOINT:</strong> Points to save the transaction before any ROLLBACK. No rollback of whole transaction.</p><pre>

SAVEPOINT SAVEPOINT_NAME;

//and

ROLLBACK TO SAVEPOINT_NAME; // to rollback till savepoint, created earlier.

</pre><p><strong>SET TRANSACTION:</strong> Sets characteristics of a transaction.</p><pre>

SET TRANSACTION [ READ WRITE | READ ONLY ];

</pre><h3>Sample:</h3><p>A sample format:</p><pre>

BEGIN TRY

BEGIN TRANSACTION

&lt;..........&gt;

COMMIT TRANSACTION

END TRY

BEGIN CATCH

&lt;..........&gt;

ROLLBACK TRANSACTION

END CATCH

</pre><h4><strong>Next in line: Isolation Levels</strong></h4><div
class='yarpp-related-rss'><p>Related posts:</p><ol><li><a
href='http://codespread.com/sql-fry-pivot-and-unpivot.html' rel='bookmark' title='SQL fry: PIVOT and UNPIVOT'>SQL fry: PIVOT and UNPIVOT</a></li><li><a
href='http://codespread.com/magic-wand-object-relational-mapping.html' rel='bookmark' title='Magic Wand: Object-relational mapping'>Magic Wand: Object-relational mapping</a></li><li><a
href='http://codespread.com/how-to-make-a-connection-between-c-and-mysql.html' rel='bookmark' title='How to make a Connection between c# and mysql?'>How to make a Connection between c# and mysql?</a></li></ol></div> ]]></content:encoded> <wfw:commentRss>http://codespread.com/sql-transactions-and-acid-properties.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>SQL : Clustered and NonClustered Index</title><link>http://codespread.com/sql-clustered-and-nonclustered-index.html</link> <comments>http://codespread.com/sql-clustered-and-nonclustered-index.html#comments</comments> <pubDate>Thu, 16 May 2013 14:42:36 +0000</pubDate> <dc:creator>Admin</dc:creator> <category><![CDATA["Technical" Series]]></category> <category><![CDATA[clustered]]></category> <category><![CDATA[indexes]]></category> <category><![CDATA[nonclustered]]></category> <category><![CDATA[SQL]]></category><guid
isPermaLink="false">http://codespread.com/?p=1594</guid> <description><![CDATA[We read about SQL indexes in our previous post, We will dive into the topic and learn the different types of indexing possible in SQL. We have clustered and non-clustered index in SQL, let’s see the difference, their operation and advantages each one have. We have a basic understanding that indexes are created on columns.....<div
class='yarpp-related-rss'>Related posts:<ol><li><a
href='http://codespread.com/sql-story-of-indexes.html' rel='bookmark' title='SQL: Story of Indexes'>SQL: Story of Indexes</a></li><li><a
href='http://codespread.com/sqltarget-a-subquery.html' rel='bookmark' title='SQL:Target a SubQuery'>SQL:Target a SubQuery</a></li><li><a
href='http://codespread.com/sqltarget-a-trigger.html' rel='bookmark' title='SQL:Target a Trigger'>SQL:Target a Trigger</a></li></ol></div> ]]></description> <content:encoded><![CDATA[<p>We read about SQL indexes in our <a
title="SQL Indexes" href="http://codespread.com/sql-story-of-indexes.html" target="_blank">previous post</a>, We will dive into the topic and learn the different types of indexing possible in SQL.</p><p>We have clustered and non-clustered index in SQL, let’s see the difference, their operation and advantages each one have.</p><p>We have a basic understanding that indexes are created on columns and organized into B-Tree structure for faster retrieval of data so both clustered and non-clustered index follows the same.</p><p>But the difference is,</p><p><strong>Clustered</strong> :</p><p>1. Clustered indexes physically [actual bits on the disk] sorts and stores the data rows in the table based on the index values. means,the rows are stored physically on the disk in the same order as the index</p><p>2. A clustered index determines the order so there can be only one clustered index per table.</p><p>3. As a rule, this should be applied to the most common column which is always a part of WHERE clauses for queries.</p><p>4. Any data operation in the Table (like inserts, updates and deletes) reorders the index as clustered follows a physical sort and storing.</p><p>5. All the data operation will be slower. This is an overhead or a disadvantage.</p><p>6. As a best practice, the clustered index should be on a column which is unique and increasing such as an identity column.</p><p>7. Columns with the data type of TEXT, NTEXT and IMAGE are not included.</p><p><strong>Non-Clustered </strong>:</p><p>1. Non-Clustered index follows logical ordering of data rows. means,  rows of data might not follow the way the index is ordered or sorted.</p><p>2. The index values will not point to the data rows but will have the address of the data rows.</p><p>3. Try to understand it more clearly, if we are looking for a value in non-clustered index then we will not get the data row directly like in the case of clustered, we will get the row locator and with the help of that we can get the physical pointer (corresponding clustered index value) of the data row.</p><p>4. 999 non-clustered indexes can be created.</p><p>5. Can contain upto 1023 included columns.</p><p>6. Columns with the data type of TEXT, NTEXT and IMAGE are not included.</p><h3>What is the relation between keys and indexes?</h3><p>When we assign PRIMARY KEY / UNIQUE key on table columns, Indexes are automatically created.</p><h3>Example:</h3><p>Let’s create a Employee table:</p><pre>

Create Table Employee
(
EmpId int,

EmpName varchar(100) ,

Salary int,
)

</pre><p>Right now, there is no index. Apply index on EmpId.</p><pre>

CREATE UNIQUE INDEX idxEmpId ON Employee (EmpId);

</pre><p>If there is already a clustered index on Table then a unique non-clustered index gets created else a unique clustered index gets created.</p><p>While defining the index, you can explicitly  mention non-clustered to create a non-clustered index but before that a clustered should exist.</p><pre>

CREATE NONCLUSTERED INDEX idxEmpId ON Employee (EmpId);

</pre><h3>Caution:</h3><p>Always find a balance between indexes because</p><p>1. More number of indexes are a spoilsport for inserts/updates.</p><p>2. Less number of indexes will hit the performance.</p><div
class='yarpp-related-rss'><p>Related posts:</p><ol><li><a
href='http://codespread.com/sql-story-of-indexes.html' rel='bookmark' title='SQL: Story of Indexes'>SQL: Story of Indexes</a></li><li><a
href='http://codespread.com/sqltarget-a-subquery.html' rel='bookmark' title='SQL:Target a SubQuery'>SQL:Target a SubQuery</a></li><li><a
href='http://codespread.com/sqltarget-a-trigger.html' rel='bookmark' title='SQL:Target a Trigger'>SQL:Target a Trigger</a></li></ol></div> ]]></content:encoded> <wfw:commentRss>http://codespread.com/sql-clustered-and-nonclustered-index.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>SQL: Story of Indexes</title><link>http://codespread.com/sql-story-of-indexes.html</link> <comments>http://codespread.com/sql-story-of-indexes.html#comments</comments> <pubDate>Tue, 14 May 2013 18:31:22 +0000</pubDate> <dc:creator>Admin</dc:creator> <category><![CDATA["Technical" Series]]></category> <category><![CDATA[indexes]]></category> <category><![CDATA[SQL]]></category><guid
isPermaLink="false">http://codespread.com/?p=1584</guid> <description><![CDATA[I know many people know everything about this topic but as this is one of my favorite topics, I will make sure that I will give you some additional information or knowledge. My first thought about Indexes is that ‘It is a solution’. I assume that you will ask me ‘What was the problem behind.....<div
class='yarpp-related-rss'>Related posts:<ol><li><a
href='http://codespread.com/sqltarget-a-subquery.html' rel='bookmark' title='SQL:Target a SubQuery'>SQL:Target a SubQuery</a></li><li><a
href='http://codespread.com/sql-bitwise-operator-can-simplify-db-design.html' rel='bookmark' title='SQL Bitwise operator can simplify DB design'>SQL Bitwise operator can simplify DB design</a></li><li><a
href='http://codespread.com/sql-fry-pivot-and-unpivot.html' rel='bookmark' title='SQL fry: PIVOT and UNPIVOT'>SQL fry: PIVOT and UNPIVOT</a></li></ol></div> ]]></description> <content:encoded><![CDATA[<p>I know many people know everything about this topic but as this is one of my favorite topics, I will make sure that I will give you some additional information or knowledge.</p><p>My first thought about Indexes is that ‘It is a solution’. I assume that you will ask me ‘What was the problem behind it?’</p><p>The problem lies in the way our regular data is stored. We know that data is stored on the heap.</p><h3>What is the Heap?</h3><p>A <em>heap file</em> is an unordered set of records where Records can be inserted and deleted. Also, Records are uniquely identified by a record-id. We can use this record-id to retrieve the specific data.</p><p>Heap file supports sequential scan of records. We can run our SQL query to retrieve the data but efficiency will always be on the lower side.</p><p>If we make some explicit correction and introduce some kind of order to this unordered set of data, we can reach a certain level of efficiency.</p><h3>What do we need to do?</h3><p>We need to locate a column based on some specific requirements and used it as a reference to retrieve the entire row of data. When we fire a SQL query to search for a row of data by providing a conditional value, SQL Server first finds that value in this special column, and retrieve the corresponding entire row of data.This column is normally called as <strong>Index</strong>.</p><h3>What are the specific requirements?</h3><p>Indexes can be created on most columns in a table except if the data-type is large object (LOB) data types, such as <strong>image</strong>, <strong>text,</strong> and <strong>varchar(max)</strong>. It may also uniquely identify the row. if not, the output result might contain more that one row.</p><h3>How Index-Seek happens?</h3><p>We need some knowledge of B-tree architecture to understand Index-seek.</p><p><a
href="http://codespread.com/wp-content/uploads/2013/05/btree.png"><img
style="display: inline; border: 0px;" title="btree" src="http://codespread.com/wp-content/uploads/2013/05/btree_thumb.png" alt="btree" width="590" height="357" border="0" /></a></p><p>Indexed column values are arranged as per leaf nodes shown above. Each of the group is referenced as pages and also pointed as index level pages.  When a SQL query is run having some conditional value on index. The query engine starts from the root level and follows down till the leaf node, narrowing down the result set. Once query engine reaches the index level, it identifies and retrieves the exact result set expected. For example, let’s search for a value 60 in indexed column, the query engine starts from the root level and traverse down towards the right side and finally reaches the leaf node level. Here, the query engine identifies the value 60.</p><p>This operation is called index-seek where instead of going for sequential scan of the whole table, a B-tree traversal is done to seek the value on an indexed column.</p><p>Next in line:</p><p>1) Clustered Index and Non-Clustered Index</p><div
class='yarpp-related-rss'><p>Related posts:</p><ol><li><a
href='http://codespread.com/sqltarget-a-subquery.html' rel='bookmark' title='SQL:Target a SubQuery'>SQL:Target a SubQuery</a></li><li><a
href='http://codespread.com/sql-bitwise-operator-can-simplify-db-design.html' rel='bookmark' title='SQL Bitwise operator can simplify DB design'>SQL Bitwise operator can simplify DB design</a></li><li><a
href='http://codespread.com/sql-fry-pivot-and-unpivot.html' rel='bookmark' title='SQL fry: PIVOT and UNPIVOT'>SQL fry: PIVOT and UNPIVOT</a></li></ol></div> ]]></content:encoded> <wfw:commentRss>http://codespread.com/sql-story-of-indexes.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Served from: codespread.com @ 2013-06-20 15:00:24 by W3 Total Cache -->