The following patch is meant to force PostgreSQL (including v7.0) to *not*
try and use the index on a LIKE query.  There is an overestimation of the
speed of doing a LIKE search in PostgreSQL that values doing it before
doing an equality one ... end result on my current search is that a search
has to process ~60k*5million records, vs 11k*60k records to find the
results ... slightly slower :)

Only been tested manually so far, but is going in full bore in 5 minutes
or so to test it u nder load ...

*** sql.c       Tue Apr 11 19:18:22 2000
--- sql2.c      Fri Apr 14 11:59:09 2000
***************
*** 1710,1716 ****
  __INDLIB__ int AddURLLimit(char *URL){
        if(*urlstr)strcpy(UDM_STREND(urlstr)-1," OR ");
        else    strcat(urlstr," AND (");
!       sprintf(UDM_STREND(urlstr),"url.url LIKE '%s')",URL);
        return(0);
  }
  __INDLIB__ int ClearLimits(){
--- 1710,1716 ----
  __INDLIB__ int AddURLLimit(char *URL){
        if(*urlstr)strcpy(UDM_STREND(urlstr)-1," OR ");
        else    strcat(urlstr," AND (");
!       sprintf(UDM_STREND(urlstr),"(url.url || '') LIKE '%s')",URL);
        return(0);
  }
  __INDLIB__ int ClearLimits(){


Marc G. Fournier                   ICQ#7615664               IRC Nick: Scrappy
Systems Administrator @ hub.org 
primary: [EMAIL PROTECTED]           secondary: scrappy@{freebsd|postgresql}.org 

______________
If you want to unsubscribe send "unsubscribe udmsearch"
to [EMAIL PROTECTED]

Reply via email to