Bacula-users

Re: [Bacula-users] MySQL: Batch-Inserts & Disk-based tmp-tables

2009-07-22 13:06:19
Subject: Re: [Bacula-users] MySQL: Batch-Inserts & Disk-based tmp-tables
From: ebollengier <eric AT eb.homelinux DOT org>
To: bacula-users AT lists.sourceforge DOT net
Date: Wed, 22 Jul 2009 09:59:58 -0700 (PDT)
Hello,


Daniel Holtkamp wrote:
> 
> Hello everyone !
> 
> Please correct me if i'm wrong, but i did notice that all temporary
> batch-insert tables created by bacula are disk-based.
> 

To avoid problems with encoding, bacula is always using blob to store
strings.


Daniel Holtkamp wrote:
> 
> After digging a bit on why this happens (starting with the
> mysql-parameters) i found the following bit that explained it quite
> clearly.
> 
>>>From http://dev.mysql.com/doc/refman/5.0/en/memory-storage-engine.html
> 
> -> MEMORY tables cannot contain BLOB or TEXT columns.
> 

No text columns too ? Strange limitation. (but it changes nothing for
bacula)


Daniel Holtkamp wrote:
> 
> And here is the Table-Creation in the bacula-source
> (src/cats/sql_create.c):
> 
>              "CREATE TEMPORARY TABLE batch ("
>                 "FileIndex integer,"
>                 "JobId integer,"
>                 "Path blob,"
>                 "Name blob,"
>                 "LStat tinyblob,"
>                 "MD5 tinyblob)",NULL, NULL);
> 
> Of course - so bacula batch-insert tables are never going to be memory
> tables because of the blob columns.
> 

I think that if you want to use memory backend, you need to specify it on
the create
table order. Else, it will take the default (isam). Since all backend have
different behavior
(and sometime gotchas), i don't think that mysql can switch from an engine
to
an other by himself.


Daniel Holtkamp wrote:
> 
> 
> If those tables have to be blobs there is nothing we can do about it -
> but do they really have to be ? Does batch-inserts still make it faster
> even though the tables are disk-based ? (I did not test that).
> 
> 
> I also found this in patches/testing/batch-insert.readme and am curious
> if it is still valid:
> 

I don't think that it's still valid.


Daniel Holtkamp wrote:
> 
> 
> ---
> you MUST change some indexes.
> 
> mysql)
> 
> ALTER TABLE Filename DROP INDEX Name;
> ALTER TABLE Filename ADD UNIQUE (Name(255));
> 
> ALTER TABLE Path DROP INDEX Path;
> ALTER TABLE Path ADD  UNIQUE (Path(255));
> ---
> 

I don't advise you to use this configuration with Mysql. They have a
limitation on unique
indexes that can break your installation.

If you try to insert /path/very/long/ (255char), and after you try to insert
/path/very/long/sub/dir (256char), mysql will raise an error saying that the
string
is already in the table.

I will remove this file from the source tree


Daniel Holtkamp wrote:
> 
> 
> But mysql_create_tables.in (again in src/cats/) says:
> 
> ---
> CREATE TABLE Filename (
>   FilenameId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
>   Name BLOB NOT NULL,
>   PRIMARY KEY(FilenameId),
>   INDEX (Name(255))
>   );
> 
> CREATE TABLE Path (
>    PathId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
>    Path BLOB NOT NULL,
>    PRIMARY KEY(PathId),
>    INDEX (Path(255))
>    );
> ---
> 
> I`m pretty sure that the bacula-rpm (that has batch-insert enabled) does
> not create the database in the correct way for batch-inserts if those
> indexes are still necessary.
> 
> 
> I`m also having a Problem with my Director hanging sometime in the
> night. It just stops doing anything and you cannot connect to the
> console. I don't think i can get a Traceback from this because the
> director does not actually crash. 
> 

You can generate it with a signal, read the kaboom chapter of the manual.


Daniel Holtkamp wrote:
> 
> It just sits there doing nothing. I am
> still analysing this though - if you have any tips on how i can get some
> useful output (i did set the debug-level for SD & Dir to 200 today and
> hope to see something tomorrow) please tell.
> 
> 
> Best regards
> 
> Daniel Holtkamp
> 

Bye

-- 
View this message in context: 
http://www.nabble.com/MySQL%3A-Batch-Inserts---Disk-based-tmp-tables-tp24603953p24610373.html
Sent from the Bacula - Users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users

<Prev in Thread] Current Thread [Next in Thread>