do i need an index for this?

2004-07-14 Thread J S
Hi, I want to find the earliest and latest times in the time column of my table internet_usage: +--+--+--+-+-+---+ | Field| Type | Null | Key | Default | Extra |

Re: do i need an index for this?

2004-07-14 Thread Dan Nelson
In the last episode (Jul 14), J S said: I want to find the earliest and latest times in the time column of my table internet_usage: +--+--+--+-+-+---+ | Field| Type | Null | Key | Default | Extra |

Re: do i need an index for this?

2004-07-14 Thread Justin Swanhart
Creating a key will make that query execute very fast, but if that is the only reason for the key you are going to be trading quite a lot of space for the speed of one query. How often are you going to run this query? If you have 324 million rows, then that index is going to consume somewhere

Re: do i need an index for this?

2004-07-14 Thread J S
Thanks for your reply. Can I just check my syntax is right for creating the key? CREATE INDEX urlindex ON internet_usage (time); I ran this before but got an error 27 (eventhough the filesize ulimit was set to unlimited). So just wondered if I was using the wrong syntax? JS. In the last

Re: do i need an index for this?

2004-07-14 Thread Dan Nelson
In the last episode (Jul 14), J S said: Thanks for your reply. Can I just check my syntax is right for creating the key? CREATE INDEX urlindex ON internet_usage (time); I ran this before but got an error 27 (eventhough the filesize ulimit was set to unlimited). So just wondered if I was

Re: do i need an index for this?

2004-07-14 Thread John Larsen
Hmmw your syntax should ork. Possibly try CREATE INDEX urlindex ON internet_usage (time(8)); W 8hich will only use the first charaters of your time field, it should make the index significantly smaller in size. Though I'm not completly sure shorting time field this way is legal, but you can

Re: do i need an index for this?

2004-07-14 Thread Dan Nelson
In the last episode (Jul 14), John Larsen said: Hmmw your syntax should ork. Possibly try CREATE INDEX urlindex ON internet_usage (time(8)); W 8hich will only use the first charaters of your time field, it should make the index significantly smaller in size. A timestamp field is only 4 bytes

Re: do i need an index for this?

2004-07-14 Thread J S
In the last episode (Jul 14), J S said: Thanks for your reply. Can I just check my syntax is right for creating the key? CREATE INDEX urlindex ON internet_usage (time); I ran this before but got an error 27 (eventhough the filesize ulimit was set to unlimited). So just wondered if I was