[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bacula-devel] Alternative DB proposal


Hi
My first test are complete.
To aid in getting all the questions/answers and results in one place, I've made a wiki entry.


http://wiki.bacula.org/doku.php?id=wiki:playground


My scripts are attached.

--John


gen_dumpfile:	gen_dumpfile.o
	gcc gen_dumpfile.o -o gen_dumpfile

gen_dumpfile.o:	gen_dumpfile.c
	gcc -c gen_dumpfile.c -o gen_dumpfile.o

--
-- PostgreSQL database dump
--

SET client_encoding = 'SQL_ASCII';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

SET search_path = public, pg_catalog;

DROP INDEX public.file_jobid_idx;
DROP INDEX public.file_fp_idx;
ALTER TABLE ONLY public.file DROP CONSTRAINT file_pkey;
ALTER TABLE public.file ALTER COLUMN fileid DROP DEFAULT;
DROP SEQUENCE public.file_fileid_seq;
DROP TABLE public.file;
SET search_path = public, pg_catalog;

SET default_tablespace = bacula2;

SET default_with_oids = false;



CREATE TABLE file (
    fileid integer NOT NULL,
    fileindex integer DEFAULT 0 NOT NULL,
    jobid integer NOT NULL,
    pathid integer NOT NULL,
    filenameid integer NOT NULL,
    markid integer DEFAULT 0 NOT NULL,
    lstat text  Not NULL,
    md5 text NOT NULL
) WITH (FILLFACTOR=90)
TABLESPACE bacula2;


ALTER TABLE public.file OWNER TO bacula;

--
-- Name: file_fileid_seq; Type: SEQUENCE; Schema: public; Owner: bacula
--

CREATE SEQUENCE file_fileid_seq
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.file_fileid_seq OWNER TO bacula;

--
-- Name: file_fileid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bacula
--

ALTER SEQUENCE file_fileid_seq OWNED BY file.fileid;


--
-- Name: fileid; Type: DEFAULT; Schema: public; Owner: bacula
--

ALTER TABLE file ALTER COLUMN fileid SET DEFAULT nextval('file_fileid_seq'::regclass);


SET default_tablespace = '';

--



--
-- Name: file; Type: ACL; Schema: public; Owner: bacula
--

REVOKE ALL ON TABLE file FROM PUBLIC;
REVOKE ALL ON TABLE file FROM bacula;
GRANT ALL ON TABLE file TO bacula;


--
-- Name: file_fileid_seq; Type: ACL; Schema: public; Owner: bacula
--

REVOKE ALL ON SEQUENCE file_fileid_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE file_fileid_seq FROM bacula;
GRANT ALL ON SEQUENCE file_fileid_seq TO bacula;


--
-- PostgreSQL database dump complete
--

--
-- PostgreSQL database dump
--

SET client_encoding = 'SQL_ASCII';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

SET search_path = public, pg_catalog;

DROP INDEX public.file_jobid_idx;
DROP INDEX public.file_fp_idx;
ALTER TABLE ONLY public.file DROP CONSTRAINT file_pkey;
ALTER TABLE public.file ALTER COLUMN fileid DROP DEFAULT;
DROP SEQUENCE public.file_fileid_seq;
DROP TABLE public.file;
SET search_path = public, pg_catalog;

SET default_tablespace = bacula2;

SET default_with_oids = false;



CREATE TABLE file (
    fileid integer NOT NULL,
    fileindex integer DEFAULT 0 NOT NULL,
    jobid integer NOT NULL,
    pathid integer NOT NULL,
    filenameid integer NOT NULL,
    markid integer DEFAULT 0 NOT NULL,
    lstat text  Not NULL,
    md5 text NOT NULL,
    size bigint DEFAULT 0,
    ctime timestamp without time zone,
    mtime timestamp without time zone
) WITH (FILLFACTOR=90)
TABLESPACE bacula2;


ALTER TABLE public.file OWNER TO bacula;

--
-- Name: file_fileid_seq; Type: SEQUENCE; Schema: public; Owner: bacula
--

CREATE SEQUENCE file_fileid_seq
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.file_fileid_seq OWNER TO bacula;

--
-- Name: file_fileid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: bacula
--

ALTER SEQUENCE file_fileid_seq OWNED BY file.fileid;


--
-- Name: fileid; Type: DEFAULT; Schema: public; Owner: bacula
--

ALTER TABLE file ALTER COLUMN fileid SET DEFAULT nextval('file_fileid_seq'::regclass);


SET default_tablespace = '';

--



--
-- Name: file; Type: ACL; Schema: public; Owner: bacula
--

REVOKE ALL ON TABLE file FROM PUBLIC;
REVOKE ALL ON TABLE file FROM bacula;
GRANT ALL ON TABLE file TO bacula;


--
-- Name: file_fileid_seq; Type: ACL; Schema: public; Owner: bacula
--

REVOKE ALL ON SEQUENCE file_fileid_seq FROM PUBLIC;
REVOKE ALL ON SEQUENCE file_fileid_seq FROM bacula;
GRANT ALL ON SEQUENCE file_fileid_seq TO bacula;


--
-- PostgreSQL database dump complete
--


DROP INDEX public.file_jobid_idx;
DROP INDEX public.file_fp_idx;
ALTER TABLE ONLY public.file DROP CONSTRAINT file_pkey;
ALTER TABLE public.file ALTER COLUMN fileid DROP DEFAULT;

SET search_path = public, pg_catalog;

SET default_tablespace = bacula2;


ALTER TABLE ONLY file
    ADD CONSTRAINT file_pkey PRIMARY KEY (fileid);

CREATE INDEX file_fp_idx ON file USING btree (filenameid, pathid);
CREATE INDEX file_jobid_idx ON file USING btree (jobid);
/* nasty program to generate std output that psql can load as a copy
	purpose: to get some estimate of performance

fields are

fileid int
fileindex int
jobid	int
pathid int
filenameid	int
markid	int
md5	text
size	int
ctime	datetime
mtime	datetime

*/
#include <stdio.h>

#define	ROWS 1000000
main () {

long int I;
int row_offset;
	 row_offset=2000000000;

//	printf("COPY file (fileid, fileindex, jobid, pathid, filenameid, markid, lstat, md5, size, mtime,ctime) FROM stdin;\n");
	printf("COPY file (fileid, fileindex, jobid, pathid, filenameid, markid, lstat, md5) FROM stdin;\n");
	for  (I=0; I< ROWS; I++ ) {
	printf("%d\t%d\t%d\t%d\t%d\t%d\t%s\t%s\n",
//	printf("%d\t%d\t%d\t%d\t%d\t%d\t%s\t%s\t%d\t%s\t%s\n",
		I+row_offset,		// fileid
		3, 			//fileindex
		random(), 		//jobid
		random(),		//pathid
		1,			//filenameid
		1,			//markid
		"LSTATDATA",		//LSTAT
		"MD512345678901234"	//md5
//		,0,			//size
//		"2008-09-01T01:02:04",	//ctime
//		"2008-09-01T01:02:05"	//mtime
	);
	}

}
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bacula-devel mailing list
Bacula-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/bacula-devel


This mailing list archive is a service of Copilotco.