Answer the question
In order to leave comments, you need to log in
How to quickly search host in url in mysql?
There is a table with a varchar field containing links. In different rows of the table, these links are of arbitrary length.
The table has 50k rows. I need to take a site.com domain from an arbitrary row in another table and very quickly find the domain in the url .
I do the search like this INSTR(`t1`.`url`, `bl_host`.`host`)
Adding an index on varchar gave a small increase, but this is not enough.
mysql8
Answer the question
In order to leave comments, you need to log in
Since it is known what part of the VARCHAR field will be used in the search, why not store it in a separate column?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question