add LIMIT 1000 by default
This commit is contained in:
parent
2c71bc11aa
commit
c933c50dc2
12
plugin.rb
12
plugin.rb
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue