Question: I am having the strangest time with the following PHP code. The require\_once runs in the else statement even though the if statement is true. What is also strange is that $controller in the else statement recieves the value of "application." There is no other code related to the following other than $total's value.

```
    $total = $uri->total();

    if($total == 0) {

        //Home Page Controller
        $controller = 'index';
        $method = false;

    } else {

        $controller = $uri->segment(1); //value is "account"

        if($uri->segment(2) !== false) {
            $method = $uri->segment(2); //value is "login"
        } else {
            $method = false;
        }
    }

    require_once(APPPATH.'controllers/'.$controller.EXT);

    $$controller = new $controller;

    if($method != false) {
        $$controller->$method();
    } else {
        $$controller->index();
    }

```

Edit: I fixed the double-code so that the same code is not called twice in either the if or the else. When I run this, the code works, but I get an error on the line where the require\_once is: cannot find application.php

This is strange because require\_once is already loading the correct class, but I am getting an error that it cannot find the right file. What would cause it to load twice? I've checked to make sure the file this PHP is in doesn't load twice.

This is all the code I am working with except the URI class found here: <https://github.com/chrisabrams/PHP-URI-Class>

I am not sure where application.php comes from.

Answer: 
1. Vertical partitioning for large tables to reduce I/O and cache requirements -- separate columns that are queried often vs rarely.
2. Adding a column to a production system when the `alter table` is "too expensive".
3. **[Super-type/subtype](https://stackoverflow.com/questions/1722741/defining-a-one-to-one-relationship-in-sql-server/1723519#1723519)** pattern.
4. Vertical partitioning to benefit from table (join) elimination -- providing optimizer 
supports it (again to reduce I/O and cache) .
5. **[Anchor modeling](http://www.anchormodeling.com/?page_id=22)** -- similar to 4, but down to **[6NF](http://en.wikipedia.org/wiki/Sixth_normal_form)**.
yes in general.

One exception may be if you want to assign privileges differently to a subset of columns.

also consider that this is true only when both sides are required.