Follow @endyourif rss Facebook LinkedIn

Improving the performance of slow Entity Framework queries

Published on Apr 18, 2019

I'm a big fan of Entity Framework. It makes working with databases very convenient. I've discussed previously how I use Entity Framework to implement the repository pattern. Of course with ease of development sometimes sacrifices performance. In today's article I'm going to explain my favorite approach to improve the performance of Entity Framework queries that are slow.

Setting up SSL with nginx including redirects from non HTTPS traffic

Published on Feb 6, 2019

In an attempt to improve security and privacy on the Internet, Google is encouraging websites to secure their site with an SSL certificate, aka https:// instead of http://
As you may have noticed, I just officially updated my domain to be under SSL. As I described in my It's LEMP not LAMP post that I use nginx for my web server. I thought I would share how easily I was able to convert my website to use SSL with nginx.

Before you begin, be sure you have already created your SSL certificate and have your certificate and private key files ready and uploaded to your server (I got my SSL cert free with my domain registration at Porkbun).

C# OutputCache with subdomains

Published on May 4, 2018

The other day I was working on a project that was leveraging OutputCache. This little attribute is a fantastic way to implement caching in an MVC project. This was working great until I encountered a snag when using a subdomain.

MySQL: OR versus UNION – which is faster?

Published on Mar 24, 2014

I must say, this came as a shock to me, until I looked at the results and thought about it for a minute.  Before jumping in, let me explain how and where I encountered this.  I was recently working on a project called Deja Scene – The actor to actor movie database.  The purpose of this site is to find two actors who have starred in multiple movies together.

Because the nature of the algorithm an actor can be either on the left side of the connection or the right side.

Let’s look at an example, if I search for George Clooney, I will find that he has 372 Deja Scene connections.  Here was the original query I used to retrieve the list of his connections:



SELECT *

FROM  `actor2_actors`

WHERE actor1_id =1

OR actor2_id =1



Seems pretty straight forward; however, I was seeing really slow performance and I couldn’t figure out why.  I created an index on both the actor1_id and the actor2_id, so I assumed Mysql was properly indexing this.  Boy was I wrong.  Look at the results when I use the EXPLAIN function:

Three-month work-life retrospective

Published on Sep 11, 2013

Just over three months ago, I posted a few memorable blogs (for me) in regards to a career change.  The career change has been made and I thought I would share my retrospective on how it has affected me.

Following the format of the retrospectives I have been over the past 3 months, I’ll start with a check in word:

Rejuvenated

Making the move from an 85% managerial role to a 100% development role has completely rejuvenated me.  In the past three months I have gained an incredible amount of knowledge and furthered myself as a person and a developer.

Moving along to the next items:

  • What do I want to stop doing?

  • What do I want to start doing?

  • What do I want to continue doing?


I’m hooked on test-driven development (TDD) with a Fizzbuzz C# Example

Published on Aug 6, 2013

If You Don't Start You Won't Finish

Published on Jun 13, 2013

What Do You Care Most About When Reviewing Someone Else’s Code?

Published on Jun 10, 2013

Developers are Authors

Published on Jun 6, 2013

Automapper Performance Testing

Published on May 27, 2013

Simplifying the buzz word “Responsive Design”

Published on Feb 4, 2013

Node.js Versus Nginx: Bare Bones Test

Published on Dec 4, 2012

Node.js Versus Apache2: Bare Bones Test

Published on Dec 3, 2012

PHP: Single Quotes versus Double Quotes

Published on Oct 9, 2012

Upgrading my Blog - The Final Saga!

Published on Sep 24, 2012

Load Testing Mysql with mysqlslap

Published on Sep 17, 2012

Update: It Actually Should Be LEPP Not LEMP or LAMP!

Published on Sep 14, 2012

Comparing a while loop against a foreach loop of an array

Published on Sep 12, 2012

What I Learned This Summer

Published on Sep 7, 2012

It's LEMP not LAMP!

Published on Sep 6, 2012

A Simple But Effective Speed Comparison

Published on Sep 4, 2012

PHP: Require/Include vs Autoloader

Published on Aug 29, 2012

CakePHP Version Comparison with PHP Version Comparison

Published on Jun 25, 2012

Highlights from Webistrate: HTML5, MVC 3, and CSS3

Published on Sep 21, 2011

Improving the speed of AJAX request and response times

Published on Sep 1, 2011

CakePHP 1.2 VS 1.3 VS 2.0 Page Request Times

Published on Mar 7, 2011

CakePHP 1.2 VS 1.3 VS 2.0 Page Request Times

Published on Mar 7, 2011

Building A Scalable Queueing System With PHP

Published on Feb 14, 2011

Speeding up client/server response times

Published on Jan 10, 2011

Speeding up client/server response times

Published on Jan 10, 2011

Optimizing CakePHP Websites

Published on Jan 20, 2010

Optimizing CakePHP Websites

Published on Jan 20, 2010

Caching Queries in CakePHP

Published on Apr 25, 2009

Optimize your CSS and JS with CakePHP in minutes

Published on Mar 21, 2009

When to use element() and when to requestAction()

Published on Mar 16, 2009

CakePHP Containable Statement Pitfalls

Published on Mar 15, 2009

CakePHP Containable Statement Pitfalls

Published on Mar 15, 2009

The Importance of Database Indexing

Published on Feb 27, 2009

Dynamic COUNT() Versus Static COUNT()

Published on Feb 24, 2009

Dynamic COUNT() Versus Static COUNT()

Published on Feb 24, 2009

Why You Should Avoid ORDER BY RAND() OR NEWID()

Published on Feb 23, 2009

Why You Should Avoid ORDER BY RAND() OR NEWID()

Published on Feb 23, 2009

Fixing slow drag and drop with scriptaculous

Published on Feb 18, 2009

SQL Tips - Why LEFT JOINS are bad

Published on Feb 13, 2009

SQL Tips - Why LEFT JOINS are bad

Published on Feb 13, 2009

How to get indexed by Google in ONE hour

Published on Feb 12, 2009

YSlow - Helping slow web pages load faster

Published on Feb 11, 2009