A simple Sql sampling technique


This technique I proposed while working on chart (2008). If user requests a large amount of data but it is not possible to display them all in the viewing area (not enough pixels), you have to sample the data.

There are a lot of  sampling techniques. Here is a simple one:

sample_interval = number of points to plot / number of pixels

SELECT * FROM table WHERE mod(index, sample_interval) = 0

Advertisements
A simple Sql sampling technique

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s