<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1038998" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1038998</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/slooooooooooooooooow-mysql#comment-1221823</link>
    <description> &lt;p&gt;2 and 3, I&#039;m not exactly sure.  I can look into it and get back to you.&lt;/p&gt;
&lt;p&gt;5,  my favorite thing to do is this...&lt;/p&gt;
&lt;p&gt;Pretend your database connection is something like &lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$db &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mysql_connect&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(....&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;balalalhahalahablah&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;And then in your footer (or whatever you call your last includes file that runs all the things at the end of the page), you can do something like&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;if ((&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$db &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;!= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;NULL&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) || (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$db &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;!= &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)) {&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mysql_close&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;();&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;That will close all of your MySQL connections, but won&#039;t attempt to close any if you never had any in the first place.&lt;/p&gt;
&lt;p&gt;A quick and easy fix to a very big problem!&lt;/p&gt;
 </description>
     <pubDate>Thu, 19 Jul 2007 01:11:07 +0000</pubDate>
 <dc:creator>brady.k</dc:creator>
 <guid isPermaLink="false">comment 1221823 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/slooooooooooooooooow-mysql#comment-1221820</link>
    <description> &lt;p&gt;Trust me, I would love to show you the snippets of code, but I don&#039;t have access to them right now.  It&#039;s running on my alum high school&#039;s intranet.  I am out of town right now and accessing it would be a job in itself.&lt;/p&gt;
&lt;p&gt;That&#039;s why I was asking for general ideas about what slows it down.  An IT guy from the school called me and notified me of the problem.  I developed the code so I am very familiar with it.&lt;/p&gt;
&lt;p&gt;For brady.k&lt;/p&gt;
&lt;p&gt;For number 1, I do not think it is the server because it has no problem running other sites on the same server, such as the school&#039;s website and other teacher applications.&lt;/p&gt;
&lt;p&gt;For 2 and 3, We installed PHP ourselves and did very little configuration because we were running out of time to develop the program.  By default, is PHP caching enabled?&lt;/p&gt;
&lt;p&gt;For number 4, I am not doing my statements like that.&lt;/p&gt;
&lt;p&gt;For number 5, I was unaware that closing connections could change performance.  I know that I am not doing that.  I am a self-taught PHP/MySQL person, so often times I miss those little tid-bits.  I will inform IT about adding the code to close the connection.&lt;/p&gt;
&lt;p&gt;For pr0gr4mm3r&lt;/p&gt;
&lt;p&gt;There are approximately 2,200 rows.  Split up into 10 columns.&lt;/p&gt;
&lt;p&gt;I&#039;ll try to get you some code to help you guys out.  I appreciate the ideas in the meantime though!&lt;/p&gt;
 </description>
     <pubDate>Wed, 18 Jul 2007 21:22:50 +0000</pubDate>
 <dc:creator>sublimer</dc:creator>
 <guid isPermaLink="false">comment 1221820 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/slooooooooooooooooow-mysql#comment-1221790</link>
    <description> &lt;p&gt;I was thinking about this today, and I decided you have a few more things you might want to look at...&lt;/p&gt;
&lt;p&gt;1)  Why are you so sure it&#039;s not the server?  Do you have enough RAM?  Is some of the RAM faulty?  Is the processor functioning correctly?  Is the processor strong enough to do this along with everything else?&lt;br /&gt;
2)  PHP has an inherent caching system.  Are you using PHP?  If so, is it configured for caching?&lt;br /&gt;
3)  I believe MySQL has a caching system as well.&lt;br /&gt;
4)  How are you processing your UPDATE calls?  Are you using location methods that aren&#039;t efficient (for example, UPDATE...WHERE this_field LIKE = &#039; %$something%&#039; ... instead of UPDATE... WHERE id = &#039;$id&#039;)&lt;br /&gt;
5)  Do you have faulty / improper connections to the db?  I forgot to close a connection on a site once, and the database performance seriously suffered.  When I found this, and corrected it, performance increased exponentially...  always keep track of your connections, and be sure to close them so you save system resources.&lt;/p&gt;
&lt;p&gt;But to really help you, we need more information from you.  Specific code, site stats, db stats, maybe some server info...  But I&#039;ve told you this before, and you haven&#039;t given us anything.&lt;/p&gt;
 </description>
     <pubDate>Wed, 18 Jul 2007 04:55:00 +0000</pubDate>
 <dc:creator>brady.k</dc:creator>
 <guid isPermaLink="false">comment 1221790 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/slooooooooooooooooow-mysql#comment-1221780</link>
    <description> &lt;p&gt;&lt;a href=&quot;http://www.petefreitag.com/item/430.cfm&quot; class=&quot;bb-url&quot;&gt;Insert delayed&lt;/a&gt; statements may improve your performance, but it seems like your problem is worse than an optimizing issue.  How many columns do you have indexed?&lt;/p&gt;
 </description>
     <pubDate>Tue, 17 Jul 2007 23:50:49 +0000</pubDate>
 <dc:creator>pr0gr4mm3r</dc:creator>
 <guid isPermaLink="false">comment 1221780 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/slooooooooooooooooow-mysql#comment-1221772</link>
    <description> &lt;p&gt;I&#039;m assuming that you are using MySQL since you didn&#039;t directly answer the question...&lt;/p&gt;
&lt;p&gt;Can we see some of the queries?  You may be doing things that will slow it down, despite the server&#039;s speed.&lt;/p&gt;
&lt;p&gt;Also, you can always look into something like memcached, or a home grown solution, that only processes INSERT and UDPATE queries at a predefined interval as a batch, and uses something like a LUT (look up table) for SELECT queries... all rather than do it directly to the database.  The whole idea is to make it faster (Facebook and LiveJournal are big memcached users)&lt;/p&gt;
 </description>
     <pubDate>Tue, 17 Jul 2007 19:27:49 +0000</pubDate>
 <dc:creator>brady.k</dc:creator>
 <guid isPermaLink="false">comment 1221772 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/slooooooooooooooooow-mysql#comment-1221702</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;&lt;strong&gt;brady.k;221701 wrote:&lt;/strong&gt; Any standard relational database should be very quick.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Murphy&#039;s Law.&lt;/p&gt;
&lt;p&gt;Well, its only when using INSERT or UPDATE when the query takes a while to execute.  SELECT works fine.&lt;/p&gt;
&lt;p&gt;There is roughly 2000 records in the main table.&lt;/p&gt;
&lt;p&gt;It was running fine but started to slow down once there were a lot of records added to the database.  The more records added, the slower the database.&lt;/p&gt;
&lt;p&gt;If it&#039;s not the server, what could be done to try and speed it up?&lt;/p&gt;
 </description>
     <pubDate>Mon, 16 Jul 2007 19:46:51 +0000</pubDate>
 <dc:creator>sublimer</dc:creator>
 <guid isPermaLink="false">comment 1221702 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/slooooooooooooooooow-mysql#comment-1221701</link>
    <description> &lt;p&gt;Is this a MySQL db?  Any standard relational database should be very quick... whether it&#039;s MySQL, MSSQL, Oracle, etc.&lt;/p&gt;
&lt;p&gt;It&#039;s either your server (need more RAM or disk space?), or your script (efficiency?).&lt;/p&gt;
 </description>
     <pubDate>Mon, 16 Jul 2007 19:06:20 +0000</pubDate>
 <dc:creator>brady.k</dc:creator>
 <guid isPermaLink="false">comment 1221701 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
