Jump to content


Member Since 06 May 2003
Offline Last Active Today, 05:38 AM

Posts I've Made

In Topic: Problem in mysql indexing.

Today, 05:22 AM

Try dropping the combined index, and instead have 2 separate indexes on begin_long_ip and end_long_ip.

In Topic: how backbone.js can help me?

21 July 2014 - 08:13 AM

gristoi is correct. Backbone is one of a number of javascript frameworks that have become popular in the last few years. There are now quite a number to choose from, which each have their own philosophy and approach. Backbone is one of the oldest, and takes a minimalist approach. Many of the newer competitors like Ember and Angular provide data binding/model functionality that can be quite compelling in comparison to Backbone.

Here's links to backbone and other competitors in this space:


At this point, Angular, Ember and Backbone all have a good number of well known sites built using them. There's a nice surface level comparison page here: http://blog.codescho...s-best-for-your

In Topic: Problem in mysql indexing.

21 July 2014 - 07:44 AM

Just as I expected.

`begin_long_ip` varchar(20) NOT NULL,
`end_long_ip` varchar(20) NOT NULL,
You have defined these as strings. Then you want to do a comparison as integers.

EXPLAIN select * FROM ip2country WHERE 3084727327  BETWEEN begin_long_ip AND end_long_ip;
This works because mysql is changing the columns on the fly to integers.

The solution is.... convert the columns to UNSIGNED INT which is what they should be, since you're actually storing integer values in there.

You should see the indexes working as planned once you alter the table to type the columns correctly.

In Topic: timestamp vs timezones

19 July 2014 - 07:31 AM


Well yes and no. It does store timestamps as UTC, but that is irrelevant if the server's timezone isn't UTC, since it will convert that internal value on the fly to whatever the timezone of the server is.

In Topic: Problem in mysql indexing.

19 July 2014 - 07:24 AM

Do a SHOW CREATE TABLE ip2country and copy and paste the results.

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime