Κεφάλαιο 13. Επεξεργασία και Εκτέλεση Ερωτήσεων σε Σχεσιακές Βάσεις εδοµένων. Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.1
|
|
- Ανδώνης Βασιλείου
- 8 χρόνια πριν
- Προβολές:
Transcript
1 Κεφάλαιο 13 Επεξεργασία και Εκτέλεση Ερωτήσεων σε Σχεσιακές Βάσεις εδοµένων Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.1
2 Επεξεργασία και Βελτιστοποίηση Επερωτήσεων Αρχιτεκτονική του ΕΠΕΞΕΡΓΑΣΤΗ ΕΠΕΡΩΤΗΣΕΩΝ σε ένα DBMS ΕπεξεργασίαΕπερωτήσεων (Query Processing) ΥλοποίησηΣχεσιακώνΠράξεων (συνένωση, sεπιλογή, προβολή, συναθροίσεις, κλπ.) Χρήση Ευρετηρίων Ενδιάµεση Μνήµη Βελτιστοποίηση Επερωτήσεων (Query Optimization) Σχέδια Εκτέλεσης (plans) Εµφωλιασµός Επερωτήσεων Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.2
3 Αρχιτεκτονική του QUERY PROCESSOR TERMINAL MONITOR Query Language QUERY LANGUAGE COMPILER Internal Form (e.g., Relational Algebra) QUERY OPTIMIZER Internal Form (e.g., Relational Algebra) CODE GENERATOR / INTERPRETER Record-at-a-time calls embedded in a program ACCESS METHOD Page-at-a-time access to files FILE SYSTEM Select e.name from empl e, dept d where e.dno = d.dno and d.floor=3 σ floor=3 >< Π Name ( (e d) Π Name ( e >< ( σ floor=3 d) (plans) manipulate records manipulate pages Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.3
4 Βασικά Στάδια στο Query Processing Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.4
5 Query Processing σεένα DBMS Ο Query Language Parser / Compilerµεταφράζειτηνεπερώτηση σε µια εσωτερική µορφή, συχνά σε µια έκφραση σχεσιακής άλγεβρας ή σε µορφή δένδρου / γράφου (αφού κάνει λεκτική και συντακτική ανάλυση καθώς και έλεγχο εγκυρότητας) Ο Query Optimizer εξετάζει όλες τις ισοδύναµες αλγεβρικές παραστάσεις (σχέδια εκτέλεσης - plans) και επιλέγει το καλύτερο / λιγότερο δαπανηρό Χρησιµοποιεί στοιχεία όπως το µέγεθος, τη χρήση και τα περιεχόµενα των σχέσεων (που αποθηκεύονται σε καταλόγους και ανανεώνονται δυναµικά) Χρησιµοποιεί τη γνώση για το Κόστος Εκτέλεσης των σχεσιακών πράξεων (π.χ., πως υλοποιούνται οι συνενώσεις, κλπ.) Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.5
6 Query Processing σεένα DBMS -- (β) Ο Code Generator (Γεννήτορας Κώδικα) υλοποιεί το σχέδιο εκτέλεσης που παράγεται από το Βελτιστοποιητή. Τουποσύστηµαεκτέλεσηςεπερωτήσεων (Access Methods) υποστηρίζει εντολές για πρόσβαση σε ένα αρχείο. Λειτουργίες των access method είναι:» Πως τοποθετούνται οι εγγραφές σε µια σελίδα» Πως τοποθετούνται τα πεδία σε µια εγγραφή» Data Compression» Ευρετήρια εγγραφών µέσω πεδίων Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.6
7 Query Processing σεένα DBMS -- (γ) Το File System υποστηρίζει την πρόσβαση σε σελίδες Λειτουργίες του File System είναι:» Πως το αρχείο διαµοιράζεται στο ίσκο» ιαχείριση ελεύθερου χώρου στο ίσκο» Εκτέλεση Hardware I/O εντολών» ιαχείριση Ενδιάµεσης Μνήµης Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.7
8 Μετρήσεις Κόστους Επερωτήσεων Γενικά, το ΚΟΣΤΟΣ µετριέται ως ο συνολικός χρόνος για την απάντηση µιας επερώτησης Παράγοντες που επηρεάζουν το χρονικό κόστος» Προσβάσεις στο δίσκο, CPU, επικοινωνία δικτύου Στην τυπική περίπτωση, οι ΠΡΟΣΒΑΣΕΙΣ ΣΤΟ ΙΣΚΟ είναι ο σηµαντικότερος παράγων, και είναι σχετικά εύκολο να υπολογιστούν. Λαµβάνονται υπόψη: Αριθµός Προσβάσεων * average-seek-cost Αριθµός των Μπλόκ που ιαβάζονται * average-block-read-cost Αριθµός των Μπλόκ που Γράφονται * average-block-write-cost» Το κόστος γραψίµατος ενός Μπλόκ είναι µεγαλύτερο από το κόστος διαβάσµατος ενός Μπλόκ ΓΙΑ ΑΠΛΟΥΣΤΕΥΣΗ χρησιµοποιούµε τον ΑΡΙΘΜΟ ΠΡΟΣΒΑΣΕΩΝ για τη µέτρηση Κόστους. Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.8
9 Relational Operations -- Implementation Θα περιγράψουµε πως υλοποιούνται: Selection ( ) Επιλογή υποσυνόλου πλειάδων από σχέση. Projection ( ) ιαγραφή στηλών που δεν είναι επιθυµητές. >< Join ( ) Μας επιτρέπει να συνδυάζουµε δύο σχέσεις. Set-difference ( ) Πλειάδες στη Σχέση 1, αλλά όχι στην 2. U σ π Union ( ) ΠλειάδεςστηΣχέση 1 καιστησχέση 2. Aggregation (SUM, MIN, κλπ.) και GROUP BY Καθώς κάθε πράξη έχει σαν αποτέλεσµα µια Σχέση, οι πράξεις µπορούν να συνδυαστούν! Αφού καλύψουµε τις απλές πράξεις, θα συζητήσουµε πως µπορεί να βελτιστοποιηθούν (optimize) επερωτήσεις που σχηµατίζονται µε συνδυασµό πράξεων. Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.9
10 Βάση εδοµένων για Παραδείγµατα Sailors (sid: integer, sname: string, rating: integer, age: real) Reserves (sid: integer, bid: integer, day: dates, rname: string) Όπως αυτή που ξέραµε; Το rname προστίθεται µόνο. Reserves: Κάθε tupleείναι 40 bytes σεµήκος, 100 tuples ανάσελίδα, 1000 σελίδες. Sailors: Κάθε tuple είναι 50 bytes, 80 tuples ανάσελίδα, 500 σελίδες. Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.10
11 Simple Selections σ R a ttr SELECT * FROM WHERE. ( R ) Reserves R R.rname < C% Of the form o p v a lu e Size of result approximated as size of R * reduction factor; we will consider how to estimate reduction factors later. With no index, unsorted: Must essentially scan the whole relation; cost is b r (#pages in R). With an index on selection attribute: Use index to find qualifying data entries, then retrieve corresponding data records. (Hash index useful only for equality selections.) Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.11
12 Selection Operation File scan search algorithms that locate and retrieve records that fulfill a selection condition. Algorithm A1 (linear search). Scan each file block and test all records to see whether they satisfy the selection condition. Cost estimate (number of disk blocks scanned) = b r» b r denotes number of blocks containing records from relation r If selection is on a key attribute, average cost = (b r /2)» stop on finding record Linear search can be applied regardless of» selection condition or» ordering of records in the file, or» availability of indices Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.12
13 Selection Operation (Cont.) A2 (binary search). Applicable if selection is an equality comparison on the attribute on which file is ordered. Assume that the blocks of a relation are stored contiguously Cost estimate (number of disk blocks to be scanned):» log 2 (b r ) cost of locating the first tuple by a binary search on the blocks» Plus number of blocks containing records that satisfy selection condition Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.13
14 Selections Using Indices Index scan search algorithms that use an index selection condition must be on search-key of index. A3 (primary index on candidate key, equality). Retrieve a single record that satisfies the corresponding equality condition Cost = HT i + 1 (ύψοςτουβ+ δέντρου + 1 ανάκληση) A4 (primary index on nonkey, equality) Retrieve multiple records. Records will be on consecutive blocks Cost = HT i + number of blocks containing retrieved records A5 (equality on search-key of secondary index). Retrieve a single record if the search-key is a candidate key» Cost = HT i + 1 Retrieve multiple records if search-key is not a candidate key» Cost = HT i + number of records retrieved Can be very expensive!» each record may be on a different block one block access for each retrieved record Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.14
15 Selections Involving Comparisons Can implement selections of the form σ A V (r) or σ A V (r) by using a linear file scan or binary search, or by using indices in the following ways: A6 (primary index, comparison). (Relation is sorted on A)» For σ A V (r) use index to find first tuple v and scan relation sequentially from there» For σ A V (r) just scan relation sequentially till first tuple > v; do not use index A7 (secondary index, comparison).» For σ A V (r) use index to find first index entry v and scan index sequentially from there, to find pointers to records.» For σ A V (r) just scan leaf pages of index finding pointers to records, till first entry > v» In either case, retrieve records that are pointed to requires an I/O for each record Linear file scan may be cheaper if many records are to be fetched! Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.15
16 Implementation of of Complex Selections Conjunction: σ θ 1 θ 2... θ n(r) A8 (conjunctive selection using one index). Select a combination of θ i and algorithms A1 through A7 that results in the least cost for σ θi (r). Test other conditions on tuple after fetching it into memory buffer. A9 (conjunctive selection using multiple-key index). Use appropriate composite (multiple-key) index if available. A10 (conjunctive selection by intersection of identifiers). Requires indices with record pointers. Use corresponding index for each condition, and take intersection of all the obtained sets of record pointers. Then fetch records from file If some conditions do not have appropriate indices, apply test in memory. Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.16
17 Algorithms for Complex Selections Disjunction:σ θ 1 θ 2... θ n(r). A11 (disjunctive selection by union of identifiers). Applicable if all conditions have available indices.» Otherwise use linear scan. Use corresponding index for each condition, and take union of all the obtained sets of record pointers. Then fetch records from file Negation: σ θ (r) Use linear scan on file If very few records satisfy θ, and an index is applicable to θ» Find satisfying records using index and fetch from file Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.17
18 Sorting We may build an index on the relation, and then use the index to read the relation in sorted order. May lead to one disk block access for each tuple. For relations that fit in memory, techniques like quicksort can be used. For relations that don t fit in memory, external sort-merge is a good choice. Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.18
19 External Sort-Merge Let M denote memory size (in pages). 1. Create sorted runs. Let i be 0 initially. Repeatedly do the following till the end of the relation: (a) Read M blocks of relation into memory (b) Sort the in-memory blocks (c) Write sorted data to run R i ; increment i. Let the final value of I be N 2. Merge the runs (N-way merge). We assume (for now) that N < M. 1. Use N blocks of memory to buffer input runs, and 1 block to buffer output. Read the first block of each run into its buffer page 2. repeat 1. Select the first record (in sort order) among all buffer pages 2. Write the record to the output buffer. If the output buffer is full write it to disk. 3. Delete the record from its input buffer page. If the buffer page becomes empty then read the next block (if any) of the run into the buffer. 3. until all input buffer pages are empty: Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.19
20 External Sort-Merge (Cont.) If i M, several merge passes are required. In each pass, contiguous groups of M - 1 runs are merged. A pass reduces the number of runs by a factor of M -1, and creates runs longer by the same factor.» E.g. If M=11, and there are 90 runs, one pass reduces the number of runs to 9, each 10 times the size of the initial runs Repeated passes are performed till all runs have been merged into one. Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.20
21 Example: External Sorting Using Sort-Merge Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.21
22 External Merge Sort (Cont.) Cost analysis: Total number of merge passes required: log M 1 (b r /M). Disk accesses for initial run creation as well as in each pass is 2b r» for final pass, we don t count write cost we ignore final write cost for all operations since the output of an operation may be sent to the parent operation without being written to disk Thus total number of disk accesses for external sorting: b r ( 2 log M 1 (b r / M) + 1) Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.22
23 Equality Joins µε ένα γνώρισµα συνένωσης SELECT * FROM Reserves R1, Sailors S1 WHERE R1.sid=S1.sid >< Στην άλγεβρα: R S. Πολύ συχνό! Θέλει Προσοχή γιατί το R S είναιµεγάλο,άρα, R S ακολουθούµενοαπόµια επιλογή είναι πολύ αργό Έστω: M pages στην R, p R tuples per page, N pages στην S, p S tuples per page. Στοπαράδειγµα, το R είναι Reserves καιτο S είναι Sailors. Cost metric: # of I/Os. εν µας ενδιαφέρει το κόστος για παρουσίαση του αποτελέσµατος (output). Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.23
24 Simple Nested Loop Join foreach tuple r in R do foreach tuple s in S do if r i == s j then add <r, s> to result For each tuple in the outer relation R, we scan the entire inner relation S. Cost: M + p R * M * N = *1000*500 I/Os. Page-oriented Nested Loops join: For each page of R, get each page of S, and write out matching pairs of tuples <r, s>, where r is in R-page and S is in S-page. Cost: M + M*N = *500 If smaller relation (S) is outer, cost = *1000 Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.24
25 Index Nested Loops Join foreach tuple r in R do foreach tuple s in S where r i == s j do add <r, s> to result Index lookups can replace file scans if join is an equi-join or natural join and an index is available on the inner relation s join attribute» Can construct an index just to compute a join. If there is an index on the join column of one relation (say S), can make it the inner and exploit the index. Cost: M + ( (M*p R ) * cost of finding matching S tuples) For each R tuple, cost of probing S index is about 1.2 for hash index, 2-4 for B+ tree. Cost of then finding S tuples depends on clustering. Clustered index: 1 I/O (typical), un clustered: up to 1 I/O per matching S tuple. Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.25
26 Examples of Index Nested Loops Hash-index on sid of Sailors (as inner): Scan Reserves: 1000 page I/Os, 100*1000 tuples. For each Reserves tuple: 1.2 I/Os to get data entry in index, plus 1 I/O to get (the exactly one) matching Sailors tuple. Total: 220,000 I/Os. Hash-index on sid of Reserves (as inner): Scan Sailors: 500 page I/Os, 80*500 tuples. For each Sailors tuple: 1.2 I/Os to find index page with data entries, plus cost of retrieving matching Reserves tuples. Assuming uniform distribution, 2.5 reservations per sailor (100,000 / 40,000). Cost of retrieving them is 1 or 2.5 I/Os depending on whether the index is clustered. Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.26
27 Block Nested Loops Join Use one page as an input buffer for scanning the inner S, one page as the output buffer, and use all remaining pages to hold ``block of outer R. For each matching tuple r in R-block, s in S-page, add <r, s> to result. Then read next R-block, scan S, etc. R & S... Hash table for block of R (k < B-1 pages)... Join Result... Input buffer for S Output buffer Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.27
28 Examples of Block Nested Loops Cost: Scan of outer + #outer blocks * scan of inner #outer blocks = With Reserves (R) as outer, and 100 pages of R: Cost of scanning R is 1000 I/Os; a total of 10 blocks. Per block of R, we scan Sailors (S); 10*500 I/Os. If space for just 90 pages of R, we would scan S 12 times. With 100-page block of Sailors as outer: # of pages of outer / Cost of scanning S is 500 I/Os; a total of 5 blocks. Per block of S, we scan Reserves; 5*1000 I/Os. blocksize With sequential reads considered, analysis changes: may be best to divide buffers evenly between R and S. Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.28
29 Sort-Merge Join (R S) Sort R and S on the join column, then scan them to do a ``merge (on join col.), and output result tuples. Advance scan of R until current R-tuple >= current S tuple, then advance scan of S until current S-tuple >= current R tuple; do this until current R tuple = current S tuple. At this point, all R tuples with same value in Ri (current R group) and all S tuples with same value in Sj (current S group) match; output <r, s> for all pairs of such tuples. Then resume scanning R and S. >< R is scanned once; each S group is scanned once per matching R tuple. (Multiple scans of an S group are likely to find needed pages in buffer.) i=j Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.29
30 Example of Sort-Merge Join sid sname rating age 22 dustin yuppy lubber guppy rusty sid bid day rname /4/96 guppy /3/96 yuppy /10/96 dustin /12/96 lubber /11/96 lubber /12/96 dustin Cost: M log M + N log N + (M+N) The cost of scanning, M+N, could be M*N (very unlikely!) With 35, 100 or 300 buffer pages, both Reserves and Sailors can be sorted in 2 passes; total join cost: (BNL cost: 2500 to I/Os) Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.30
31 Refinement of Sort-Merge Join We can combine the merging phases in the sorting of R and S with the merging required for the join. L With B >, where L is the size of the larger relation, using the sorting refinement that produces runs of length 2B in Pass 0, #runs of each relation is < B/2. Allocate 1 page per run of each relation, and `merge while checking the join condition. Cost: read+write each relation in Pass 0 + read each relation in (only) merging pass (+ writing of result tuples). In example, cost goes down from 7500 to 4500 I/Os. In practice, cost of sort-merge join, like the cost of external sorting, is linear. Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.31
32 Hash-Join Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.32
33 Hash-Join Partition both relations using hash fn h: R tuples in partition i will only match S tuples in partition i. Original Relation... OUTPUT 1 INPUT 2 hash function h B-1 Partitions 1 2 B-1 Disk B main memory buffers Disk Read in a partition of R, hash it using h2 (<> h!). Scan matching partition of S, search for matches. Partitions of R & S hash fn h2 Hash table for partition Ri (k < B-1 pages) h2 Join Result Disk Input buffer for Si Output buffer B main memory buffers Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.33 Disk
34 Observations on Hash-Join #partitions k < B-1, and B-2 > size of largest partition to be held in memory. Assuming uniformly sized partitions, and maximizing k, we get: k= B-1, and M/(B-1) < B-2, i.e., B must be > If we build an in-memory hash table to speed up the matching of tuples, a little more memory is needed. If the hash function does not partition uniformly, one or more R partitions may not fit in memory. Can apply hash-join technique recursively to do the join of this R-partition with corresponding S-partition. M Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.34
35 Cost of Hash-Join In partitioning phase, read+write both relations; 2(M+N). In matching phase, read both relations; M+N I/Os. In our running example, this is a total of 4500 I/Os. Sort-Merge Join vs. Hash Join: Given a minimum amount of memory (what is this, for each?) both have a cost of 3(M+N) I/Os. Hash Join superior on this count if relation sizes differ greatly. Also, Hash Join shown to be highly parallelizable. Sort-Merge less sensitive to data skew; result is sorted. Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.35
36 General Join Conditions Equalities over several attributes (e.g., R.sid=S.sid AND R.rname=S.sname): For Index NL, build index on <sid, sname> (if S is inner); or use existing indexes on sid or sname. For Sort-Merge and Hash Join, sort/partition on combination of the two join columns. Inequality conditions (e.g., R.rname < S.sname): For Index NL, need (clustered!) B+ tree index.» Range probes on inner; # matches likely to be much higher than for equality joins. Hash Join, Sort Merge Join not applicable. Block NL quite likely to be the best join method here. Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.36
37 Set Operations Intersection and cross-product special cases of join. Union (Distinct) and Except similar; we ll do union. Sorting based approach to union: Sort both relations (on combination of all attributes). Scan sorted relations and merge them. Alternative: Merge runs from Pass 0 for both relations. Hash based approach to union: Partition R and S using hash function h. For each S-partition, build in-memory hash table (using h2), scan corresponding R-partition and add tuples to table while discarding duplicates. Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.37
38 Aggregate Operations (AVG, MIN, etc.) Without grouping: In general, requires scanning the relation. Given index whose search key includes all attributes in the SELECT or WHERE clauses, can do index-only scan. With grouping: Sort on group-by attributes, then scan relation and compute aggregate for each group. (Can improve upon this by combining sorting and aggregate computation.) Given tree index whose search key includes all attributes in SELECT, WHERE and GROUP BY clauses, can do index-only scan; if group-by attributes form prefix of search key, can retrieve data entries/tuples in group-by order. Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.38
39 Impact of Buffering If several operations are executing concurrently, estimating the number of available buffer pages is guesswork. Repeated access patterns interact with buffer replacement policy. e.g., Inner relation is scanned repeatedly in Simple Nested Loop Join. With enough buffer pages to hold inner, replacement policy does not matter. Otherwise, MRU is best, LRU is worst (sequential flooding). Does replacement policy matter for Block Nested Loops? What about Index Nested Loops? Sort-Merge Join? Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.39
40 Summary for Relational Operators Implementation A virtue of relational DBMSs: queries are composed of a few basic operators; the implementation of these operators can be carefully tuned (and it is important to do this!). Many alternative implementation techniques for each operator; no universally superior technique for most operators. Must consider available alternatives for each operation in a query and choose best one based on system statistics, etc. This is part of the broader task of optimizing a query composed of several ops. Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.40
41 Evaluation of of Expressions So far: we have seen algorithms for individual operations Alternatives for evaluating an entire expression tree Materialization: generate results of an expression whose inputs are relations or are already computed, materialize (store) it on disk. Repeat. Pipelining: pass on tuples to parent operations even as an operation is being executed We study above alternatives in more detail Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.41
42 Materialization Materialized evaluation: evaluate one operation at a time, starting at the lowest-level. Use intermediate results materialized into temporary relations to evaluate next-level operations. E.g., in figure below, compute and store σ balance < 2500 ( account then compute the store its join with customer, and finally compute the projections on customer-name. ) Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.42
43 Materialization (Cont.) Materialized evaluation is always applicable Cost of writing results to disk and reading them back can be quite high Our cost formulas for operations ignore cost of writing results to disk, so» Overall cost = Sum of costs of individual operations + cost of writing intermediate results to disk Double buffering: use two output buffers for each operation, when one is full write it to disk while the other is getting filled Allows overlap of disk writes with computation and reduces execution time Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.43
44 Pipelining Pipelined evaluation : evaluate several operations simultaneously, passing the results of one operation on to the next. E.g., in previous expression tree, don t store result of σ balance <2500 ( account ) instead, pass tuples directly to the join.. Similarly, don t store result of join, pass tuples directly to projection. Much cheaper than materialization: no need to store a temporary relation to disk. Pipelining may not always be possible e.g., sort, hash-join. For pipelining to be effective, use evaluation algorithms that generate output tuples even as tuples are received for inputs to the operation. Pipelines can be executed in two ways: demand driven and producer driven Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.44
45 Pipelining (Cont.) In demand driven or lazy evaluation system repeatedly requests next tuple from top level operation Each operation requests next tuple from children operations as required, in order to output its next tuple In between calls, operation has to maintain state so it knows what to return next Each operation is implemented as an iterator implementing the following operations» open()» next()» close() E.g. file scan: initialize file scan, store pointer to beginning of file as state E.g.merge join: sort relations and store pointers to beginning of sorted relations as state E.g. for file scan: Output next tuple, and advance and store file pointer E.g. for merge join: continue with merge from earlier state till next output tuple is found. Save pointers as iterator state. Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.45
46 Pipelining (Cont.) In produce-driven or eager pipelining Operators produce tuples eagerly and pass them up to their parents» Buffer maintained between operators, child puts tuples in buffer, parent removes tuples from buffer» if buffer is full, child waits till there is space in the buffer, and then generates more tuples System schedules operations that have space in output buffer and can process more input tuples Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.46
47 Evaluation Algorithms for Pipelining Some algorithms are not able to output results even as they get input tuples E.g. merge join, or hash join These result in intermediate results being written to disk and then read back always Algorithm variants are possible to generate (at least some) results on the fly, as input tuples are read in E.g. hybrid hash join generates output tuples even as probe relation tuples in the in-memory partition (partition 0) are read in Pipelined join technique: Hybrid hash join, modified to buffer partition 0 tuples of both relations in-memory, reading them as they become available, and output results of any matches between partition 0 tuples» When a new r 0 tuple is found, match it with existing s 0 tuples, output matches, and save it in r 0» Symmetrically for s 0 tuples Ι.Β -- Εκτέλεση Ερωτήσεων Σελίδα 4.47
Συστήματα Διαχείρισης Βάσεων Δεδομένων
ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ Συστήματα Διαχείρισης Βάσεων Δεδομένων Φροντιστήριο 5: Tutorial on External Sorting Δημήτρης Πλεξουσάκης Τμήμα Επιστήμης Υπολογιστών TUTORIAL ON EXTERNAL SORTING
Physical DB Design. B-Trees Index files can become quite large for large main files Indices on index files are possible.
B-Trees Index files can become quite large for large main files Indices on index files are possible 3 rd -level index 2 nd -level index 1 st -level index Main file 1 The 1 st -level index consists of pairs
Κεφάλαιο 9. Επεξεργασία και Βελτιστοποίηση Ερωτήσεων σε Σχεσιακές Βάσεις εδοµένων. Ι.Β -- Εκτέλεση Ερωτήσεων και Βελτιστοποίηση Σελίδα 4.
Κεφάλαιο 9 Επεξεργασία και Βελτιστοποίηση Ερωτήσεων σε Σχεσιακές Βάσεις εδοµένων Ι.Β -- Εκτέλεση Ερωτήσεων και Βελτιστοποίηση Σελίδα 4.40 Query Processing and Optimization Architecture of the Query Processor
HOMEWORK 4 = G. In order to plot the stress versus the stretch we define a normalized stretch:
HOMEWORK 4 Problem a For the fast loading case, we want to derive the relationship between P zz and λ z. We know that the nominal stress is expressed as: P zz = ψ λ z where λ z = λ λ z. Therefore, applying
Block Ciphers Modes. Ramki Thurimella
Block Ciphers Modes Ramki Thurimella Only Encryption I.e. messages could be modified Should not assume that nonsensical messages do no harm Always must be combined with authentication 2 Padding Must be
2 Composition. Invertible Mappings
Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan Composition. Invertible Mappings In this section we discuss two procedures for creating new mappings from old ones, namely,
ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 6/5/2006
Οδηγίες: Να απαντηθούν όλες οι ερωτήσεις. Ολοι οι αριθμοί που αναφέρονται σε όλα τα ερωτήματα είναι μικρότεροι το 1000 εκτός αν ορίζεται διαφορετικά στη διατύπωση του προβλήματος. Διάρκεια: 3,5 ώρες Καλή
The Simply Typed Lambda Calculus
Type Inference Instead of writing type annotations, can we use an algorithm to infer what the type annotations should be? That depends on the type system. For simple type systems the answer is yes, and
Instruction Execution Times
1 C Execution Times InThisAppendix... Introduction DL330 Execution Times DL330P Execution Times DL340 Execution Times C-2 Execution Times Introduction Data Registers This appendix contains several tables
EE512: Error Control Coding
EE512: Error Control Coding Solution for Assignment on Finite Fields February 16, 2007 1. (a) Addition and Multiplication tables for GF (5) and GF (7) are shown in Tables 1 and 2. + 0 1 2 3 4 0 0 1 2 3
Συστήματα Διαχείρισης Βάσεων Δεδομένων
ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ Συστήματα Διαχείρισης Βάσεων Δεδομένων Φροντιστήριο 9: Transactions - part 1 Δημήτρης Πλεξουσάκης Τμήμα Επιστήμης Υπολογιστών Tutorial on Undo, Redo and Undo/Redo
Concrete Mathematics Exercises from 30 September 2016
Concrete Mathematics Exercises from 30 September 2016 Silvio Capobianco Exercise 1.7 Let H(n) = J(n + 1) J(n). Equation (1.8) tells us that H(2n) = 2, and H(2n+1) = J(2n+2) J(2n+1) = (2J(n+1) 1) (2J(n)+1)
Lecture 2: Dirac notation and a review of linear algebra Read Sakurai chapter 1, Baym chatper 3
Lecture 2: Dirac notation and a review of linear algebra Read Sakurai chapter 1, Baym chatper 3 1 State vector space and the dual space Space of wavefunctions The space of wavefunctions is the set of all
Section 8.3 Trigonometric Equations
99 Section 8. Trigonometric Equations Objective 1: Solve Equations Involving One Trigonometric Function. In this section and the next, we will exple how to solving equations involving trigonometric functions.
Συστήματα Διαχείρισης Βάσεων Δεδομένων
ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ Συστήματα Διαχείρισης Βάσεων Δεδομένων Διάλεξη 5η: External sorting Δημήτρης Πλεξουσάκης Τμήμα Επιστήμης Υπολογιστών EXTERNAL SORTING 1 Sorting A classic problem
PARTIAL NOTES for 6.1 Trigonometric Identities
PARTIAL NOTES for 6.1 Trigonometric Identities tanθ = sinθ cosθ cotθ = cosθ sinθ BASIC IDENTITIES cscθ = 1 sinθ secθ = 1 cosθ cotθ = 1 tanθ PYTHAGOREAN IDENTITIES sin θ + cos θ =1 tan θ +1= sec θ 1 + cot
Phys460.nb Solution for the t-dependent Schrodinger s equation How did we find the solution? (not required)
Phys460.nb 81 ψ n (t) is still the (same) eigenstate of H But for tdependent H. The answer is NO. 5.5.5. Solution for the tdependent Schrodinger s equation If we assume that at time t 0, the electron starts
TMA4115 Matematikk 3
TMA4115 Matematikk 3 Andrew Stacey Norges Teknisk-Naturvitenskapelige Universitet Trondheim Spring 2010 Lecture 12: Mathematics Marvellous Matrices Andrew Stacey Norges Teknisk-Naturvitenskapelige Universitet
C.S. 430 Assignment 6, Sample Solutions
C.S. 430 Assignment 6, Sample Solutions Paul Liu November 15, 2007 Note that these are sample solutions only; in many cases there were many acceptable answers. 1 Reynolds Problem 10.1 1.1 Normal-order
CHAPTER 25 SOLVING EQUATIONS BY ITERATIVE METHODS
CHAPTER 5 SOLVING EQUATIONS BY ITERATIVE METHODS EXERCISE 104 Page 8 1. Find the positive root of the equation x + 3x 5 = 0, correct to 3 significant figures, using the method of bisection. Let f(x) =
Example Sheet 3 Solutions
Example Sheet 3 Solutions. i Regular Sturm-Liouville. ii Singular Sturm-Liouville mixed boundary conditions. iii Not Sturm-Liouville ODE is not in Sturm-Liouville form. iv Regular Sturm-Liouville note
Other Test Constructions: Likelihood Ratio & Bayes Tests
Other Test Constructions: Likelihood Ratio & Bayes Tests Side-Note: So far we have seen a few approaches for creating tests such as Neyman-Pearson Lemma ( most powerful tests of H 0 : θ = θ 0 vs H 1 :
Ευρετήρια. Βάσεις Δεδομένων. Διδάσκων: Μαρία Χαλκίδη
Ευρετήρια Βάσεις Δεδομένων Διδάσκων: Μαρία Χαλκίδη Βασικές έννοιες Οι μηχανισμοί δεικτοδότησης χρησιμοποιούνται για να επιταχύνουν την προσπέλαση σε επιθυμητά δεδομένα. π.χ., author catalog in library
ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 24/3/2007
Οδηγίες: Να απαντηθούν όλες οι ερωτήσεις. Όλοι οι αριθμοί που αναφέρονται σε όλα τα ερωτήματα μικρότεροι του 10000 εκτός αν ορίζεται διαφορετικά στη διατύπωση του προβλήματος. Αν κάπου κάνετε κάποιες υποθέσεις
ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 19/5/2007
Οδηγίες: Να απαντηθούν όλες οι ερωτήσεις. Αν κάπου κάνετε κάποιες υποθέσεις να αναφερθούν στη σχετική ερώτηση. Όλα τα αρχεία που αναφέρονται στα προβλήματα βρίσκονται στον ίδιο φάκελο με το εκτελέσιμο
Math 6 SL Probability Distributions Practice Test Mark Scheme
Math 6 SL Probability Distributions Practice Test Mark Scheme. (a) Note: Award A for vertical line to right of mean, A for shading to right of their vertical line. AA N (b) evidence of recognizing symmetry
ΚΥΠΡΙΑΚΟΣ ΣΥΝΔΕΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY 21 ος ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ Δεύτερος Γύρος - 30 Μαρτίου 2011
Διάρκεια Διαγωνισμού: 3 ώρες Απαντήστε όλες τις ερωτήσεις Μέγιστο Βάρος (20 Μονάδες) Δίνεται ένα σύνολο από N σφαιρίδια τα οποία δεν έχουν όλα το ίδιο βάρος μεταξύ τους και ένα κουτί που αντέχει μέχρι
Section 9.2 Polar Equations and Graphs
180 Section 9. Polar Equations and Graphs In this section, we will be graphing polar equations on a polar grid. In the first few examples, we will write the polar equation in rectangular form to help identify
Homework 3 Solutions
Homework 3 Solutions Igor Yanovsky (Math 151A TA) Problem 1: Compute the absolute error and relative error in approximations of p by p. (Use calculator!) a) p π, p 22/7; b) p π, p 3.141. Solution: For
Approximation of distance between locations on earth given by latitude and longitude
Approximation of distance between locations on earth given by latitude and longitude Jan Behrens 2012-12-31 In this paper we shall provide a method to approximate distances between two points on earth
Math221: HW# 1 solutions
Math: HW# solutions Andy Royston October, 5 7.5.7, 3 rd Ed. We have a n = b n = a = fxdx = xdx =, x cos nxdx = x sin nx n sin nxdx n = cos nx n = n n, x sin nxdx = x cos nx n + cos nxdx n cos n = + sin
Statistical Inference I Locally most powerful tests
Statistical Inference I Locally most powerful tests Shirsendu Mukherjee Department of Statistics, Asutosh College, Kolkata, India. shirsendu st@yahoo.co.in So far we have treated the testing of one-sided
derivation of the Laplacian from rectangular to spherical coordinates
derivation of the Laplacian from rectangular to spherical coordinates swapnizzle 03-03- :5:43 We begin by recognizing the familiar conversion from rectangular to spherical coordinates (note that φ is used
The challenges of non-stable predicates
The challenges of non-stable predicates Consider a non-stable predicate Φ encoding, say, a safety property. We want to determine whether Φ holds for our program. The challenges of non-stable predicates
Lecture 2. Soundness and completeness of propositional logic
Lecture 2 Soundness and completeness of propositional logic February 9, 2004 1 Overview Review of natural deduction. Soundness and completeness. Semantics of propositional formulas. Soundness proof. Completeness
Βελτιστοποίηση ερωτημάτων Βάσεις Δεδομένων Διδάσκων: Μαρία Χαλκίδη
Βελτιστοποίηση ερωτημάτων Βάσεις Δεδομένων Διδάσκων: Μαρία Χαλκίδη με βάση slides από A. Silberschatz, H. Korth, S. Sudarshan, Database System Concepts, 5 th edition Εισαγωγή (1) Εναλλακτικοί τρόποι για
department listing department name αχχουντσ ϕανε βαλικτ δδσϕηασδδη σδηφγ ασκϕηλκ τεχηνιχαλ αλαν ϕουν διξ τεχηνιχαλ ϕοην µαριανι
She selects the option. Jenny starts with the al listing. This has employees listed within She drills down through the employee. The inferred ER sttricture relates this to the redcords in the databasee
Every set of first-order formulas is equivalent to an independent set
Every set of first-order formulas is equivalent to an independent set May 6, 2008 Abstract A set of first-order formulas, whatever the cardinality of the set of symbols, is equivalent to an independent
Problem Set 3: Solutions
CMPSCI 69GG Applied Information Theory Fall 006 Problem Set 3: Solutions. [Cover and Thomas 7.] a Define the following notation, C I p xx; Y max X; Y C I p xx; Ỹ max I X; Ỹ We would like to show that C
Partial Differential Equations in Biology The boundary element method. March 26, 2013
The boundary element method March 26, 203 Introduction and notation The problem: u = f in D R d u = ϕ in Γ D u n = g on Γ N, where D = Γ D Γ N, Γ D Γ N = (possibly, Γ D = [Neumann problem] or Γ N = [Dirichlet
6.1. Dirac Equation. Hamiltonian. Dirac Eq.
6.1. Dirac Equation Ref: M.Kaku, Quantum Field Theory, Oxford Univ Press (1993) η μν = η μν = diag(1, -1, -1, -1) p 0 = p 0 p = p i = -p i p μ p μ = p 0 p 0 + p i p i = E c 2 - p 2 = (m c) 2 H = c p 2
3.4 SUM AND DIFFERENCE FORMULAS. NOTE: cos(α+β) cos α + cos β cos(α-β) cos α -cos β
3.4 SUM AND DIFFERENCE FORMULAS Page Theorem cos(αβ cos α cos β -sin α cos(α-β cos α cos β sin α NOTE: cos(αβ cos α cos β cos(α-β cos α -cos β Proof of cos(α-β cos α cos β sin α Let s use a unit circle
Fractional Colorings and Zykov Products of graphs
Fractional Colorings and Zykov Products of graphs Who? Nichole Schimanski When? July 27, 2011 Graphs A graph, G, consists of a vertex set, V (G), and an edge set, E(G). V (G) is any finite set E(G) is
4.6 Autoregressive Moving Average Model ARMA(1,1)
84 CHAPTER 4. STATIONARY TS MODELS 4.6 Autoregressive Moving Average Model ARMA(,) This section is an introduction to a wide class of models ARMA(p,q) which we will consider in more detail later in this
Πανεπιστήμιο Κρήτης, Τμήμα Επιστήμης Υπολογιστών. Δημήτρης Πλεξουσάκης. Physical DB Design
Data Structures for Primary Indices Structures that determine the location of the records of a file A primary index is based on a key; the location of a record is determined by its key value. Most common
ST5224: Advanced Statistical Theory II
ST5224: Advanced Statistical Theory II 2014/2015: Semester II Tutorial 7 1. Let X be a sample from a population P and consider testing hypotheses H 0 : P = P 0 versus H 1 : P = P 1, where P j is a known
[1] P Q. Fig. 3.1
1 (a) Define resistance....... [1] (b) The smallest conductor within a computer processing chip can be represented as a rectangular block that is one atom high, four atoms wide and twenty atoms long. One
Jesse Maassen and Mark Lundstrom Purdue University November 25, 2013
Notes on Average Scattering imes and Hall Factors Jesse Maassen and Mar Lundstrom Purdue University November 5, 13 I. Introduction 1 II. Solution of the BE 1 III. Exercises: Woring out average scattering
Επεξεργασία ερωτήσεων
Επεξεργασία ερωτήσεων Πολλές ευχαριστίες στους Πάνο Βασιλειάδη, Γ. Ιωαννίδη, Τ. Σελλή, Ε. Πιτουρά για την επαναχρησιµοποίηση κειµένων/διαφανειών τους Θεµατολόγιο Γενικές αρχές της αποτίµησης ερωτήσεων
Nowhere-zero flows Let be a digraph, Abelian group. A Γ-circulation in is a mapping : such that, where, and : tail in X, head in
Nowhere-zero flows Let be a digraph, Abelian group. A Γ-circulation in is a mapping : such that, where, and : tail in X, head in : tail in X, head in A nowhere-zero Γ-flow is a Γ-circulation such that
DESIGN OF MACHINERY SOLUTION MANUAL h in h 4 0.
DESIGN OF MACHINERY SOLUTION MANUAL -7-1! PROBLEM -7 Statement: Design a double-dwell cam to move a follower from to 25 6, dwell for 12, fall 25 and dwell for the remader The total cycle must take 4 sec
Areas and Lengths in Polar Coordinates
Kiryl Tsishchanka Areas and Lengths in Polar Coordinates In this section we develop the formula for the area of a region whose boundary is given by a polar equation. We need to use the formula for the
ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΥΠΡΟΥ ΤΜΗΜΑ ΠΛΗΡΟΦΟΡΙΚΗΣ. ΕΠΛ342: Βάσεις Δεδομένων. Χειμερινό Εξάμηνο Φροντιστήριο 10 ΛΥΣΕΙΣ. Επερωτήσεις SQL
ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΥΠΡΟΥ ΤΜΗΜΑ ΠΛΗΡΟΦΟΡΙΚΗΣ ΕΠΛ342: Βάσεις Δεδομένων Χειμερινό Εξάμηνο 2013 Φροντιστήριο 10 ΛΥΣΕΙΣ Επερωτήσεις SQL Άσκηση 1 Για το ακόλουθο σχήμα Suppliers(sid, sname, address) Parts(pid, pname,
9.09. # 1. Area inside the oval limaçon r = cos θ. To graph, start with θ = 0 so r = 6. Compute dr
9.9 #. Area inside the oval limaçon r = + cos. To graph, start with = so r =. Compute d = sin. Interesting points are where d vanishes, or at =,,, etc. For these values of we compute r:,,, and the values
Επεξεργασία ερωτημάτων
Επεξεργασία ερωτημάτων Βάσεις Δεδομένων Διδάσκων: Μαρία Χαλκίδη Σε τι αφορά η επεξεργασία ερωτημάτων? Αναφέρεται στο σύνολο των δραστηριοτήτων που περιλαμβάνονται στην ανάκτηση δεδομένων από μία βάση δεδομένων
Potential Dividers. 46 minutes. 46 marks. Page 1 of 11
Potential Dividers 46 minutes 46 marks Page 1 of 11 Q1. In the circuit shown in the figure below, the battery, of negligible internal resistance, has an emf of 30 V. The pd across the lamp is 6.0 V and
Inverse trigonometric functions & General Solution of Trigonometric Equations. ------------------ ----------------------------- -----------------
Inverse trigonometric functions & General Solution of Trigonometric Equations. 1. Sin ( ) = a) b) c) d) Ans b. Solution : Method 1. Ans a: 17 > 1 a) is rejected. w.k.t Sin ( sin ) = d is rejected. If sin
Μηχανική Μάθηση Hypothesis Testing
ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ Μηχανική Μάθηση Hypothesis Testing Γιώργος Μπορμπουδάκης Τμήμα Επιστήμης Υπολογιστών Procedure 1. Form the null (H 0 ) and alternative (H 1 ) hypothesis 2. Consider
Congruence Classes of Invertible Matrices of Order 3 over F 2
International Journal of Algebra, Vol. 8, 24, no. 5, 239-246 HIKARI Ltd, www.m-hikari.com http://dx.doi.org/.2988/ija.24.422 Congruence Classes of Invertible Matrices of Order 3 over F 2 Ligong An and
Matrices and vectors. Matrix and vector. a 11 a 12 a 1n a 21 a 22 a 2n A = b 1 b 2. b m. R m n, b = = ( a ij. a m1 a m2 a mn. def
Matrices and vectors Matrix and vector a 11 a 12 a 1n a 21 a 22 a 2n A = a m1 a m2 a mn def = ( a ij ) R m n, b = b 1 b 2 b m Rm Matrix and vectors in linear equations: example E 1 : x 1 + x 2 + 3x 4 =
Αλγόριθμοι και πολυπλοκότητα NP-Completeness (2)
ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ Αλγόριθμοι και πολυπλοκότητα NP-Completeness (2) Ιωάννης Τόλλης Τμήμα Επιστήμης Υπολογιστών NP-Completeness (2) x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 12 22 32 11 13 21
Areas and Lengths in Polar Coordinates
Kiryl Tsishchanka Areas and Lengths in Polar Coordinates In this section we develop the formula for the area of a region whose boundary is given by a polar equation. We need to use the formula for the
Finite Field Problems: Solutions
Finite Field Problems: Solutions 1. Let f = x 2 +1 Z 11 [x] and let F = Z 11 [x]/(f), a field. Let Solution: F =11 2 = 121, so F = 121 1 = 120. The possible orders are the divisors of 120. Solution: The
Econ 2110: Fall 2008 Suggested Solutions to Problem Set 8 questions or comments to Dan Fetter 1
Eon : Fall 8 Suggested Solutions to Problem Set 8 Email questions or omments to Dan Fetter Problem. Let X be a salar with density f(x, θ) (θx + θ) [ x ] with θ. (a) Find the most powerful level α test
Modbus basic setup notes for IO-Link AL1xxx Master Block
n Modbus has four tables/registers where data is stored along with their associated addresses. We will be using the holding registers from address 40001 to 49999 that are R/W 16 bit/word. Two tables that
ΓΡΑΜΜΙΚΟΣ & ΔΙΚΤΥΑΚΟΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ
ΓΡΑΜΜΙΚΟΣ & ΔΙΚΤΥΑΚΟΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ Ενότητα 12: Συνοπτική Παρουσίαση Ανάπτυξης Κώδικα με το Matlab Σαμαράς Νικόλαος Άδειες Χρήσης Το παρόν εκπαιδευτικό υλικό υπόκειται σε άδειες χρήσης Creative Commons.
Πρόβλημα 1: Αναζήτηση Ελάχιστης/Μέγιστης Τιμής
Πρόβλημα 1: Αναζήτηση Ελάχιστης/Μέγιστης Τιμής Να γραφεί πρόγραμμα το οποίο δέχεται ως είσοδο μια ακολουθία S από n (n 40) ακέραιους αριθμούς και επιστρέφει ως έξοδο δύο ακολουθίες από θετικούς ακέραιους
Matrices and Determinants
Matrices and Determinants SUBJECTIVE PROBLEMS: Q 1. For what value of k do the following system of equations possess a non-trivial (i.e., not all zero) solution over the set of rationals Q? x + ky + 3z
Second Order RLC Filters
ECEN 60 Circuits/Electronics Spring 007-0-07 P. Mathys Second Order RLC Filters RLC Lowpass Filter A passive RLC lowpass filter (LPF) circuit is shown in the following schematic. R L C v O (t) Using phasor
Partial Trace and Partial Transpose
Partial Trace and Partial Transpose by José Luis Gómez-Muñoz http://homepage.cem.itesm.mx/lgomez/quantum/ jose.luis.gomez@itesm.mx This document is based on suggestions by Anirban Das Introduction This
ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 11/3/2006
ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 11/3/26 Οδηγίες: Να απαντηθούν όλες οι ερωτήσεις. Ολοι οι αριθμοί που αναφέρονται σε όλα τα ερωτήματα μικρότεροι το 1 εκτός αν ορίζεται διαφορετικά στη διατύπωση
Section 7.6 Double and Half Angle Formulas
09 Section 7. Double and Half Angle Fmulas To derive the double-angles fmulas, we will use the sum of two angles fmulas that we developed in the last section. We will let α θ and β θ: cos(θ) cos(θ + θ)
Quadratic Expressions
Quadratic Expressions. The standard form of a quadratic equation is ax + bx + c = 0 where a, b, c R and a 0. The roots of ax + bx + c = 0 are b ± b a 4ac. 3. For the equation ax +bx+c = 0, sum of the roots
Στο εστιατόριο «ToDokimasesPrinToBgaleisStonKosmo?» έξω από τους δακτυλίους του Κρόνου, οι παραγγελίες γίνονται ηλεκτρονικά.
Διαστημικό εστιατόριο του (Μ)ΑστροΈκτορα Στο εστιατόριο «ToDokimasesPrinToBgaleisStonKosmo?» έξω από τους δακτυλίους του Κρόνου, οι παραγγελίες γίνονται ηλεκτρονικά. Μόλις μια παρέα πελατών κάτσει σε ένα
Business English. Ενότητα # 9: Financial Planning. Ευαγγελία Κουτσογιάννη Τμήμα Διοίκησης Επιχειρήσεων
ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ Ανώτατο Εκπαιδευτικό Ίδρυμα Πειραιά Τεχνολογικού Τομέα Business English Ενότητα # 9: Financial Planning Ευαγγελία Κουτσογιάννη Τμήμα Διοίκησης Επιχειρήσεων Άδειες Χρήσης Το παρόν εκπαιδευτικό
Απόκριση σε Μοναδιαία Ωστική Δύναμη (Unit Impulse) Απόκριση σε Δυνάμεις Αυθαίρετα Μεταβαλλόμενες με το Χρόνο. Απόστολος Σ.
Απόκριση σε Δυνάμεις Αυθαίρετα Μεταβαλλόμενες με το Χρόνο The time integral of a force is referred to as impulse, is determined by and is obtained from: Newton s 2 nd Law of motion states that the action
ω ω ω ω ω ω+2 ω ω+2 + ω ω ω ω+2 + ω ω+1 ω ω+2 2 ω ω ω ω ω ω ω ω+1 ω ω2 ω ω2 + ω ω ω2 + ω ω ω ω2 + ω ω+1 ω ω2 + ω ω+1 + ω ω ω ω2 + ω
0 1 2 3 4 5 6 ω ω + 1 ω + 2 ω + 3 ω + 4 ω2 ω2 + 1 ω2 + 2 ω2 + 3 ω3 ω3 + 1 ω3 + 2 ω4 ω4 + 1 ω5 ω 2 ω 2 + 1 ω 2 + 2 ω 2 + ω ω 2 + ω + 1 ω 2 + ω2 ω 2 2 ω 2 2 + 1 ω 2 2 + ω ω 2 3 ω 3 ω 3 + 1 ω 3 + ω ω 3 +
ANSWERSHEET (TOPIC = DIFFERENTIAL CALCULUS) COLLECTION #2. h 0 h h 0 h h 0 ( ) g k = g 0 + g 1 + g g 2009 =?
Teko Classes IITJEE/AIEEE Maths by SUHAAG SIR, Bhopal, Ph (0755) 3 00 000 www.tekoclasses.com ANSWERSHEET (TOPIC DIFFERENTIAL CALCULUS) COLLECTION # Question Type A.Single Correct Type Q. (A) Sol least
Chapter 6: Systems of Linear Differential. be continuous functions on the interval
Chapter 6: Systems of Linear Differential Equations Let a (t), a 2 (t),..., a nn (t), b (t), b 2 (t),..., b n (t) be continuous functions on the interval I. The system of n first-order differential equations
Ordinal Arithmetic: Addition, Multiplication, Exponentiation and Limit
Ordinal Arithmetic: Addition, Multiplication, Exponentiation and Limit Ting Zhang Stanford May 11, 2001 Stanford, 5/11/2001 1 Outline Ordinal Classification Ordinal Addition Ordinal Multiplication Ordinal
EPL 603 TOPICS IN SOFTWARE ENGINEERING. Lab 5: Component Adaptation Environment (COPE)
EPL 603 TOPICS IN SOFTWARE ENGINEERING Lab 5: Component Adaptation Environment (COPE) Performing Static Analysis 1 Class Name: The fully qualified name of the specific class Type: The type of the class
(1) Describe the process by which mercury atoms become excited in a fluorescent tube (3)
Q1. (a) A fluorescent tube is filled with mercury vapour at low pressure. In order to emit electromagnetic radiation the mercury atoms must first be excited. (i) What is meant by an excited atom? (1) (ii)
Αρχεία και Βάσεις Δεδομένων
ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ Αρχεία και Βάσεις Δεδομένων Διάλεξη 18η: Φυσική Σχεδίαση Βάσεων Δεδομένων Τμήμα Επιστήμης Υπολογιστών Data Structures for Primary Indices Structures that determine
Assalamu `alaikum wr. wb.
LUMP SUM Assalamu `alaikum wr. wb. LUMP SUM Wassalamu alaikum wr. wb. Assalamu `alaikum wr. wb. LUMP SUM Wassalamu alaikum wr. wb. LUMP SUM Lump sum lump sum lump sum. lump sum fixed price lump sum lump
5.4 The Poisson Distribution.
The worst thing you can do about a situation is nothing. Sr. O Shea Jackson 5.4 The Poisson Distribution. Description of the Poisson Distribution Discrete probability distribution. The random variable
CHAPTER 48 APPLICATIONS OF MATRICES AND DETERMINANTS
CHAPTER 48 APPLICATIONS OF MATRICES AND DETERMINANTS EXERCISE 01 Page 545 1. Use matrices to solve: 3x + 4y x + 5y + 7 3x + 4y x + 5y 7 Hence, 3 4 x 0 5 y 7 The inverse of 3 4 5 is: 1 5 4 1 5 4 15 8 3
Elements of Information Theory
Elements of Information Theory Model of Digital Communications System A Logarithmic Measure for Information Mutual Information Units of Information Self-Information News... Example Information Measure
Dynamic types, Lambda calculus machines Section and Practice Problems Apr 21 22, 2016
Harvard School of Engineering and Applied Sciences CS 152: Programming Languages Dynamic types, Lambda calculus machines Apr 21 22, 2016 1 Dynamic types and contracts (a) To make sure you understand the
Numerical Analysis FMN011
Numerical Analysis FMN011 Carmen Arévalo Lund University carmen@maths.lth.se Lecture 12 Periodic data A function g has period P if g(x + P ) = g(x) Model: Trigonometric polynomial of order M T M (x) =
Figure A.2: MPC and MPCP Age Profiles (estimating ρ, ρ = 2, φ = 0.03)..
Supplemental Material (not for publication) Persistent vs. Permanent Income Shocks in the Buffer-Stock Model Jeppe Druedahl Thomas H. Jørgensen May, A Additional Figures and Tables Figure A.: Wealth and
CRASH COURSE IN PRECALCULUS
CRASH COURSE IN PRECALCULUS Shiah-Sen Wang The graphs are prepared by Chien-Lun Lai Based on : Precalculus: Mathematics for Calculus by J. Stuwart, L. Redin & S. Watson, 6th edition, 01, Brooks/Cole Chapter
forms This gives Remark 1. How to remember the above formulas: Substituting these into the equation we obtain with
Week 03: C lassification of S econd- Order L inear Equations In last week s lectures we have illustrated how to obtain the general solutions of first order PDEs using the method of characteristics. We
Problem Set 9 Solutions. θ + 1. θ 2 + cotθ ( ) sinθ e iφ is an eigenfunction of the ˆ L 2 operator. / θ 2. φ 2. sin 2 θ φ 2. ( ) = e iφ. = e iφ cosθ.
Chemistry 362 Dr Jean M Standard Problem Set 9 Solutions The ˆ L 2 operator is defined as Verify that the angular wavefunction Y θ,φ) Also verify that the eigenvalue is given by 2! 2 & L ˆ 2! 2 2 θ 2 +
Uniform Convergence of Fourier Series Michael Taylor
Uniform Convergence of Fourier Series Michael Taylor Given f L 1 T 1 ), we consider the partial sums of the Fourier series of f: N 1) S N fθ) = ˆfk)e ikθ. k= N A calculation gives the Dirichlet formula
Overview. Transition Semantics. Configurations and the transition relation. Executions and computation
Overview Transition Semantics Configurations and the transition relation Executions and computation Inference rules for small-step structural operational semantics for the simple imperative language Transition
Abstract Storage Devices
Abstract Storage Devices Robert König Ueli Maurer Stefano Tessaro SOFSEM 2009 January 27, 2009 Outline 1. Motivation: Storage Devices 2. Abstract Storage Devices (ASD s) 3. Reducibility 4. Factoring ASD
2. THEORY OF EQUATIONS. PREVIOUS EAMCET Bits.
EAMCET-. THEORY OF EQUATIONS PREVIOUS EAMCET Bits. Each of the roots of the equation x 6x + 6x 5= are increased by k so that the new transformed equation does not contain term. Then k =... - 4. - Sol.
(C) 2010 Pearson Education, Inc. All rights reserved.
Connectionless transmission with datagrams. Connection-oriented transmission is like the telephone system You dial and are given a connection to the telephone of fthe person with whom you wish to communicate.
Main source: "Discrete-time systems and computer control" by Α. ΣΚΟΔΡΑΣ ΨΗΦΙΑΚΟΣ ΕΛΕΓΧΟΣ ΔΙΑΛΕΞΗ 4 ΔΙΑΦΑΝΕΙΑ 1
Main source: "Discrete-time systems and computer control" by Α. ΣΚΟΔΡΑΣ ΨΗΦΙΑΚΟΣ ΕΛΕΓΧΟΣ ΔΙΑΛΕΞΗ 4 ΔΙΑΦΑΝΕΙΑ 1 A Brief History of Sampling Research 1915 - Edmund Taylor Whittaker (1873-1956) devised a
Notes on the Open Economy
Notes on the Open Econom Ben J. Heijdra Universit of Groningen April 24 Introduction In this note we stud the two-countr model of Table.4 in more detail. restated here for convenience. The model is Table.4.