[ic] slow one click search

Chen Naor interchange-users@icdevgroup.org
Sun Jun 15 04:07:01 2003


> > Hi,
> > IC 4.9.7
> > PostgreSQL 7.2.3
>
> > select t1.* from products t1, merchandising t2 where t1.sku=t2.sku and
> > t1.category like '%[sql-param code]%' and t2.featured like '%second%'
> > and t1.inactive='0' LIMIT 4
>
> Have you done an 'EXPLAIN' on the sql query? I know you said you ran it
> against the DB but getting the execution plan and cost can be really
> helpful. The next step is to see what is exactly is getting sent to the db
> and how it relates to what you think is going on. Interchange will
> sometimes do a 'SELECT * FROM products' and do the search criteria in
> code.
>
> So turn on postgresql's debugging and get a log file.
> in your postgresql.conf:
>
>
> You'll get a logfile of all the query's that are executed. Check what's
> really being executed.
>
>>
> HTH
> Christian

Hi again,

After debugging the queries I found that IC produce a massive query procedure that include 3384
SELECT instead of 1.

The question is: Is it possible to pass a complicate query with one click search (like in the
[query] tag)?
Or: What are the parameters to pass to a one click search to make this query more efficient?

Regards,

Chen