Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoow committed Jan 15, 2009
1 parent 1553007 commit b3b59ff
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 4 deletions.
14 changes: 14 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,20 @@ If you are on Rails < 2.1, do this from your RAILS_ROOT

rake db:migrate

== Performance

To achieve best performance, you should add indices to your tables on the date columns that are
used for grouping the records (see Kvlr::ReportsAsSparkline::ClassMethods.reports_as_sparkline):

add_index :[table], :[date_column]

If you are on PostgreSQL, you should add functional indices:

add_index :[table], :[date_column], :functional => "date_trunc('hour', [date_column])"
add_index :[table], :[date_column], :functional => "date_trunc('day', [date_column])"
add_index :[table], :[date_column], :functional => "date_trunc('week', [date_column])"
add_index :[table], :[date_column], :functional => "date_trunc('year', [date_column])"

== TODOs/ future plans

* support for Oracle and DB2 (and others?) missing
Expand Down
3 changes: 2 additions & 1 deletion rdoc/classes/Kvlr/ReportsAsSparkline/ReportingPeriod.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@
<p>
A <a href="ReportingPeriod.html">ReportingPeriod</a> is - depending on the
<a href="Grouping.html">Grouping</a> - either a specific hour, a day, a
month or a year. All records falling into this period will be grouped.
month or a year. All records falling into this period will be grouped
together.
</p>

</div>
Expand Down
2 changes: 1 addition & 1 deletion rdoc/created.rid
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Thu, 15 Jan 2009 11:34:04 +0100
Thu, 15 Jan 2009 12:00:12 +0100
20 changes: 19 additions & 1 deletion rdoc/files/README_rdoc.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ <h1>README.rdoc</h1>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Thu Jan 15 11:33:40 +0100 2009</td>
<td>Thu Jan 15 11:59:48 +0100 2009</td>
</tr>
</table>
</div>
Expand Down Expand Up @@ -191,6 +191,24 @@ <h2>Installation</h2>
<pre>
rake db:migrate
</pre>
<h2>Performance</h2>
<p>
To achieve best performance, you should add indices to your tables on the
date columns that are used for grouping the records (see
Kvlr::ReportsAsSparkline::ClassMethods.reports_as_sparkline):
</p>
<pre>
add_index :[table], :[date_column]
</pre>
<p>
If you are on PostgreSQL, you should add functional indices:
</p>
<pre>
add_index :[table], :[date_column], :functional =&gt; &quot;date_trunc('hour', [date_column])&quot;
add_index :[table], :[date_column], :functional =&gt; &quot;date_trunc('day', [date_column])&quot;
add_index :[table], :[date_column], :functional =&gt; &quot;date_trunc('week', [date_column])&quot;
add_index :[table], :[date_column], :functional =&gt; &quot;date_trunc('year', [date_column])&quot;
</pre>
<h2>TODOs/ future plans</h2>
<ul>
<li>support for Oracle and DB2 (and others?) missing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ <h1>reporting_period.rb</h1>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Thu Jan 15 11:13:51 +0100 2009</td>
<td>Thu Jan 15 11:36:51 +0100 2009</td>
</tr>
</table>
</div>
Expand Down

0 comments on commit b3b59ff

Please sign in to comment.