Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

When table fuinfo is initially loaded with 10 million records, the email address

ID: 3755234 • Letter: W

Question

When table fuinfo is initially loaded with 10 million records, the email addresses were not included. You were recently supplied those email addresses and now you need to update those records. What should you do before updating those records?

Questions 12 - 14 are based on the following table definition:

CREATE TABLE fuinfo

(

fid int(10) unsigned NOT NULL,

name varchar(40) NOT NULL,

email varchar(128) NOT NULL,

UNIQUE KEY email (email),

UNIQUE KEY fid (fid)

) ENGINE=MyISAM DEFAULT CHARSET=utf8

   a alter table fuinfo drop index email;

   b drop index email on fuinfo;

   c Both a and b

   d Neither a nor b

Explanation / Answer

You need to drop index before updating the email address in the table. with below query.

b) drop index email on fuinfo.

Because what happends here, If there is any index on the table then all data from that indexed column is stored separatly and when fetch request comes then first this index table is checked to retrieve data quickly.

This concept is similar to any Book Index. When we need to fin something we go to index and search the page number and directly go to that.

But when we need to update 10 Million records on indexed table then it will write both tables index table and this fuinfo table which will consume a lot of time.

If you have any doubt or query on this. You can ask me in comment.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote