[mirrorbrain-commits] r8007 - /trunk/sql/schema-postgresql.sql

From: <poeml_at_mirrorbrain.org>
Date: Wed, 17 Mar 2010 00:50:14 -0000
Author: poeml
Date: Wed Mar 17 01:50:13 2010
New Revision: 8007

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=8007&view=rev
Log:
The best way to get data fromof PostgreSQL which is stored binary is
hex-encoded. Add notes explaining this design decision.

Modified:
    trunk/sql/schema-postgresql.sql

Modified: trunk/sql/schema-postgresql.sql
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/sql/schema-postgresql.sql?rev=8007&r1=8006&r2=8007&view=diff
==============================================================================
--- trunk/sql/schema-postgresql.sql (original)
+++ trunk/sql/schema-postgresql.sql Wed Mar 17 01:50:13 2010
_at_@ -36,6 +36,14 @@
 
 -- For conveniency, this view provides the binary columns from the "hash" table
 -- also encoded in hex
+--
+-- Note on binary data (bytea) column.
+-- PostgreSQL escapes binary (bytea) data on output. But hex encoding is more
+-- efficient (it results in shorter strings, and thus less data to transfer
+-- over the wire, and it's also faster). The escape format doesn't make sense
+-- for a new application (which we are).
+-- On the other hand, storage in bytea is as compact as it can be, which is good.
+-- The hex encoding function in PostgreSQL seems to be fast.
 CREATE VIEW hexhash AS 
   SELECT file_id, mtime, size, 
          md5,




_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Wed Mar 17 2010 - 00:50:16 GMT

This archive was generated by hypermail 2.3.0 : Mon Feb 20 2012 - 23:47:04 GMT