Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl-hive
Commits
97ef20de
Commit
97ef20de
authored
Feb 22, 2013
by
Matthieu Muffato
Browse files
It is more efficient to give MySQL a LIMIT clause
parent
e2ac50d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
modules/Bio/EnsEMBL/Hive/RunnableDB/SqlHealthcheck.pm
modules/Bio/EnsEMBL/Hive/RunnableDB/SqlHealthcheck.pm
+2
-3
No files found.
modules/Bio/EnsEMBL/Hive/RunnableDB/SqlHealthcheck.pm
View file @
97ef20de
...
...
@@ -103,14 +103,13 @@ sub _get_rowcount_bound {
my
$inputquery
=
$self
->
param_substitute
(
$self
->
param
('
inputquery
')
);
warn
"
Testing at least '
$maxrow
' rows of the input query: '
$inputquery
'
"
if
(
$self
->
debug
());
$inputquery
.=
"
LIMIT
$maxrow
"
unless
$inputquery
=~
/LIMIT/i
;
my
$sth
=
$self
->
data_dbc
()
->
prepare
(
$inputquery
);
$sth
->
execute
();
my
$nrow
=
0
;
while
(
$nrow
<
$maxrow
)
{
my
$row
=
$sth
->
fetchrow_arrayref
();
last
unless
(
defined
$row
);
while
(
defined
$sth
->
fetchrow_arrayref
())
{
$nrow
++
;
}
$sth
->
finish
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment