add LIMIT 1000 by default

This commit is contained in:
Kane York 2015-06-25 14:55:06 -07:00
parent 2c71bc11aa
commit c933c50dc2
1 changed files with 6 additions and 6 deletions

View File

@ -82,16 +82,16 @@ after_initialize do
ActiveRecord::Base.exec_sql "SET TRANSACTION READ ONLY"
# SQL comments are for the benefits of the slow queries log
sql = <<SQL
/*
DataExplorer Query
Query: /admin/plugins/explorer/#{query.id}
Started by: #{opts[:current_user]}
*/
* DataExplorer Query
* Query: /admin/plugins/explorer/#{query.id}
* Started by: #{opts[:current_user]}
*/
WITH query AS (
#{query.sql}
) SELECT * FROM query
LIMIT #{opts[:limit] || 1000}
SQL
time_start = Time.now