Dec 19

Post Traumatic SQL Disorder

I’m having Post Traumatic Stress Disorder so bear with me. I may need therapy after the last couple of days I’ve had.

I had been avoiding the glaringly obvious problem with Fabulous Blogging over the last months. It was slow. And getting slower. Not necessarily on the outside (from a reader’s viewpoint) but on the inside – OMG, trying to make changes was painful. I had done all the usual stuff; delete plugins, revert to simpler themes, reduce javascript, add caching plugins, blah blah blah.

It was still slow.

Everytime I called tech support for my server, they agreed, but no one had an answer I hadn’t already googled a million times. Until David.

David was a blessing and a curse. I happened to get him on the phone on Monday when I decided, “You know what? I don’t care how slow it is, I need to make design changes.” That lasted all of five minutes before I was whining at tech support again.

He showed me….

The slow SQL query log. Why hadn’t anyone told me about this before?

My whole world opened up and simultaneously shut down. David and I looked at the query logs and he was impressed with the ridiculous number of long and slow queries my database was made. I aim to please.

For a moment I felt relief…finally I had some answers. And then dread– the answer.

I could either clean and repair the queries or start over. David said he supposed I could figure out how to repair, but it was my call. In other words, he couldn’t help me with this.

I was on my own.

This was Monday morning at 8am. I spent all day trying to work within my database, making changes to my design, cleaning things out, and eliminating plugin issues.

By 8pm, I was drinking…heavily. The more I drank, the braver I got. By 10pm, I was in my SQL database hitting the delete button like it was a slot machine at Mohegan.

The site started to speed up. Was I onto something?

Maybe. There were hundreds of table items that had to do with old themes and old plugins I’d tried. In other words, all the months I spent fiddling was coming back to bite me in the ass.

But have no fear! Julie was drinking and deleting. Faster and faster the site started to go, until I realized something.

I had deleted the comment box input area.

Oops.

It was now 10pm Monday night. If there was ever a moment where I felt like quitting, it was then. “Fuck this,” I said. “I’m done.”

I went to bed in tears and exhausted.

Somewhere in the middle of the night, my brain figured out a plan. I wouldn’t try to become an SQL master, even though I understood the concept enough to maybe make it work. I would rebuild.

At 4am, I woke up.

I created a directory on my server and got to work. The sun wasn’t even up!! I couldn’t even import my blog because I REFUSED to have any slow queries come with me. I was going to copy and paste. It meant I would lose all my comments, categories, and tags.

That’s right. Every single post and page was copied and pasted into a fresh install and database. This wasn’t the hard part.

The hard part was ensuring that the permalink remained EXACTLY the same as the old site. I had to backdate everything and manually enter the link each time. Comparing it to the old one to make sure I hadn’t made any mistakes. I had to save a draft before publishing so the permalink structure would update properly and with the right date.

By noon, I couldn’t see straight, but it was done. It was time to test my work.

I called Hostmonster and had them help me move directories. Then I had to update the image URLS with a plugin.

Then I prayed.

The site came up.

I frantically went to Google to type in all those keywords I have worked hard to get on the first page for. I clicked on the link and there– my new site appeared.

I couldn’t believe it.

I cried.

fabulous blogging

I look so happy and lighthearted. It’s all a lie people. I was stressed TO THE MAX.

The tech on the phone could NOT believe that I had done that in one sitting. She said she was highly impressed with a blog so young fighting with big dogs on Google for first page slots.

It was all worth it.

If you head over there, there are still lots of things I’m working on. My design, content, cleaning, etc. but I need to take a break and work with all my paying clients for a while.  Maybe you won’t notice a difference in speed. That’s okay. I notice.

So the moral of the story is, if I work for you and go into your blog and see 5000 plugins? It may trigger a trauma episode.

They say failure is a good teacher. I know hundred’s of things today I didn’t know on Sunday. I’m even signed up for a one on one lesson in SQL.

There is always a silver lining.

Leave a Reply

Your email address will not be published.