3 votes 3 votes Databases indexing databases + – Arnabi asked Oct 28, 2017 Arnabi 783 views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply akash.dinkar12 commented Oct 28, 2017 reply Follow Share whether the first entry of the page is sorted or not??? 0 votes 0 votes Arnabi commented Oct 28, 2017 reply Follow Share nothing is said about whether its sorted or unsorted. pls explain with a diagram. 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes is it 2? arch answered Oct 29, 2017 arch comment Share Follow See all 10 Comments See all 10 10 Comments reply pranab ray commented Oct 29, 2017 i reshown by pranab ray Oct 29, 2017 reply Follow Share how its 2 ...according me 9 is coming? can u please ur approach 0 votes 0 votes arch commented Oct 29, 2017 reply Follow Share it is phone book so it is ordered. there are 500 pages and each page can store 500 records. as key + pointer to block <= record, we can store it like primary indexing. for each page we can store key and pointer so for 500 pages we can stores pointer in 1 page. so 1 page acces to see index and 1 more page access the record. 1 votes 1 votes pranab ray commented Oct 29, 2017 reply Follow Share but search is taken place here based on the name of first entry of each page....which is just like sparse indexing ... each block contain 500 records and here it is 500 pages . so 1 index is enough to store all pages. total block=501 avg. no block access=log B +1=9+1=10 in worst case linear search =501/2=251 search....if m wrong plz correct me 0 votes 0 votes arch commented Oct 29, 2017 reply Follow Share i dont understand how you take it but i will explain in detail my approach. but first i want to knw what is correct answer. because may be ur approch correct and mine wrong. some one who knows what is correct answer please post. 0 votes 0 votes pranab ray commented Oct 29, 2017 reply Follow Share yaa that may be write....whats the ans...@Arnabi 0 votes 0 votes Arnabi commented Oct 29, 2017 reply Follow Share @arch ans given is 2. Can you explain this line "as key + pointer to block <= record, we can store it like primary indexing" more? from where in the question are you getting key value and block pointer size? 0 votes 0 votes arch commented Oct 29, 2017 reply Follow Share suppose u have table employee(ssn , first name , last name , salary , department , dob , address , phone no) each row of this table is called record. in block we store full row but in index block we store only primary key(if primary indexing is used) + block pointer so index block contain only (ssn , block pointer ) which will be less in size then particular row . if 1 page contain 500 records then 1 page contain (page no. of 500 pages + enchor key)which is analogous to block pointer and ssn respectively. so for seeing correct page we first access index page and then one more access to access that particular page in which particular record which we are looking is present so 2 page access required. 1 votes 1 votes utk0203 commented Oct 29, 2017 reply Follow Share Isn't is ceil(500) i.e 3 pages to be loked up? 0 votes 0 votes Arnabi commented Oct 29, 2017 reply Follow Share @arch thanks :) So, index block contains name of first entry of each page and page no. Thus 1 page access for the index itself + 1 page for the particular entry we wanted to search. Total page to look up =2. 0 votes 0 votes arch commented Oct 29, 2017 reply Follow Share no question asked only for no. of page access thats y record access is ignored. 0 votes 0 votes Please log in or register to add a comment.