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) Bye > bacula=# SELECT MAX('a'||bacula_lstat_mtime(lstat)) FROM file WHERE > fileid<1000000 ; > 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' + > timestamptz 'epoch') FROM file WHERE fileid<1000000 ; > max > ------------------------ > 2008-02-27 20:24:10-05 > (1 row) > > Time: 762.390 ms > > Otherwise, the PL/perl function does the same thing; thanks for the > pointer! > > ebollengier wrote: > > You can also use the bweb pure PL function for that (see > > bweb/scripts/bweb-postgresql.sql). > > > > DavidLeeLambert wrote: > >> I was looking into making queries for a particular file in a Bacula > >> Postgres database, and came up with the attached functions. [...] ------------------------------------------------------------------------------ _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users