Advice indexing new DB
Posted by:
bob bob
Date: January 25, 2008 02:37AM
Hi,
I have a new test DB with my firewall logs in it. Fairly simple but a lot of records.
mysql> desc logs;
+-----------+------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+------------+------+-----+---------+-------+
| fw_name | char(20) | YES | | NULL | |
| date | date | YES | | NULL | |
| time | time | YES | | NULL | |
| event | char(20) | YES | | NULL | |
| ip1 | bigint(20) | YES | | NULL | |
| userid | char(10) | YES | | NULL | |
+-----------+------------+------+-----+---------+-------+
6 rows in set (0.00 sec)
There are 20 million records! It works for what I want it for, but I am conscious that I don't have any primary key or indexing. I have gotten myself all confused on what to do for the best.
Do I need to define a primary key or an index? I would generally want to search on a combination of date and userid.
Thanks
Subject
Written By
Posted
Advice indexing new DB
January 25, 2008 02:37AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.