mirror of
https://github.com/discourse/discourse-data-explorer.git
synced 2025-06-25 09:02:17 +00:00
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"
|
ActiveRecord::Base.exec_sql "SET TRANSACTION READ ONLY"
|
||||||
# SQL comments are for the benefits of the slow queries log
|
# SQL comments are for the benefits of the slow queries log
|
||||||
sql = <<SQL
|
sql = <<SQL
|
||||||
|
|
||||||
/*
|
/*
|
||||||
DataExplorer Query
|
* DataExplorer Query
|
||||||
Query: /admin/plugins/explorer/#{query.id}
|
* Query: /admin/plugins/explorer/#{query.id}
|
||||||
Started by: #{opts[:current_user]}
|
* Started by: #{opts[:current_user]}
|
||||||
*/
|
*/
|
||||||
WITH query AS (
|
WITH query AS (
|
||||||
|
|
||||||
#{query.sql}
|
#{query.sql}
|
||||||
|
|
||||||
) SELECT * FROM query
|
) SELECT * FROM query
|
||||||
|
LIMIT #{opts[:limit] || 1000}
|
||||||
SQL
|
SQL
|
||||||
|
|
||||||
time_start = Time.now
|
time_start = Time.now
|
||||||
|
Loading…
x
Reference in New Issue
Block a user