Posts

Showing posts from June, 2014

Intersystems Cache Indexing Shocker - How to Fix Sluggish Queries

Image
When going through a performance review of a grid on the website, I was struggling to see why the query was taking so long. It was a single table query with a single where clause which was on an indexed field. This indexed field could only contain 5 different values and the query was return fewer than 100 entries but was taking over 1 second.

On other lower powered servers the query was taking less than a third of a second and often returning more data albeit on a smaller total data set.

Checking the query plan revealed something interesting, the query was not using the index but was instead performing a whole table scan. Further testing revealed that only "=" queries use indexes. "!=" ignore indexes as do any queries with "OR" or "IN".

After further investigation I found that if you only return the ID then NOT, OR , IN queries do use indexes, however, if you return any other field including the field you are performing your where clause on you…

MVC Frameworks - CakePHP a quick Evaluation

A real project always throws up more issues than following the tutorials, I find that you not only tend to learn faster, but to a deeper level.

To try and evaluate CakePHP I made up a simple application. This was a simple car database to allow direct comparison of different makes and models comparing the following characteristics:

Price, Seats, 0-60 MPH time, MPG, Age, Road tax.

Within an hour of downloading CakePHP I had a working create, read, update, delete (CRUD) application. After 2 hours the filtering of the available fields to restrict the list to various required maximums or minimums and 20 cars details were manually entered. The application was essentially built working and tested to a basic level in 2 hours with 200 lines of code.

The real advantage though was those 2 hours were not hard pressed programming, it was a relaxed pace, and I am unsure without a framework I could get a CRUD application to the same level without a reasonable amount of planning time.

The framework d…

Zend Framework VS CodeIgniter VS CakePHP VS Symfony Part 1

The annoying thing about programming is that the "right" way is not always obvious until you have done a lot of work on a project, sometimes design flaws only become obvious much later in production environments, when the real world starts to attack your lovely code.

The best way to avoid the wrong way is to try to arm yourself with as much knowledge about what is available as possible to reduce the chances of incorrect decisions. As such I have been looking into various PHP frameworks to try to establish which will be optimal for a project I am working on.

All four frameworks are designed to try and help you produce software as quickly and efficiently as possible. The goal is to assist you making the correct design decisions from the outset so that code is more reusable and easy to understand.

All the frameworks essentially rely on the Model View Controller (MVC) design pattern and the main learning curve to each is understanding how the Model, View and Controllers are crea…