• SQL: finding a user’s country/region based on IP

    May 26, 2009

    I’ve encountered the same problem twice for different customers, so I guess it’s worth a discussion.
    A common task for web applications is to find out the country/region of a user, based on her IP address, as can be detected in the HTTP request. Depending on the country of origin, the website can translate dates for [...]

  • Reasons to use innodb_file_per_table

    May 21, 2009

    When working with InnoDB, you have two ways for managing the tablespace storage:

    Throw everything in one big file (optionally split).
    Have one file per table.

    I will discuss the advantages and disadvantages of the two options, and will strive to convince that innodb_file_per_table is preferable.
    A single tablespace
    Having everything in one big file means all tables and indexes, [...]

  • The importance of report_host & report_port

    May 13, 2009

    The two server variables, report_host and report_port, are not commonly used. One of the reasons, I suspect, is that they do not appear in any of the standard .cnf files provided with a MySQL installation.
    For a replication environment, I find these two variables to be very useful.
    Where are these variables used?
    Here’s a slightly modified exerpt [...]

  • MySQL not being able to utilize a compound index?

    May 7, 2009

    I came today upon a very strange issue. It seems like MySQL is unable to utilize a compound index when evaluating a plan for a query with a range condition. I’m looking for an explanation. I’ll appreciate any insight on this.

 
Powered by Wordpress and MySQL. Theme by openark.org