June 18, 2013

Post: MySQL Query Patterns, Optimized - Webinar questions followup

… key solution for random selection only work when the IDs for movies are distributed uniformly over the range 1..MAX(id)? Yes, there… there’s a gap of id‘s between 47000 and 50000 with no movies, but your random number generator picks values in that… “gap” will be picked more frequently. Nearly every solution for randomly choosing rows involves some compromise, either of performance, or of…

Comment: ORDER BY ... LIMIT Performance Optimization

… row_ids or there are few holes and you do not care about a bit skewed distribution – use this approach – select random(id) in the range and find row close to it. If you need multiple rows or there is no sequential integer ids…. For example generate 1.000.000 of random rows at once. Now have as simple counter of how much of random rows you…

Post: New distribution of random generator for sysbench - Zipf

Sysbench has three distribution for random numbers: uniform, special and gaussian. I mostly use uniform and … incoming benchmarks with this distribution. Follow @VadimTk !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=”//platform.twitter.com/widgets.js…

Post: Missing Data - rows used to generate result set

…table scan row accesses may be much faster than random index lookups row accesses in the same table) … is the number of rows which MySQL used to generate result set. Comparing this number with number of rows…use Full Text Search indexes. If you have WHERE ID%100=0 you can have extra column divisible_…

Comment: ORDER BY ... LIMIT Performance Optimization

…. i.id (smaller-equal) a.id and the i.id (greater) a.id This brings trouble as well because the random number is generated inside the query resulting with two different random numbers. This can be overcome by making a pre-query to generate

Comment: ORDER BY ... LIMIT Performance Optimization

…-rand a.id This brings trouble as well because the random number is generated inside the query resulting with two different random numbers. This can be overcome by making a pre-query to generate

Comment: ORDER BY ... LIMIT Performance Optimization

… sequence of random row ID something like: id rnd 1 456 2 123 3 905 So you have sequential row number and random values. Now when you need N random you can do select rnd from tbl where id> LIMIT N; If N is random… all random data is used – for some application looping is enough for others you need to make sure you generate enough random data…

Post: Testing Fusion-io ioDrive2 Duo

… show the results for both single card and raid (Duo). Random writes, async: We see stable and predictable write performance, with… MiB/s for Duo. Now with separation per thread for random read synchronous IO: There is also excellent response time characteristics… to previous generation ioDrive. Follow @VadimTk !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d…

Post: To UUID or not to UUID ?

… your application needs. It may be (user_id,msg_id) in some cases but in many auto_increment …be stored in optimized sort order to minimize how random they are – there is timestamp based part in …increment and which could be used to have values generated at same point in time physically local in …

Post: Replaying database load with Percona Playback

… workload, data set or queries. Those tools just run random queries against random generated data. The best way to run a benchmark is… DISTINCT ol_i_id FROM order_line WHERE ol_w_id = 1 AND ol_d_id = 10 AND ol_o_id < 3415 AND ol_o_id >= (3415 – 20); Why there…