Bacula-users

Re: [Bacula-users] what does baculas select-query for mysql look like?

2010-11-18 07:05:09
Subject: Re: [Bacula-users] what does baculas select-query for mysql look like?
From: "Mike Holden" <bacula AT mikeholden DOT org>
To: bacula-users AT lists.sourceforge DOT net
Date: Thu, 18 Nov 2010 11:35:20 -0000
Martin Simmons wrote:
>>>>>> On Wed, 17 Nov 2010 17:30:33 +0100, C Keschnat said:
>>
>> I'm having problems with long running select statements (bacula
>> 5.0.2).
>> After activating mysql-slow-logs, I saw logs similar to
>>
>> # Time: 101117 11:32:56
>> # User@Host: bacula[bacula] @ localhost []
>> # Query_time: 2793  Lock_time: 0  Rows_sent: 127104387
>> Rows_examined:
>> 127104387
>> use bacula;
>> SELECT /*!40001 SQL_NO_CACHE */ * FROM `File`;
>>
>> I wanted to test some suggestions I read in bug reports and for
>> that I
>> copied the bacula server to play with it. I tried running
>>
>> date && echo 'SELECT SQL_NO_CACHE * FROM `File`;' | mysql -uroot
>> -p bacula
>> >/dev/null && date
>>
>> but the process gets killed with "Out of memory: kill process
>> 16377
>> (mysql)..." after some time. Can anyone tell me how bacula queries
>> the
>> database?
>
> It makes many different queries, but I doubt that is makes that one.
>  It
> doesn't look like anything it needs to do.
>
> __Martin
>

You will need to submit the query exactly as written anyway, which
you haven't done.

SELECT /*!40001 SQL_NO_CACHE */ * FROM `File`;

SELECT SQL_NO_CACHE * FROM `File`;

Note the "/*!40001" and the "*/" in the original code, which is
omitted in the second version? With my experience of Oracle, that
looks like an "execution hint", in other words a directive to help
the database choose the most efficient way of retrieveing the data.
It's a specially formed comment, hence the /* ... */, so you either
need to include the entire comment, or omit it entirely, but you
have included the SQL_NO_CACHE part, and omitted the rest, which is
probably causing some weird error in the database.
-- 
Mike Holden

http://www.by-ang.com - the place to shop
for all manner of hand crafted items,
including Jewellery, Greetings Cards and Gifts



------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users