7 7 votes Consider the following statement (i) Primary index is always sparse (ii) Secondary index may or may not be dense Which of the above statement is/are false? A)Only (i) B)Only (ii) C)Both (i) and (ii) D)None of these Databases databases indexing + – Keith Kr 11.3k views answer comment Share Follow Print See 1 comment 1 1 comment reply Sinchit commented Dec 11, 2020 reply Follow flag correct answer is A. Primary index can be dense or can be sparse. But sparse is preferable on primary index. so option A is false. Secondary index is always dense over key but it can be dense or sparse over non key. chosen answer is wrong! 0 0 replyShare Please log in or register to add a comment.
Best answer 11 11 votes Ans is D Primary is always sparse. Secondary may be dense if done on a key field and sparse if done on a non-key field. Keith Kr answered Oct 19, 2014 • selected Nov 24, 2016 by Tendua Keith Kr comment Share Follow See all 10 Comments 10 10 Comments reply Show 7 previous comments akash.dinkar12 commented Oct 21, 2018 i edited by akash.dinkar12 Oct 22, 2018 reply Follow flag what if block size equals to record size, then each block will hold 1 record then in this case for every record we should have an entry in an index file which will satisfy the meaning of dense index then how can we say primary indices are always sparse?? 0 0 replyShare Dharmendra Lodhi commented Oct 21, 2018 reply Follow flag Sparse Index : A sparse index in databases is a file with pairs of keys and pointers for every block in the data file. Dense Index: A dense index in databases is a file with pairs of keys and pointers for every record in the data file. if block size equals to record size then also it will be sparse index only(according to above defination) Ref: https://en.wikipedia.org/wiki/Database_index 0 0 replyShare Raj Singh 1 commented Jan 27, 2019 reply Follow flag @minal Korth says: "A file may have several indices, on different search keys. If the file containing the records is sequentially ordered, a clustering index is an index whose search key also defines the sequential order of the file. Clustering indices are also called primary indices; the term primary index may appear to denote an index on a primary key, but such indices can in fact be built on any search key. The search key of a clustering index is often the primary key, although that is not necessarily so." Further it says: "In a dense index, an index entry appears for every search-key value in the file. In a dense clustering index, the index record contains the search-key value and a pointer to the first data record with that search-key value. The rest of the recordswith the same search-key valuewould be stored sequentially after the first record, since, because the index is a clustering one, records are sorted on the same search key." So what you want to conclude from this and what Elamasri Navathe says? 0 0 replyShare Please log in or register to add a comment.
2 2 votes i think option C is correct. primary index may or may not be sparse. but Secondary index is always dense. khushtak answered Jan 25, 2016 khushtak comment Share Follow See 1 comment 1 1 comment reply SeekerAI commented Jan 23, 2024 reply Follow flag you answer is correct idk why it is voted as wrong one 0 0 replyShare Please log in or register to add a comment.
0 0 votes D Secondary index cant be sparse they have to be dense coz values are scattered among the db file and file is not ordered on search key and primary index can be dense/sparse. Anurag_s answered Jan 23, 2015 • edited Jan 23, 2015 by Anurag_s Anurag_s comment Share Follow See all 3 Comments 3 3 Comments reply Hcas Hgnis commented Jan 23, 2015 reply Follow flag check this out... answer should be D only.. http://nptel.ac.in/courses/106106093/13 1 1 replyShare Anurag_s commented Jan 23, 2015 reply Follow flag Yes i wrote wrong option acc to explanation d is correct 1 1 replyShare Rishi Sharma commented Nov 3, 2024 reply Follow flag D nhi hoga, Primary index is preferably sparse but not always sparse kahan see pdke ate ho ye sb galat salat, primary index ko dense kyu nhi bana skte agar banana ho to kyu dikt hogi usme 1 1 replyShare Please log in or register to add a comment.