1 / 71

Lecture 05: Data Retrieval

Lecture 05: Data Retrieval. September 21, 2010 COMP 150-12 Topics in Visual Analytics. Lecture Outline. Data Retrieval Methods for increasing retrieval speed: Pre-computation Pre-fetching and Caching Levels of Detail (LOD) Hardware support Data transform (pre-processing) Subsample

mio
Download Presentation

Lecture 05: Data Retrieval

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 05:Data Retrieval September 21, 2010 COMP 150-12Topics in Visual Analytics

  2. Lecture Outline • Data Retrieval • Methods for increasing retrieval speed: • Pre-computation • Pre-fetching and Caching • Levels of Detail (LOD) • Hardware support • Data transform (pre-processing) • Subsample • Aggregate • Simplification (dimension reduction) • Appropriate representation (finding underlying mathematical representation)

  3. Speed of Data Transfer 12.8 GB/s 16GB/s Ethernet 100Base-T 100Mb/s = 0.0125 GB/s SQL queries ~ 1000 /s SATA 0.5 GB/s Hard drive 0.06 GB/s

  4. Size of Data Transfer L2/L3 Cache 0.008 MB Main Memory 8 GB GPU 2GB SQL Database 512,000 GB Hard drive 2,000 GB

  5. Pre-computation • Problem Statement: storage is plentiful, computation time and user patience are not. What can we do? • Assuming no storage constraint, can we do all computations a priori? • Is the number of possible states in a visualization system finite?

  6. Consider the van Wijk Model

  7. But Wait…!! • Are all the states possible to a visualization system traversable?

  8. Reconsider the van Wijk Model

  9. Reconsider the van Wijk Model S’ User Interface

  10. An Example: • How many variables are there in a program in order to generate the visualization to the right? • Are all those variables adjustable by the user?

  11. An Example: S’ • Does the size of S change from left to right image? • What about S’?

  12. What is S? • Do all camera positions and perspectives need to be pre-computed? • For such “continuous” variables, what pre-computations can be done?

  13. Implications for Pre-Computation • Depending on the system and the interface, many visualizations have a finite state. • Typically, the variables associated with the interface would be nominal or ordinal. • For quantitative variables, need to convert Q -> O or Q -> N. • For retrieval time above a certain threshold, pre-computation should be considered.

  14. Questions?

  15. Pre-fetching • Even if all pre-computations are done, they need to reside on disk (too large). • Assume visualization of large datasets, fetching data on user request could still take some time. • The strategy is to guess what data the user would like to see next, and bring the data from disk to memory beforehand.

  16. Pre-fetching 1 Too Large! Main Memory

  17. Pre-fetching 2 OK! Main Memory

  18. Pre-fetching 3 This program’s great! Main Memory

  19. Pre-fetching 4 This program sucks! Main Memory

  20. Pre-fetching • Used in: • web browser: link pre-fetch • operating systems: page pre-fetch • CPU design: instruction pre-fetch • computer graphics: polygon pre-fetch • In computer graphics, pre-fetching is often related to “Out-Of-Core” operations (e.g. Out-Of-Core Rendering)

  21. Pre-fetching • Pre-fetching is used in nearly all computer graphics games that have open worlds.

  22. Example Movie • “Spatial Frame” • Rob Jensen, Pixar • http://www.youtube.com/watch?v=n27NLuc44Lk Video courtesy of Rob Jensen, Pixar

  23. Predict User’s Behaviors • Consider the user’s possible interactions. • In most computer graphics, the user can: • Move (read: translation) forward/backward, up/down, left/right • Turn (read: rotation) pitch, yaw ,roll. • Six degrees of freedom, sometimes with even more constraints

  24. Pre-fetching in Graphics Image courtesy of SGI.com

  25. Predict Based on Data Use • In assignment 1: • The user’s interactions with the data is constrained by the data structure • The user can: • Go up to the parent • Go down to one of the children • Maybe go to a sibling?

  26. Pre-fetching Mechanisms • Almost always a multi-threaded architecture • In the most simple form, there are two threads: • Data thread: fetching data • UI thread: rendering and responding to user interactions

  27. Pre-fetching Mechanisms • Data consistency is key • Maintain strict read/write locks on data • Does not work well with dynamic data • What happens when the data fetching is too slow?

  28. Questions?

  29. Caching • Cache is directly related to pre-fetch. • While pre-fetch is the mechanism to grab data. • Cache is the strategy for storing data that might be used in the future. • Pre-fetching is great, but what to keep around? • Cache-misses is a metric for determining the quality of the caching strategy

  30. Caching I think he’s going for ear, head, and leg! Main Memory Ear Head Leg

  31. Caching View 1: Head CHECK! Main Memory Ear Head Leg

  32. Caching View 2: Ear CHECK! Main Memory Ear Head Leg

  33. Caching Change of Plan: Let’s look at the tail! Main Memory Ear Head Leg

  34. Caching Where do I put this? ?? Tail Main Memory Ear Head Leg

  35. Buffer vs. Cache • The idea of pre-fetching without caching can be thought of as “buffering”. • The main challenge in designing caching strategy is to determine if a piece of data could be reused in the future. • Another metric for caching strategy could be the size of the cache vs. the amount of data being re-fetched.

  36. Examples of Caching Algorithms • Belady’s Algorithm (the clairvoyant algorithm): • Method: replace the data in cache that will not be used for the longest time in the future • Problem: need to be able to predict the future • Serves as the (optimal) benchmark

  37. Examples of Caching Algorithms • Least Recently Used (LRU): • Maintains a priority queue • For every recently used data item, move it to the front • Deletes from the back

  38. Caching View 1: Head CHECK! Priority Main Memory Ear Head Leg

  39. Caching View 1: Head Priority Main Memory Head Ear Leg

  40. Caching View 2: Ear CHECK! Priority Main Memory Head Ear Leg

  41. Caching View 2: Ear Priority Main Memory Ear Head Leg

  42. Caching Change of Plan: Let’s look at the tail! Main Memory Ear Head Leg

  43. Caching Which memory do I erase? ?? Tail Main Memory Ear Head Leg

  44. Caching Ah! Least Recently Used! !! Tail Main Memory Ear Head Tail Leg

  45. Examples of Caching Algorithms • Many Others… • Least Frequently Used • Most Recently Used • : • : • Not one is perfect… Predicting a user’s behavior is hard!

  46. Questions?

  47. Levels of Detail

  48. Levels of Detail • Two types of LOD: • Continuous • Requires a “mathematical” definition of the model • Pros: no need for pre-computation • Cons: the math model could be hard, computation might not scale • Discrete • Requires a pre-computation of all possible LODs, results are usually stored in a hierarchical tree structure • Pros: fast fetching time • Cons: storage requirement could be prohibitive. Might cause “popping”

  49. Discrete Levels of Detail Example • Google Maps

  50. Discrete Levels of Detail Example

More Related