[redland-dev] Adding indexes to the postgres store

Richard Dale richard.j.dale at gmail.com
Thu Jul 12 18:02:16 BST 2007


I've been trying out the Redland postgres store with data from the
activerdf sioc browser project. I noticed that when the table to hold
the Statements is created it didn't have any indexes, and so queries
were slow with much table scanning.

I added SQL debug logging like the MySql store has, and created
indexes for the Statements table like this:

"CREATE INDEX c_idx ON %s USING btree (Context)",
"CREATE INDEX sp_idx ON %s USING btree (Subject,Predicate)",
"CREATE INDEX po_idx ON %s USING btree (Predicate,Object)",

Where %s is the name of the particular Statements table.

Please find the changes in the attached patch. Is this a good idea, do
people add indexes manually to their triple stores, or do they find
performance is fine without them?

-- Richard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rdf_storage_postgresql_indexes.patch
Type: text/x-diff
Size: 9823 bytes
Desc: not available
Url : http://lists.usefulinc.com/pipermail/redland-dev/attachments/20070712=
/15138848/rdf_storage_postgresql_indexes.bin


More information about the redland-dev mailing list