CREATE INDEX molidx ON pgmol (m);
SET enable_indexscan=off;
SET enable_bitmapscan=off;
SET enable_seqscan=on;
SELECT * FROM pgmol WHERE 
	m = 'Clc1nccnc1NN=Cc1ccc(Br)cc1';
   id    |             m              
---------+----------------------------
 2842150 | Clc1nccnc1NN=Cc1ccc(Br)cc1
(1 row)

SELECT count(*) FROM pgmol WHERE 
	m < 'C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O';
 count 
-------
   258
(1 row)

SELECT count(*) FROM pgmol WHERE 
	m <= 'C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O';
 count 
-------
   258
(1 row)

SELECT count(*) FROM pgmol WHERE 
	m = 'C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O';
 count 
-------
     0
(1 row)

SELECT count(*) FROM pgmol WHERE 
	m >= 'C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O';
 count 
-------
   742
(1 row)

SELECT count(*) FROM pgmol WHERE 
	m > 'C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O';
 count 
-------
   742
(1 row)

SET enable_indexscan=on;
SET enable_bitmapscan=on;
SET enable_seqscan=off;
SELECT * FROM pgmol WHERE 
	m = 'Clc1nccnc1NN=Cc1ccc(Br)cc1';
   id    |             m              
---------+----------------------------
 2842150 | Clc1nccnc1NN=Cc1ccc(Br)cc1
(1 row)

SELECT count(*) FROM pgmol WHERE 
	m < 'C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O';
 count 
-------
   258
(1 row)

SELECT count(*) FROM pgmol WHERE 
	m <= 'C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O';
 count 
-------
   258
(1 row)

SELECT count(*) FROM pgmol WHERE 
	m = 'C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O';
 count 
-------
     0
(1 row)

SELECT count(*) FROM pgmol WHERE 
	m >= 'C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O';
 count 
-------
   742
(1 row)

SELECT count(*) FROM pgmol WHERE 
	m > 'C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O';
 count 
-------
   742
(1 row)

SET enable_indexscan=on;
SET enable_bitmapscan=on;
SET enable_seqscan=on;
DROP INDEX molidx;
CREATE INDEX fpidx ON pgbfp (f);
SET enable_indexscan=off;
SET enable_bitmapscan=off;
SET enable_seqscan=on;
SELECT * FROM pgbfp WHERE 
	f = rdkit_fp('C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O'::mol);
 id | f | maccsf 
----+---+--------
(0 rows)

SELECT count(*) FROM pgbfp WHERE 
	f < rdkit_fp('C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O'::mol);
 count 
-------
    31
(1 row)

SELECT count(*) FROM pgbfp WHERE 
	f <= rdkit_fp('C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O'::mol);
 count 
-------
    31
(1 row)

SELECT count(*) FROM pgbfp WHERE 
	f = rdkit_fp('C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O'::mol);
 count 
-------
     0
(1 row)

SELECT count(*) FROM pgbfp WHERE 
	f >= rdkit_fp('C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O'::mol);
 count 
-------
   969
(1 row)

SELECT count(*) FROM pgbfp WHERE 
	f > rdkit_fp('C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O'::mol);
 count 
-------
   969
(1 row)

SET enable_indexscan=on;
SET enable_bitmapscan=on;
SET enable_seqscan=off;
SELECT * FROM pgbfp WHERE 
	f = rdkit_fp('C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O'::mol);
 id | f | maccsf 
----+---+--------
(0 rows)

SELECT count(*) FROM pgbfp WHERE 
	f < rdkit_fp('C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O'::mol);
 count 
-------
    31
(1 row)

SELECT count(*) FROM pgbfp WHERE 
	f <= rdkit_fp('C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O'::mol);
 count 
-------
    31
(1 row)

SELECT count(*) FROM pgbfp WHERE 
	f = rdkit_fp('C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O'::mol);
 count 
-------
     0
(1 row)

SELECT count(*) FROM pgbfp WHERE 
	f >= rdkit_fp('C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O'::mol);
 count 
-------
   969
(1 row)

SELECT count(*) FROM pgbfp WHERE 
	f > rdkit_fp('C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O'::mol);
 count 
-------
   969
(1 row)

SET enable_indexscan=on;
SET enable_bitmapscan=on;
SET enable_seqscan=on;
DROP INDEX fpidx;
CREATE INDEX fpidx ON pgsfp (f);
SET enable_indexscan=off;
SET enable_bitmapscan=off;
SET enable_seqscan=on;
SELECT * FROM pgsfp WHERE 
	f = morgan_fp('C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O'::mol, 1);
 id | f 
----+---
(0 rows)

SELECT count(*) FROM pgsfp WHERE 
	f < morgan_fp('C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O'::mol, 1);
 count 
-------
    55
(1 row)

SELECT count(*) FROM pgsfp WHERE 
	f <= morgan_fp('C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O'::mol, 1);
 count 
-------
    55
(1 row)

SELECT count(*) FROM pgsfp WHERE 
	f = morgan_fp('C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O'::mol, 1);
 count 
-------
     0
(1 row)

SELECT count(*) FROM pgsfp WHERE 
	f >= morgan_fp('C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O'::mol, 1);
 count 
-------
   945
(1 row)

SELECT count(*) FROM pgsfp WHERE 
	f > morgan_fp('C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O'::mol, 1);
 count 
-------
   945
(1 row)

SET enable_indexscan=on;
SET enable_bitmapscan=on;
SET enable_seqscan=off;
SELECT * FROM pgsfp WHERE 
	f = morgan_fp('C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O'::mol, 1);
 id | f 
----+---
(0 rows)

SELECT count(*) FROM pgsfp WHERE 
	f < morgan_fp('C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O'::mol, 1);
 count 
-------
    55
(1 row)

SELECT count(*) FROM pgsfp WHERE 
	f <= morgan_fp('C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O'::mol, 1);
 count 
-------
    55
(1 row)

SELECT count(*) FROM pgsfp WHERE 
	f = morgan_fp('C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O'::mol, 1);
 count 
-------
     0
(1 row)

SELECT count(*) FROM pgsfp WHERE 
	f >= morgan_fp('C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O'::mol, 1);
 count 
-------
   945
(1 row)

SELECT count(*) FROM pgsfp WHERE 
	f > morgan_fp('C1C(OC2=CC(=CC(=C2C1=O)O)O)C3=CC(=C(C=C3)O)O'::mol, 1);
 count 
-------
   945
(1 row)

SET enable_indexscan=on;
SET enable_bitmapscan=on;
SET enable_seqscan=on;
DROP INDEX fpidx;
