EssayGhost Assignment代写,Essay代写,网课代修,Quiz代考

EssayGhost-Essay代写,作业代写,网课代修代上,cs代写代考

一站式网课代修,论文代写

高质量的Assignment代写、Paper代写、Report代写服务

EG1hao
网课代修代上,cs代写代考
数据库代写
您的位置: 主页 > 编程案例 > 数据库代写 >
数据库代做:数据库系统技术作业代写 Buffer Management代写 数据库代写 - 代做数据库
发布时间:2021-07-24 15:29:46浏览次数:
2.3 Evaluation of the queriesBy now, you should have the data and the queries to run on it.To run the queries on a backend, and extract the buffer hit rate, you should run PostgreSQL in a standalone backend mode, using the command postgres as follows. Note that this is the easiest way to run a set of queries and extract “interesting” information from the backend.cat queryfile.sql | postgres -B numbuffers -D datadir -d debug-level -s databasename The output of the postgres command contains lots of information. Of interest to you is the buffer hit ratefor each query. In order to make sure youunderstand its output,andcan extract appropriate information, werecommend you to run differentThe flags on the postgres command are explained below:The B flag specifies the size of the buffer cache inThe D flag refers to the dataThe -d flag sets the debug level. This flag will force the backend to print out useful– For this assignment, setting the debug-level to 1 or 2 should be enough.数据库系统技术作业代写The sflag in conjunction with the debug flag results in buffer hit rates being printed in the output. For more information on postgres, you can use man postgres.Note: in the evaluation section, you will have to vary the number of buffers, and to printe the hit rates for different configurations.An example of the command above is as follows:cat ScanQueries.sql | postgres -B 20 -D ~/data/ -d 1 -s mydatabaseNow, you may hack!3 ImplementationThe version of PostgreSQL you are using for this assignment uses the LRU buffer replacement policy. For this assignment you are required to implement the LFU (Least Frequently Used) and MRU (Most Recently Used) replacement policies. Consult your favourite textbook to find out the details of these policies.You can find the buffer manager code in the directoriessrc/backend/storage/buffer src/include/storage/The files which will most likely need the most are:freelist.c–itmanages pages which are not pinned in memory and are eligible forbufmgr.c–itdefines the interface used by the rest of PostgreSQL to access the memory  数据库系统技术作业代写buf_init.c–ithandles initializations of the buffer manager databuf_internals.h–itdefines the data structures used by the rest of the bufferYou should be able to complete the entire assignment by modifying just these files.We recommend that, before you start modifying the files  to  implement the  new replacement policies,  you save a copy of these files elsewhere. Note that you will need to keep separate copies of the 4 files for implementing the LFU and MRU policies.Each time you make changes to the files, you have to compile and install PostgreSQL again. This can be done using the following commands:$gmake clean$gmake uninstall$gmake$gmake installIf you haven’t modified any header files since you last compiled the code, you may avoid the gmake clean command. Also, you do not need to create the database again each time you recompile and reinstall PostgreSQL .数据库系统技术作业代写3.1 Tips on how to deal with such codeDonot delete any old LRU code in the  It is much easier to just comment it out and add a marker (for instance, BEGIN OLDCODE) at the beginning of the commented section.Similarly, you may want to clearly delimit the new code you write in the file, to keep track of your changes. Such marking should help even if you are using a CVS.You may have to declare global variables to make your code work. Although this isn not the best programmingpractice, it makes life much simpler with such legacy  Be sure to use the C modifier static to limit the scope of your global variables to a single C file.To debug your code, you could eitheruse*fprint(stderr, ), or*gdb.You have to comment your code. In the event that your assignment is not completely correct, commentedcode is the only way we can understand your code, and give you partial  Also, your own code should be clearly demaracted with BEGIN NEWCODE and END NEWCODE comments. 数据库系统技术作业代写3.1.1 Tips on using gdbTo use gdb, you have to configure and compile PostgreSQL with debugging enabled, as below:./configure --prefix=PREFIX --enable-debug --enable-dependThis creates much bigger compiled binaries, though. For this assignment, you will probably not need to resort to gdb.If you do decide to use gdb, you should run it as below:$gdb postgres(gdb) run -B 20 -D ~/data/ -d 1 -s mydatabase ScanQueries.sql4 Evaluation of the performance 数据库系统技术作业代写Finally, you will now compare the performance of the LRU, LFU, and MRU replacement policies. To accomplish this, you will have to run the queries (from your query files) with varying buffer cache sizes (as discussed in Section 2.3). The PostgreSQL binary should report buffer hit rates for each query in the query files.  For  each run, you should take the average over all queries in a file.You should produce 2 graphs, as described below:Thefirst graph contains the buffer hit rates for all three algorithms, applied to the queries on

所有的编程代写范围:essayghost为美国、加拿大、英国、澳洲的留学生提供C语言代写、代写C语言、C语言代做、代做C语言、数据库代写、代写数据库、数据库代做、代做数据库、Web作业代写、代写Web作业、Web作业代做、代做Web作业、Java代写、代写Java、Java代做、代做Java、Python代写、代写Python、Python代做、代做Python、C/C++代写、代写C/C++、C/C++代做、代做C/C++、数据结构代写、代写数据结构、数据结构代做、代做数据结构等留学生编程作业代写服务。