The log_time column is indexed, but I couldn't work out how to index two
columns in mysql.

Indexing two (or more) columns in MySQL is the same as indexing one:

CREATE TABLE a_table(
  remote_id INTEGER UNSIGNED NOT NULL,
  log_time DATE NOT NULL,
  INDEX remote_time(remote_id, log_time)
)

Simply comma-seperate the column names in your INDEX statement... This is the MySQL >4.0 syntax. I don't know about previous versions.

Cheers,
Philippe

Zoran Avtarovski wrote:
Do things get faster if you have the database index remote_id and
log_time?


The log_time column is indexed, but I couldn't work out how to index two
columns in mysql.

Z.




Reply via email to