Improve the gin index scan performance in pg_trgm.
Improve the gin index scan performance in pg_trgm.

Previous coding assumes too pessimistic upper bound of similarity
in consistent method of GIN.

Author: Fornaroli Christophe with comments by me.

xinzweb/gpdb,lisakowen/gpdb,50wu/gpdb,ashwinstar/gpdb,xinzweb/gpdb,adam8157/gpdb,xinzweb/gpdb,greenplum-db/gpdb,50wu/gpdb,greenplum-db/gpdb,xinzweb/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,jmcatamney/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,ashwinstar/gpdb,50wu/gpdb,greenplum-db/gpdb,xinzweb/gpdb,50wu/gpdb,adam8157/gpdb,lisakowen/gpdb,lisakowen/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,adam8157/gpdb,adam8157/gpdb,50wu/gpdb,lisakowen/gpdb,jmcatamney/gpdb,jmcatamney/gpdb,adam8157/gpdb,greenplum-db/gpdb,lisakowen/gpdb,lisakowen/gpdb,greenplum-db/gpdb,xinzweb/gpdb,ashwinstar/gpdb,50wu/gpdb,xinzweb/gpdb,50wu/gpdb,ashwinstar/gpdb,adam8157/gpdb,adam8157/gpdb,xinzweb/gpdb,adam8157/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,50wu/gpdb,lisakowen/gpdb,lisakowen/gpdb