Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@aschreyer
Last active December 12, 2015 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aschreyer/4754908 to your computer and use it in GitHub Desktop.
Save aschreyer/4754908 to your computer and use it in GitHub Desktop.
PostgreSQL OpenEye cartridge benchmark based on ChEMBL15.
-- set search_path = public, openeye;
DO $$
DECLARE
molregno integer;
fp oefp;
BEGIN
FOR molregno, fp IN SELECT cfp.molregno, cfp.circular_fp
FROM chembl.compound_oefps cfp
ORDER BY random() LIMIT 100
LOOP
EXECUTE
'
SELECT molregno, circular_fp % $1
FROM chembl.compound_oefps
WHERE circular_fp %? $1
ORDER BY circular_fp <%> $1
LIMIT 10;
' USING fp;
END LOOP;
END$$;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment