Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 618825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:35:20+00:00 2026-05-13T18:35:20+00:00

In my database of 5 million records .. Structure of the table: CREATE TABLE

  • 0

In my database of 5 million records ..
Structure of the table:

CREATE TABLE IF NOT EXISTS `music` (
  `id` int(50) NOT NULL auto_increment,
  `artistname` varchar(50) NOT NULL,
  `songname` varchar(50) NOT NULL,
  `duration` varchar(6) NOT NULL,
  `url` varchar(255) NOT NULL,
  `server` int(5) NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `artistname` (`artistname`),
  KEY `songname` (`songname`),
  KEY `url` (`url`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ;

How can I optimize the table and then doing a search through the fields “artistname ” and “songname”?

Sorry for bad english. From Russia with love 😀

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:35:20+00:00Added an answer on May 13, 2026 at 6:35 pm

    Create a FULLTEXT index:

    CREATE FULLTEXT INDEX fx_music_artist_song ON music (artistname, songname)
    

    and issue a query like this:

    SELECT  *
    FROM    mytable
    WHERE   MATCH(artistname, songname) AGAINST ('+queen +bohemian' IN BOOLEAN MODE)
    

    This will match across both artistname and songname, even if the words are not leading.

    To match only the artist, you can create an additional index on artistname only and use it in a query:

    SELECT  *
    FROM    mytable
    WHERE   MATCH(artistname) AGAINST ('+queen' IN BOOLEAN MODE)
    

    The column set in the MATCH clause should be exactly the same as in the index definition for the corresponding index to be used.

    Note that this clause will work even without the index, but in this case it will be much more slow.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I read a table with more than 1 million records from a database. It
I have a very large database with about 120 Million records in one table.I
I have a table with about 20+ million records. Structure is like: EventId UNIQUEIDENTIFIER
I have one table with almost 2 million records on my SQLite database, some
I have a huge Database table containing around 5 Million rows. Now retrieving records
I have a test database with 1 table having some 50 million records. The
I have about 2 million records in a table in PostgreSQL database with columns
I once had a MySQL database table containing 25 million records, which made even
I have an oracle database populated with million records. I am trying to write
I am dealing with a very big database ~ 6 Million records. I've added

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.