久久久久久精品无码人妻_青春草无码精品视频在线观_无码精品国产VA在线观看_国产色无码专区在线观看

代做COMP3211、Python/Java程序代寫

時間:2024-04-26  來源:  作者: 我要糾錯



Coursework Specification
Late submissions will be penalised at 10% per working day.
No work can be accepted after feedback has been given.
You should expect to spend up to 37.5 hours on this assignment.
Please note the University regulations regarding academic integrity.
Module: COMP3211 Advanced Databases
Assignment: Database Programming Exercise Weighting: 25 %
Deadline: 16:00 Wed 8 May 2024 Feedback: Fri 17 May 2024
Instructions
In this assignment, you will build a query optimiser for SJDB, a simple RDBMS. Your optimiser should accept a
canonical query plan (a project over a series of selects over a cartesian product over the input named
relations) and aim to construct a left-deep query plan which minimises the sizes of any intermediate relations.
Part 1: Estimator.java
Before implementing an optimiser for query plans, you must first estimate the cost of the query plans.
In the first phase, you must create a class Estimator that implements the PlanVisitor interface and performs
a depth-first traversal of the query plan. On each operator, the Estimator should create an instance of Relation
(bearing appropriate Attribute instances and tuple counts) and attach to the operator as its output.
Some operators may require you to revise the value counts for the attributes on the newly created output
relations (for example, a select of the form attr=val will change the number of distinct values for that
attribute to 1). Note also that an attribute on a relation may not have more distinct values than there are
tuples in the relation.
Page 5 of this coursework specification lists the formulae that you should use to calculate the sizes of the
output relations, and to revise the attribute value counts. The supplied distribution of SJDB includes a
skeleton for Estimator, including an implementation of the visit(Scan) method.
Part 2: Optimiser.java
Once you have an estimator, you must create a class Optimiser that will take a canonical query plan as input,
and produce an optimised query plan as output. The optimised plan should not share any operators with the
canonical query plan; all operators should be created afresh.
In order to demonstrate your optimiser, you should be able to show your cost estimation and query
optimisation classes in action on a variety of inputs. The SJDB zip file contains a sample catalogue and
queries. In addition, the SJDB class (see page 3) contains a main() method with sample code for reading a
serialised catalogue from file and a query from stdin.
Part 3: Report
In addition to your estimator and optimiser, you should produce a short (maximum 500 word) report that
describes the optimisation strategy that you’ve adopted.
Note
You should not need to modify any of the provided classes or interfaces as part of your submission (aside
from Estimator), but if you think that you have a justifiable reason for doing so, please contact Nick for
permission first.
2
Submission
Please submit your files (Estimator.java, Optimiser.java and report.pdf) using the electronic hand-in system
(http://handin.ecs.soton.ac.uk/) by 4pm on the due date.
Late submissions will be penalised at 10% per working day and no work can be accepted after feedback has
been given.
You should expect to spend up to 37.5 hours on this assignment, and you should note the University
regulations regarding academic integrity:
http://www.calendar.soton.ac.uk/sectionIV/academic-integrity-statement.html
Relevant Learning Outcomes
1. The internals of a database management system
2. The issues involved in developing database management software
3. Demonstrate how a DBMS processes, optimises and executes a query
4. Implement components of a DBMS
Marking Scheme
Criterion Description Outcomes Total
Cost Estimator Implementation of the cost estimator 1,2,3,4 40 %
Optimiser Implementation of the query optimiser 1,2,3,4 40 %
Report Description of your query optimisation strategy 1,2,3 20 %
Note that partial credit will be given for incomplete solutions; for example, an optimiser that moves some
(but not all) selections down the query plan will still receive part of the total mark for the optimiser
component.
3
SJDB – A Simple Java Database
SJDB supports a limited subset of the relational algebra, consisting of the following operators only:
• cartesian product
• select with a predicate of the form attr=val or attr=attr
• project
• equijoin with a predicate of the form attr=attr
• scan (an operator that reads a named relation as a source for a query plan)
In addition, all attributes on all relations will be strings; there are no other datatypes available. Attributes also
have globally unique names (there may not be two attributes of the same name on different relations), and
self-joins on relations are not permitted.
The sjdb package contains the following classes and interfaces:
Relation an unnamed relation, contains attributes
NamedRelation a named relation
Attribute an attribute on a relation
Predicate a predicate for use with a join or select operator
Operator abstract superclass for all operators
UnaryOperator abstract superclass for all operators with a single child
Scan an operator that feeds a named relation into a query plan
Select an operator that selects certain tuples in its input, via some predicate
Project an operator that projects certain attributes from its input
BinaryOperator abstract superclass for all operator with two children
Product an operator that performs a cartesian product over its inputs
Join an operator that joins its inputs, via some predicate
Catalogue a directory and factory for named relations and their attributes
CatalogueException a failure to retrieve relations or attributes from the catalogue
CatalogueParser a utility class that reads a serialised catalogue from file
QueryParser a utility class that reads a query and builds a canonical query plan
PlanVisitor an interface that when implemented performs a depth-first plan traversal
Inspector a utility class that traverses an annotated plan and prints out the estimates
SJDB class containing main()
Test an example of the test harnesses used for marking
The SJDB class contains a main() method with skeleton code for reading catalogues and queries.
The system provides basic statistical information about the relations and attributes in the database, as below.
These are stored on the relations and attributes themselves, and not in the catalogue.
• the number of tuples in each relation
• the value count (number of distinct values) for each attribute
A sample serialised catalogue (cat.txt) and queries (q1.txt, etc) are available in sjdb/data.
4
Test Harness Notes
The file Test.java in the SJDB distribution contains an example of the test harness that I will be using to mark
your submissions. This example test harness manually constructs both plans and catalogues as follows:
package sjdb;
import java.io.*;
import java.util.ArrayList;
import sjdb.DatabaseException;
public class Test {
private Catalogue catalogue;
public Test() {
}
public static void main(String[] args) throws Exception {
Catalogue catalogue = createCatalogue();
Inspector inspector = new Inspector();
Estimator estimator = new Estimator();
Operator plan = query(catalogue);
plan.accept(estimator);
plan.accept(inspector);
Optimiser optimiser = new Optimiser(catalogue);
Operator planopt = optimiser.optimise(plan);
planopt.accept(estimator);
planopt.accept(inspector);
}
public static Catalogue createCatalogue() {
Catalogue cat = new Catalogue();
cat.createRelation("A", 100);
cat.createAttribute("A", "a1", 100);
cat.createAttribute("A", "a2", 15);
cat.createRelation("B", 150);
cat.createAttribute("B", "b1", 150);
cat.createAttribute("B", "b2", 100);
cat.createAttribute("B", "b3", 5);
return cat;
}
public static Operator query(Catalogue cat) throws Exception {
Scan a = new Scan(cat.getRelation("A"));
Scan b = new Scan(cat.getRelation("B"));
Product p1 = new Product(a, b);
Select s1 = new Select(p1, new Predicate(new Attribute("a2"), new Attribute("b3")));
ArrayList<Attribute> atts = new ArrayList<Attribute>();
atts.add(new Attribute("a2"));
atts.add(new Attribute("b1"));
Project plan = new Project(s1, atts);
return plan;
}
}
As can be seen in this test harness, I use the Inspector class (provided with the SJDB sources) to print out a
human-readable version of your query plans – your query plans must be able to accept this visitor without
throwing exceptions. Your estimator and optimiser need not (and should not) produce any data on stdout
(you should use the Inspector for this when testing).
Note also that you should manually construct plans that contain joins in order to test your Estimators.
Estimators and Optimisers that do not run without errors will be marked by inspection only, and will
consequently receive a reduced mark.
5
Cost Estimation
As described in lectures, the following parameters are used to estimate the size of intermediate relations:
• T(R), the number of tuples of relation R
• V(R,A), the value count for attribute A of relation R (the number of distinct values of A)
Note that, for any relation R, V(R, A) ≤ T(R) for all attributes A on R.
Scan
T(R) (the same number of tuples as in the NamedRelation being scanned)
Product
T(R × S) = T(R)T(S)
Projection
T(πA(R)) = T(R) (assume that projection does not eliminate duplicate tuples)
Selection
For predicates of the form attr=val:
T(σA=c(R)) = T(R)/V(R,A), V(σA=c(R),A) = 1
For predicates of the form attr=attr:
T(σA=B(R)) = T(R)/max(V(R,A),V(R,B)), V(σA=B(R),A) = V(σA=B(R),B) = min(V(R,A), V(R,B)
Join
T(R⨝A=BS) = T(R)T(S)/max(V(R,A),V(S,B)), V(R⨝A=BS,A) = V(R⨝A=BS,B) = min(V(R,A), V(S,B))
(assume that A is an attribute of R and B is an attribute of S)
Note that, for an attribute C of R that is not a join attribute, V(R⨝A=BS,C) = V(R,C)
(similarly for an attribute of S that is not a join attribute)
Further Reading
For further information on cost estimation, see §16.4 of Database Systems: The Complete Book

請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp
















 

標簽:

掃一掃在手機打開當前頁
  • 上一篇:CS 161代做、Java/Python程序代寫
  • 下一篇:CAN202代寫、代做MATLAB編程設計
  • 無相關信息
    昆明生活資訊

    昆明圖文信息
    蝴蝶泉(4A)-大理旅游
    蝴蝶泉(4A)-大理旅游
    油炸竹蟲
    油炸竹蟲
    酸筍煮魚(雞)
    酸筍煮魚(雞)
    竹筒飯
    竹筒飯
    香茅草烤魚
    香茅草烤魚
    檸檬烤魚
    檸檬烤魚
    昆明西山國家級風景名勝區
    昆明西山國家級風景名勝區
    昆明旅游索道攻略
    昆明旅游索道攻略
  • 短信驗證碼平臺 理財 WPS下載

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 kmw.cc Inc. All Rights Reserved. 昆明網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    久久久久久精品无码人妻_青春草无码精品视频在线观_无码精品国产VA在线观看_国产色无码专区在线观看

    天天影视色综合| av动漫在线看| 国产黄色一级网站| 亚洲一区二区图片| 国产成人无码av在线播放dvd| 五月天色婷婷综合| 9久久婷婷国产综合精品性色 | 国产 国语对白 露脸| 国产成人手机视频| 青青青免费在线| a级网站在线观看| 在线观看的毛片| 动漫av网站免费观看| 男人天堂成人网| 国内外成人免费在线视频| 国产资源在线视频| 成人小视频在线观看免费| 国产探花在线观看视频| 午夜精品在线免费观看| 日本精品免费在线观看| www.xxx麻豆| 干日本少妇视频| 色婷婷综合在线观看| 污色网站在线观看| 男人女人黄一级| 欧美私人情侣网站| 亚洲 高清 成人 动漫| 欧美视频在线第一页| 一级日本黄色片| 99久久99精品| 日韩成人精品视频在线观看| 高清一区在线观看| 国产福利影院在线观看| 国产精品69页| 国产a级片免费观看| 欧美亚洲国产成人| a在线视频观看| 国产成人在线免费看| 国产极品在线视频| 日韩免费一级视频| 97国产精东麻豆人妻电影| 国产69精品久久久久久久| 国产黄色片免费在线观看| 亚洲色成人www永久在线观看| 成人国产一区二区三区| 日韩欧美猛交xxxxx无码| 欧美少妇在线观看| 国产在线xxxx| 日本a视频在线观看| 精品国产一二三四区| 国产免费毛卡片| 美女福利视频在线| 欧美 日韩 国产 激情| 香港日本韩国三级网站| 亚洲天堂国产视频| 午夜探花在线观看| 高清无码一区二区在线观看吞精| 国产制服91一区二区三区制服| www.激情网| 国产成人无码a区在线观看视频| 成人免费观看视频在线观看| 日本www高清视频| 奇米影视四色在线| 一级网站在线观看| 国内少妇毛片视频| 国产亚洲综合视频| 亚洲国产精品三区| 艳母动漫在线免费观看| 欧美大黑帍在线播放| 一本大道熟女人妻中文字幕在线| 亚洲精品一二三四五区| 99精品视频国产| 青春草国产视频| 欧美精品成人网| 日韩 国产 一区| 成人一级生活片| 亚洲狼人综合干| 天堂v在线视频| 免费看又黄又无码的网站| 手机看片福利日韩| 亚洲小视频在线播放| 国产超级av在线| 三级性生活视频| 无码中文字幕色专区| 在线观看av网页| 97久久国产亚洲精品超碰热| 欧美视频免费播放| 丰满女人性猛交| 97xxxxx| www.51色.com| 乱妇乱女熟妇熟女网站| 亚洲免费黄色网| 日韩xxxx视频| 久久久久久久久久久久久久久国产| 免费网站永久免费观看| 青青草精品视频在线观看| 国产内射老熟女aaaa| 日韩中文字幕二区| 国产一二三四区在线观看| 人妻无码视频一区二区三区| 搡的我好爽在线观看免费视频| 免费一级特黄特色毛片久久看| 91亚洲精品久久久蜜桃借种| 欧美激情视频免费看| 亚洲免费成人在线视频| 国产97在线 | 亚洲| 国产盗摄视频在线观看| 国产裸体免费无遮挡| 黄网站色视频免费观看| 欧美日韩中文不卡| 欧美深夜福利视频| 五月天婷婷影视| 欧美在线观看视频网站| 欧美亚洲黄色片| 特黄特黄一级片| 激情五月俺来也| 成人观看免费完整观看| 欧美日韩中文字幕在线播放| 亚洲天堂2018av| 成年人视频网站免费观看| 99亚洲国产精品| 中文字幕亚洲影院| 天天影视综合色| www国产黄色| 丁香六月激情婷婷| 午夜探花在线观看| 不用播放器的免费av| www.欧美日本| 99爱视频在线| 日本丰满少妇xxxx| 美女av免费观看| 91 视频免费观看| 久久撸在线视频| 日本999视频| 日韩手机在线观看视频| 欧美 国产 综合| 在线免费黄色小视频| 亚洲少妇第一页| 欧美牲交a欧美牲交aⅴ免费下载| 成年人网站国产| 人妻激情另类乱人伦人妻| 国产真人无码作爱视频免费| 久久国产精品网| 中文字幕在线中文| 欧美一级免费在线| 国内国产精品天干天干| 一级片视频免费观看| wwwxxx黄色片| 日韩a在线播放| 日韩一级免费看| 91视频成人免费| 色18美女社区| 亚洲天堂av一区二区| 亚洲视频一二三四| 九九九九九伊人| 91在线第一页| 午夜在线视频免费观看| www.-级毛片线天内射视视| 国产成人强伦免费视频网站| 香蕉视频xxx| 干日本少妇视频| 久青草视频在线播放| 日本手机在线视频| 日本www在线播放| 久久久久久久久久福利| 天天插天天操天天射| 亚洲美女爱爱视频| 中文字幕55页| 免费日韩在线观看| 男人日女人视频网站| 男女av免费观看| 亚洲一二三区av| 夜夜夜夜夜夜操| 在线观看18视频网站| 无码av天堂一区二区三区| www黄色日本| 国产理论在线播放| 色香蕉在线观看| 91午夜在线观看| 乱子伦视频在线看| 亚洲一级免费观看| 日本特级黄色大片| 91免费黄视频| 国产裸体免费无遮挡| 天天操夜夜操很很操| 国产va亚洲va在线va| 日韩精品无码一区二区三区免费| 亚洲久久中文字幕| 成人在线免费高清视频| 国产一区二区在线视频播放| 超碰在线播放91| 日本a级片在线观看| 69堂免费视频| 亚洲黄色av片| www.好吊操| 美女网站色免费| 男人添女人下部视频免费| 精品免费国产一区二区| 一级日本黄色片| 亚洲熟女乱色一区二区三区 |