Most efficient way to search in SQL?

前端 未结 7 1996

I have a database with 75,000+ rows with 500+ entries added per day.

Each row has a title and description.

I created an RSS feed which gives you the latest entri

7条回答
  •  既然无缘
    2021-02-08 08:35

    Try either of the following four queries:

    select * from myTable where concat_ws(' ',title,description) like '%pizza%';
    select * from myTable where concat_ws(' ',title,description) regexp '.*pizza+.*';
    select title,description from myTable where concat_ws(' ',title,description) like '%pizza%';
    select title,description from myTable where concat_ws(' ',title,description) regexp '.*pizza+.*';
    

    the point is to use concat before searching

提交回复
热议问题