<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Database Indexes on Domain Names</title>
	<atom:link href="http://josephscott.org/archives/2010/02/database-indexes-on-domain-names/feed/" rel="self" type="application/rss+xml" />
	<link>http://josephscott.org/archives/2010/02/database-indexes-on-domain-names/</link>
	<description></description>
	<lastBuildDate>Wed, 08 Sep 2010 02:43:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Joseph Scott</title>
		<link>http://josephscott.org/archives/2010/02/database-indexes-on-domain-names/#comment-1922</link>
		<dc:creator>Joseph Scott</dc:creator>
		<pubDate>Wed, 24 Feb 2010 16:09:52 +0000</pubDate>
		<guid isPermaLink="false">http://josephscott.org/?p=1935#comment-1922</guid>
		<description>There definitely more tests that could be done in this area, but I think you&#039;ll find the same general rule of LIKE &#039;%blahblahblah&#039; being slower than LIKE &#039;blahblahblah%&#039; will apply.</description>
		<content:encoded><![CDATA[<p>There definitely more tests that could be done in this area, but I think you&#8217;ll find the same general rule of LIKE &#8216;%blahblahblah&#8217; being slower than LIKE &#8216;blahblahblah%&#8217; will apply.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Angelo Mandato</title>
		<link>http://josephscott.org/archives/2010/02/database-indexes-on-domain-names/#comment-1921</link>
		<dc:creator>Angelo Mandato</dc:creator>
		<pubDate>Wed, 24 Feb 2010 13:55:32 +0000</pubDate>
		<guid isPermaLink="false">http://josephscott.org/?p=1935#comment-1921</guid>
		<description>I believe only the first X characters in a VARCHAR are indexed, which explains why you may find that your query is more efficient reversed like it is. I would recommend doing some testing with very large domain names and many more records. Don&#039;t forget the MySQL server&#039;s index cache size is a factor, if the table has way more VARCHAR indexes than the cache can store then it will still do a full scan.</description>
		<content:encoded><![CDATA[<p>I believe only the first X characters in a VARCHAR are indexed, which explains why you may find that your query is more efficient reversed like it is. I would recommend doing some testing with very large domain names and many more records. Don&#8217;t forget the MySQL server&#8217;s index cache size is a factor, if the table has way more VARCHAR indexes than the cache can store then it will still do a full scan.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joseph Scott</title>
		<link>http://josephscott.org/archives/2010/02/database-indexes-on-domain-names/#comment-1920</link>
		<dc:creator>Joseph Scott</dc:creator>
		<pubDate>Wed, 24 Feb 2010 06:43:19 +0000</pubDate>
		<guid isPermaLink="false">http://josephscott.org/?p=1935#comment-1920</guid>
		<description>I&#039;d expect a full index scan to be faster than a full table scan in most cases, but yes, it will still be noticeably slower than an index lookup.

PostgreSQL supports functional indexes - http://www.postgresql.org/docs/8.4/static/sql-createindex.html - by allowing you to include an expression in CREATE INDEX.</description>
		<content:encoded><![CDATA[<p>I&#8217;d expect a full index scan to be faster than a full table scan in most cases, but yes, it will still be noticeably slower than an index lookup.</p>
<p>PostgreSQL supports functional indexes &#8211; <a href="http://www.postgresql.org/docs/8.4/static/sql-createindex.html" rel="nofollow">http://www.postgresql.org/docs/8.4/static/sql-createindex.html</a> &#8211; by allowing you to include an expression in CREATE INDEX.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Artem Russakovskii</title>
		<link>http://josephscott.org/archives/2010/02/database-indexes-on-domain-names/#comment-1919</link>
		<dc:creator>Artem Russakovskii</dc:creator>
		<pubDate>Wed, 24 Feb 2010 06:39:14 +0000</pubDate>
		<guid isPermaLink="false">http://josephscott.org/?p=1935#comment-1919</guid>
		<description>Yeah, either way all would be slow unless you use this solution or go more advanced.

As far as I remember, PostgreSQL supports functional indexes and MySQL definitely doesn&#039;t.</description>
		<content:encoded><![CDATA[<p>Yeah, either way all would be slow unless you use this solution or go more advanced.</p>
<p>As far as I remember, PostgreSQL supports functional indexes and MySQL definitely doesn&#8217;t.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joseph Scott</title>
		<link>http://josephscott.org/archives/2010/02/database-indexes-on-domain-names/#comment-1918</link>
		<dc:creator>Joseph Scott</dc:creator>
		<pubDate>Wed, 24 Feb 2010 06:35:32 +0000</pubDate>
		<guid isPermaLink="false">http://josephscott.org/?p=1935#comment-1918</guid>
		<description>I&#039;d need to go back and review query plans for different database systems, but I believe in some they will use a the index.  Now when I say &quot;use the index&quot; it&#039;s often not in the way you think, they will do a full index scan.  That&#039;s not the same as doing an index lookup.

MySQL indexes are fairly primitive.  For instance as far as I know there&#039;s no support for functional indexes.</description>
		<content:encoded><![CDATA[<p>I&#8217;d need to go back and review query plans for different database systems, but I believe in some they will use a the index.  Now when I say &#8220;use the index&#8221; it&#8217;s often not in the way you think, they will do a full index scan.  That&#8217;s not the same as doing an index lookup.</p>
<p>MySQL indexes are fairly primitive.  For instance as far as I know there&#8217;s no support for functional indexes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Artem Russakovskii</title>
		<link>http://josephscott.org/archives/2010/02/database-indexes-on-domain-names/#comment-1917</link>
		<dc:creator>Artem Russakovskii</dc:creator>
		<pubDate>Wed, 24 Feb 2010 06:25:30 +0000</pubDate>
		<guid isPermaLink="false">http://josephscott.org/?p=1935#comment-1917</guid>
		<description>That&#039;s a pretty good idea, though it&#039;s an old trick in the book. But tell me, what database would use an index for a &#039;%foo&#039; query?

As far as I know, no index supports that and the only way to do that would be to go with either FULLTEXT search (in which case you&#039;re stuck with MyISAM and the query would look different) or go for a separate solution, such as Solr or sphinx.</description>
		<content:encoded><![CDATA[<p>That&#8217;s a pretty good idea, though it&#8217;s an old trick in the book. But tell me, what database would use an index for a &#8216;%foo&#8217; query?</p>
<p>As far as I know, no index supports that and the only way to do that would be to go with either FULLTEXT search (in which case you&#8217;re stuck with MyISAM and the query would look different) or go for a separate solution, such as Solr or sphinx.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
