Bacula-users

[Bacula-users] Postgres functions for interpreting the bacula "LStat" column

2008-12-09 22:28:14
Subject: [Bacula-users] Postgres functions for interpreting the bacula "LStat" column
From: "David Lee Lambert" <davidl AT lmert DOT com>
To: <bacula-users AT lists.sourceforge DOT net>
Date: Tue, 9 Dec 2008 22:26:07 -0500
I was looking into making queries for a particular file in a Bacula Postgres database,  and came up with the attached functions.  If someone really wanted to do searches by other attributes, it would be simple to follow the same pattern.  With the functions and functional indexes, a query like
 
SELECT bacula_lstat_mtime(lstat),path.path,filename.name
FROM file
INNER JOIN path ON file.pathid=path.pathid \
INNER JOIN filename ON file.filenameid=filename.filenameid
WHERE bacula_lstat_mtime(lstat)<'2009-12-05 13:55'
ORDER BY bacula_lstat_mtime(lstat) DESC LIMIT 15
 
is really fast.
 
--
DLL

Attachment: pgbacula.sql
Description: Binary data

Attachment: Makefile
Description: Binary data

Attachment: pgbacula.c
Description: Binary data

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.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>