Le Friday 19 December 2008 20:15:37 David Lee Lambert, vous avez écrit :
> The advantage of a "C" stored procedure is speed:
Yes, for sure but it's also a bit more complex to install...
To speedup things (for reading), it's also possible to create an index (i will
add the IMMUTABLE parameter)
B
The advantage of a "C" stored procedure is speed:
bacula=# SELECT MAX('a'||bacula_lstat_mtime(lstat)) FROM file WHERE
fileid<100 ;
max
-
a2008-02-27 20:24:10-05
(1 row)
Time: 70.689 ms
bacula=# SELECT MAX(base64_decode_lstat(12,lstat)*interval '1 second'
Hello,
You can also use the bweb pure PL function for that (see
bweb/scripts/bweb-postgresql.sql).
Bye
DavidLeeLambert wrote:
>
> 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
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