<?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>linsec.ca blog &#187; mysql</title>
	<atom:link href="http://linsec.ca/blog/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://linsec.ca/blog</link>
	<description>You can have it right, or you can have it now.  But you can&#039;t have it right now.</description>
	<lastBuildDate>Sat, 05 May 2012 22:03:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>rq tool now on fedorahosted</title>
		<link>http://linsec.ca/blog/2011/01/29/rq-tool-now-on-fedorahosted/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rq-tool-now-on-fedorahosted</link>
		<comments>http://linsec.ca/blog/2011/01/29/rq-tool-now-on-fedorahosted/#comments</comments>
		<pubDate>Sat, 29 Jan 2011 14:46:51 +0000</pubDate>
		<dc:creator>vdanen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[help!]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[rq]]></category>

		<guid isPermaLink="false">http://linsec.ca/blog/?p=911</guid>
		<description><![CDATA[So the RPM Query (rq) tool that I inherited as &#8216;srpm&#8217; from Stew Benedict back in the day at Mandriva is now on fedorahosted,org. Unfortunately, it&#8217;s missing history because I had a dickens of a time trying to extract it from my existing svn repo (I got it so just the relevant commits where in [...]]]></description>
			<content:encoded><![CDATA[<p>So the RPM Query (rq) tool that I inherited as &#8216;srpm&#8217; from Stew Benedict back in the day at Mandriva is now on fedorahosted,org.  Unfortunately, it&#8217;s missing history because I had a dickens of a time trying to extract it from my existing svn repo (I got it so just the relevant commits where in there, but the entire history of the other repo came with it which does me no good).  You can check it out at <a href="https://fedorahosted.org/rq/wiki">https://fedorahosted.org/rq/wiki</a>.</p>
<p>But the problem I&#8217;m having now, and maybe someone on the lazyweb can help me with this, is that it is absolutely freaking slow.  Querying the database is fast enough when you&#8217;re searching for something, but doing the imports and especially handling the updates is a process of hours.  For instance, to have it manage the updates for Fedora 14 (the SRPMs), I&#8217;m looking at 1311 package updates and 353 new packages being added.  It&#8217;s been running since last night (I don&#8217;t know the specific time it started, but it has to be well over 10hrs ago) and it&#8217;s still in the &#8220;remove old package records&#8221; stage.  That seems highly excessive to me.</p>
<p>But the database is big:</p>
<pre>
rqs 0.6 ($Id: rqs 425 2011-01-21 23:37:19Z vdanen@ANNVIX.CA $)

Database statistics:

   Database  => User: rq, Host: localhost, Database: rqs
   Data size => 9.96 GB

   Tag records  : 5                Package records : 21629
   File records : 9554598          Source records  : 76031
   Ctags records: 56300434         Requires records: 100345
</pre>
<p>And what it is doing is first removing all of the old records (packages, files, ctags, requires, source files) before it can add in the new.  Of course, it does this one at a time:</p>
<pre>
if self.type == 'source':
  tables = ('packages', 'sources', 'files', 'ctags', 'buildreqs')
for rnum in to_remove:
  r_count = r_count + 1
  for table in tables:
    query  = "DELETE FROM %s WHERE p_record = %d" % (table, rnum)
    result = self.db.do_query(query)
</pre>
<p>I think the problem is I&#8217;ve reached my limit of understanding of efficient MySQL as I&#8217;ve never dealt with data sets this huge.  What would be the best way to handle this?  Would using temporary tables work best?  Would having each rpm repo on its own table work better?  That would logistically be more work as I&#8217;d have to create SQL tables on the fly (and while I would like this thing to be portable between db types at some point, it currently isn&#8217;t &#8212; but this would have an impact when I want to make it portable).  The problem then is if I want to query and look for &#8216;sshd.c&#8217; for instance, I&#8217;d have to look across multiple tables (such as &#8216;rqs_f14_source&#8217; and &#8216;rqs_rhel6_source&#8217; instead of just &#8216;source&#8217;), but my concern is that might increase the query time (querying right now is pretty fast, and I don&#8217;t want to negatively impact querying times, but this import/update time now is ridiculous).</p>
<p>But maybe that is the answer?  Multiple tables, grouped by repo (or tag, as rq calls them) as opposed to giant tables now?  I mean, looking at the number of rows in the ctags table (56,300,434), this is a pretty huge dataset.  Or can you remove from multiple tables at the same time (the p_record column is identical across tables&#8230; same name, same data).</p>
<p>Any hints to speed this sucker up?</p>
]]></content:encoded>
			<wfw:commentRss>http://linsec.ca/blog/2011/01/29/rq-tool-now-on-fedorahosted/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Monitoring MySQL with mytop</title>
		<link>http://linsec.ca/blog/2010/05/27/monitoring-mysql-with-mytop/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=monitoring-mysql-with-mytop</link>
		<comments>http://linsec.ca/blog/2010/05/27/monitoring-mysql-with-mytop/#comments</comments>
		<pubDate>Thu, 27 May 2010 19:13:08 +0000</pubDate>
		<dc:creator>vdanen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[techmail]]></category>

		<guid isPermaLink="false">http://linsec.ca/blog/?p=763</guid>
		<description><![CDATA[This week&#8217;s techmail is Monitoring MySQL with mytop which looks at the mytop perl tool that can help monitor and diagnose problems with MySQL (mytop is essentially a top for MySQL).]]></description>
			<content:encoded><![CDATA[<p>This week&#8217;s techmail is <a href="http://blogs.techrepublic.com.com/opensource/?p=1560">Monitoring MySQL with mytop</a> which looks at the mytop perl tool that can help monitor and diagnose problems with MySQL (mytop is essentially a top for MySQL).</p>
]]></content:encoded>
			<wfw:commentRss>http://linsec.ca/blog/2010/05/27/monitoring-mysql-with-mytop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Managing MySQL with MySQL Workbench</title>
		<link>http://linsec.ca/blog/2010/05/07/managing-mysql-with-mysql-workbench/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=managing-mysql-with-mysql-workbench</link>
		<comments>http://linsec.ca/blog/2010/05/07/managing-mysql-with-mysql-workbench/#comments</comments>
		<pubDate>Fri, 07 May 2010 18:05:50 +0000</pubDate>
		<dc:creator>vdanen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[techmail]]></category>

		<guid isPermaLink="false">http://linsec.ca/blog/?p=747</guid>
		<description><![CDATA[This week&#8217;s techmail was Managing MySQL with MySQL Workbench. I&#8217;ve always been a CLI guy when it comes to MySQL (as with most things: mutt, irssi, etc.), and when I needed something GUIrific I went with phpMyAdmin. However, I&#8217;ve looked at MySQL Workbench and I like what I&#8217;m seeing. The tip discusses what makes make [...]]]></description>
			<content:encoded><![CDATA[<p>This week&#8217;s techmail was <a href="http://blogs.techrepublic.com.com/opensource/?p=1479">Managing MySQL with MySQL Workbench</a>.  I&#8217;ve always been a CLI guy when it comes to MySQL (as with most things: mutt, irssi, etc.), and when I needed something GUIrific I went with phpMyAdmin.  However, I&#8217;ve looked at MySQL Workbench and I like what I&#8217;m seeing.  The tip discusses what makes make MySQL Workbench appealing for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://linsec.ca/blog/2010/05/07/managing-mysql-with-mysql-workbench/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why PostgreSQL is a better enterprise database than MySQL</title>
		<link>http://linsec.ca/blog/2010/01/25/why-postgresql-is-a-better-enterprise-database-than-mysql/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=why-postgresql-is-a-better-enterprise-database-than-mysql</link>
		<comments>http://linsec.ca/blog/2010/01/25/why-postgresql-is-a-better-enterprise-database-than-mysql/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 01:39:58 +0000</pubDate>
		<dc:creator>vdanen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[techmail]]></category>

		<guid isPermaLink="false">http://linsec.ca/blog/?p=683</guid>
		<description><![CDATA[This week&#8217;s techmail is Why PostgreSQL is a better enterprise database than MySQL which takes a look at what makes PostgreSQL a compelling database, when compared to MySQL. Particularly in light of the whole Oracle/MySQL thing, I think it&#8217;s good to remind people that choice still exists, and that the &#8220;runner up&#8221; might actually be [...]]]></description>
			<content:encoded><![CDATA[<p>This week&#8217;s techmail is <a href="http://blogs.techrepublic.com.com/opensource/?p=1202">Why PostgreSQL is a better enterprise database than MySQL</a> which takes a look at what makes PostgreSQL a compelling database, when compared to MySQL.  Particularly in light of the whole Oracle/MySQL thing, I think it&#8217;s good to remind people that choice still exists, and that the &#8220;runner up&#8221; might actually be the better choice.  This one mostly focuses on authentication, but that is definitely one area where PostgreSQL shines over MySQL (among many others).</p>
]]></content:encoded>
			<wfw:commentRss>http://linsec.ca/blog/2010/01/25/why-postgresql-is-a-better-enterprise-database-than-mysql/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Firewall MySQL with GreenSQL</title>
		<link>http://linsec.ca/blog/2009/01/08/firewall-mysql-with-greensql/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=firewall-mysql-with-greensql</link>
		<comments>http://linsec.ca/blog/2009/01/08/firewall-mysql-with-greensql/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 18:12:35 +0000</pubDate>
		<dc:creator>vdanen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[techmail]]></category>

		<guid isPermaLink="false">http://linsec.ca/blog/?p=365</guid>
		<description><![CDATA[This past week&#8217;s TechMail is Firewall MySQL with GreenSQL which talks about a really cool little application-level firewall that sits between your database-accessing code and MySQL. Really neat concept and although I&#8217;ve played with it a bit, I need to find some time to really dig into it as I can really see it being [...]]]></description>
			<content:encoded><![CDATA[<p>This past week&#8217;s TechMail is <a href="http://blogs.techrepublic.com.com/opensource/?p=317">Firewall MySQL with GreenSQL</a> which talks about a really cool little application-level firewall that sits between your database-accessing code and MySQL.  Really neat concept and although I&#8217;ve played with it a bit, I need to find some time to really dig into it as I can really see it being useful (especially in a web-hosting environment where you don&#8217;t really know what other people are running or whether they&#8217;ve upgraded, etc.).</p>
]]></content:encoded>
			<wfw:commentRss>http://linsec.ca/blog/2009/01/08/firewall-mysql-with-greensql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Improve MySQL performance with MySQLTuner</title>
		<link>http://linsec.ca/blog/2008/10/24/improve-mysql-performance-with-mysqltuner/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=improve-mysql-performance-with-mysqltuner</link>
		<comments>http://linsec.ca/blog/2008/10/24/improve-mysql-performance-with-mysqltuner/#comments</comments>
		<pubDate>Fri, 24 Oct 2008 16:15:12 +0000</pubDate>
		<dc:creator>vdanen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[techmail]]></category>

		<guid isPermaLink="false">http://linsec.ca/blog/?p=296</guid>
		<description><![CDATA[This week&#8217;s techmail is Improve MySQL performance with MySQLTuner which discusses how to use the MySQLTuner perl script to tune the MySQL server to ensure you&#8217;re not over-committing resources, that your configuration is sane, and giving helpful pointers on how to optimize your MySQL databases.]]></description>
			<content:encoded><![CDATA[<p>This week&#8217;s techmail is <a href="http://blogs.techrepublic.com.com/opensource/?p=285">Improve MySQL performance with MySQLTuner</a> which discusses how to use the MySQLTuner perl script to tune the MySQL server to ensure you&#8217;re not over-committing resources, that your configuration is sane, and giving helpful pointers on how to optimize your MySQL databases.</p>
]]></content:encoded>
			<wfw:commentRss>http://linsec.ca/blog/2008/10/24/improve-mysql-performance-with-mysqltuner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use command-line MySQL for additional flexibility</title>
		<link>http://linsec.ca/blog/2008/04/09/use-command-line-mysql-for-additional-flexibility/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=use-command-line-mysql-for-additional-flexibility</link>
		<comments>http://linsec.ca/blog/2008/04/09/use-command-line-mysql-for-additional-flexibility/#comments</comments>
		<pubDate>Wed, 09 Apr 2008 14:49:40 +0000</pubDate>
		<dc:creator>vdanen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[techmail]]></category>

		<guid isPermaLink="false">http://linsec.ca/blog/2008/04/09/use-command-line-mysql-for-additional-flexibility/</guid>
		<description><![CDATA[This week&#8217;s TechMail is Use command-line MySQL for additional flexibility which delves into some quickie commands useful on the MySQL CLI client, such as setting prompts, using mysql output in scripts, etc.]]></description>
			<content:encoded><![CDATA[<p>This week&#8217;s TechMail is <a href="http://blogs.techrepublic.com.com/opensource/?p=192">Use command-line MySQL for additional flexibility</a> which delves into some quickie commands useful on the MySQL CLI client, such as setting prompts, using mysql output in scripts, etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://linsec.ca/blog/2008/04/09/use-command-line-mysql-for-additional-flexibility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

