title: Work on samples instead of the entire data base
body: <p>I'd like to know if it's common pratice to create a CUSTOMER_RANDOM_VALUE (between 0 and 100) in order to work on random sample instead of the entire data base.</p>
  
  <p>Let's take an example : you manage the CDW of a webstore and you use an incremental CustomerID.</p>
  
  <p>If you want to know the numbers of users who visit the page of a specific product a you need to do that :</p>
  
  <pre><code>SELECT COUNT(DISTINCT CUSTOMER_ID)
  FROM WEBSITE_TRAFFIC
  WHERE PRODUCT_KEY= 134
  </code></pre>
  
  <p>The problem is this table is so huge that it could take 1h to know that and you have to answer lots of questions of this type all day long.</p>
  
  <p>Why don't create a random_value for each customer :</p>
  
  <pre><code>Customer_Id | Random Value
   1               13
   2               41
   3               8
   4               87  
  </code></pre>
  
  <p>and work on a sample of 1% like this :</p>
  
  <pre><code>SELECT COUNT(DISTINCT CUSTOMER_ID)
  FROM WEBSITE_TRAFFIC
  WHERE PRODUCT_KEY= 134
  AND CUSTOMER_RANDOM_VALUE&lt;1
  </code></pre>
  
  <p><strong>Question</strong> : Is it a common pratice when the amount of data are huge,to use sampling with a CUSTOMER_RANDOM_VALUE.</p>