Upload
darroch-reid
View
40
Download
3
Embed Size (px)
Citation preview
© 2014 Quintiq Holding B.V. All rights reserved. Quintiq is a registered mark of Quintiq Holding B.V.
Do I have a a Big Data problem?
Learning to use MySQL
2© 2014 Quintiq
1. Please explain what your project is about?
2. Why do you think the requester wanted this? What
business need does this serve?
3. What I like about this project?
4. What I don't like about this project?
5. What did you learn from doing this project?
Useful Questions
3© 2014 Quintiq
From EPIC database find out how many unique people did something on these set of pages
Common Question
4© 2014 Quintiq
How should we start looking?
5© 2014 Quintiq
What does a Table look like?
6© 2014 Quintiq
What does the data look like?
© 2014 Quintiq Holding B.V. All rights reserved. Quintiq is a registered mark of Quintiq Holding B.V.
Project Details
Learning to use MySQL
8© 2014 Quintiq
Project
9© 2014 Quintiq
Method 1: Import into Excel
10© 2014 Quintiq
Method2: PHP MyAdmin
11© 2014 Quintiq
Method 3: Query the database with HeidiSQL
© 2014 Quintiq Holding B.V. All rights reserved. Quintiq is a registered mark of Quintiq Holding B.V.
Reflections
Positives/Negatives/Lessons Learnt
13© 2014 Quintiq
SELECT * FROM ab_conversion
This means select EVERY COLUMN and EVERY ROW from table ab_conversion. For larger tables, this is undesirable.
Improvement: Choose only the columns you need
SELECT _visitor_id,_test_id,_variation_id,_datetime FROMab_conversion
Tip1: SELECT using named columns
14© 2014 Quintiq
SELECT _visitor_id,_test_id,_variation_id,_datetime FROMab_conversion
Improvement: Use LIMIT to reduce the row count in the result
LIMIT offset, count (or just LIMIT count)
SELECT _visitor_id,_test_id,_variation_id,_datetime FROMab_conversion LIMIT 10
For large queries, you will find that LIMIT makes you query time shorter: LIMIT 10001, 10000 (to show the 2nd 10,000 results)
Tip2: Use LIMIT to reduce row count
15© 2014 Quintiq
SELECT _visitor_id,_test_id,_variation_id,_datetime FROMab_visit
Improvement: Use WHERE to reduce row count in result
SELECT _visitor_id,_test_id,_variation_id,_datetime FROMab_visit WHERE _test_id = 13
More complex example:
SELECT _visitor_id,_test_id,_variation_id,_datetime FROMab_visit WHERE _test_id = 13 AND (_variation_id =36 OR_variation_id=37) # This excludes Bots that get 35
Tip3: Use WHERE to reduce row count in result