Saturday, September 10, 2011

Yankees Stadium

I went to Yankees game last Sunday. It was my first time in Yankees Stadium (new stadium). Roma invited me to the game with two of his coworkers (Eva from Germany) and Japanesse girl. Yankees won the game against Toronto (9-3).
The games was kind of boring... but stadium is great. Overall it was good experience and I like it. Here are some pictures from the game.






Friday, September 2, 2011

Database Optimization

Indexing can dramarically improve performance of MySQL database. Indexing is the most important tool for speeding up your queries.

Facts, Tips & Terms:
- Database is a set of tables. Table is a set of rows and columns
- Full Table scan (slow) - examine each row in the table
- Data rows kept in a data file and index values are kept in a index file
- MySQL indexes speed up searches for rows matching terms of a WHERE clause. It also improve performance of MIN(), MAX()
and ORDER By operations.
- Index columns that you search for, not columns you select
- Declare columns to be NOT NULL - fater processing and less storage.
- Disadvantages of Indexing
a). Slow inserts, deletes and updates (need to update data and index files)
b). Index file takes up the disk space

- How to choose indexes:
b). Use short indexes (int is better than varchar). A smaller index involves less disk I/O, so it can be compared more quickly.
a). Index should be uniue (spread of values in a column). So index work best for columns with unique values.
c). Indexes are used for
<, >, <=, =>, =