anorakgirl
Programmer
Hi,
I have a table with just under 50,000 records in it.
I've done an interface for browsing alphabetically, which basically builds the query:
But its a bit slow (not surprisingly with that many records!)
I'm trying to speed it up a bit. I tried adding an index to myfield, but it made no difference. I guess that might not be used as it is a 'like' query.
I tried
But that is just as slow. I wanted to create an index on 'Left(myfield,1)' as I thought that might help, but it seems you can't do indexes using functions (not even sure if you can on other databases, must have seen it somewhere to get the idea).
So, I just wondered if anyone has done this before and has any tips for improving speed?
Thanks!
~ ~
I have a table with just under 50,000 records in it.
I've done an interface for browsing alphabetically, which basically builds the query:
Code:
select * from mytable where myfield like 'A%'
I'm trying to speed it up a bit. I tried adding an index to myfield, but it made no difference. I guess that might not be used as it is a 'like' query.
I tried
Code:
select * from mytable where Left(myfield,1) ='A'
But that is just as slow. I wanted to create an index on 'Left(myfield,1)' as I thought that might help, but it seems you can't do indexes using functions (not even sure if you can on other databases, must have seen it somewhere to get the idea).
So, I just wondered if anyone has done this before and has any tips for improving speed?
Thanks!
~ ~