473,465 Members | 2,103 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

index by END of string, not beginning of string

dt
My understand is that MYSQL only supports indexes on the beginning of a
string of data.

for example, if you have a list of email addresses, searching for
something like '%@yahoo.com' would need to do a full table scan.

why doesn't mysql offer a feature where it indexes by the END of the
string, so we can do these types of searches efficiently?

an index for email addresses of length 3 would only contain the last 3
chars, but it would still be a useful index type.

dave

Aug 29 '06 #1
1 4538
dt wrote:
why doesn't mysql offer a feature where it indexes by the END of the
string, so we can do these types of searches efficiently?
Probably the same answer as for any other "why don't they offer feature
X?" The answer is, "great idea! we'll do it when it comes to the top of
the priority list."

By the way, what you're describing could be achieved with current MySQL:
create a second column, copying the string to it using the REVERSE()
function, and then indexing that column.

Another extension to MySQL could be to allow us to create indexes based
on an expression, like REVERSE(colname), and then any expression in a
query that uses that exact syntax could make use of the index. This is
called "expression indexes" and it's an implementation feature in some
other RDBMS products (e.g. Firebird).

Regards,
Bill K.
Aug 30 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mike Edey | last post by:
Good day. Recently I'd run into wishing a list's index method would match substrings. Being fairly new to this game I can't help but think that my solution is a little, well, clumsy. In the...
9
by: kosh | last post by:
I was wondering if there is or there could be some way to pass a generator an optional starting index so that if it supported that slicing could be made more efficient. Right now if you do use a...
10
by: Andrew Dalke | last post by:
Is there an author index for the new version of the Python cookbook? As a contributor I got my comp version delivered today and my ego wanted some gratification. I couldn't find my entries. ...
17
by: Dima Tkach | last post by:
Hi, everybody! I just ran into a weird problem on 7.3.4. Here is a simple testcase: rapidb=# create table nametab (name text); CREATE TABLE rapidb=# create index name_idx on nametab(name);...
4
by: marc.gibian | last post by:
I have been trying to improve the quality of my C# and ADO.NET coding. One of the books I've read strongly advises against using string values to address individual values in DataRow objects. This...
2
by: FBergemann | last post by:
if i compile following sample: #include <iostream> #include <string> int main(int argc, char **argv) { std::string test = "hallo9811111z"; std::string::size_type ret;
3
by: Madmartigan | last post by:
Hello I have the following task but am battling with the final output. How do I keep two different vectors in sync and how would I retrieve the index for the maximum value of one of the vectors??...
3
by: Robert Bevington | last post by:
Hi all, I ran into memory problems while tying to search and replace a very large text file. To solve this I break the file up into chunks and run the search and replace on each chunk. This...
5
by: jehugaleahsa | last post by:
Hello: I have an input string that is supposed to follow a particular syntax. I am making a simple parser. In doing so, I need to write a lexical analyzer. I have decided to implement it in...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.