Hi,

I've just been running explain analyze on a slow query and came across
something new to me - a node type of ProjectSet in the plan. What is that?

The plan is here: https://explain.depesz.com/s/4rqA

The query does a cross join of two tables to get every row in one combined
with every row in the other, then runs the similarity function to compare
text in them. The full query is below, apologies for the different
obfuscation to the plan, if that's an issue let me know.

Is there an explanation of ProjectSet anywhere? I can't see one with a
quick google or search of these archives.

Cheers
Oliver

---

SELECT table1.id,
    similarity(table2.field1::text, regexp_matches(table1.field3::text,
'product.ame:s*([^-]*)'::text, 'g'::text)::character
varying(100000)::text)::double precision AS similarityscore,
    table1.ourid_g3a11eruac8ct55b,
    regexp_matches(table1.field3::text, 'product.ame:s*([^-]*)'::text,
'g'::text)::character varying(100000) AS products,
    table2.field1,
    table2.field2,
    table2.abaccount
   FROM table1,
    table2
  WHERE lower(table2.statusofingredient::text) < '6'::text AND
lower(table2.statusofproduct::text) < '5'::text AND table1.fsacreated >=
(date_trunc('day'::text, now()) - '30 days'::interval) AND
lower(table2.bought::text) = 'bought'::text
  ORDER BY table1.id DESC NULLS LAST;

Reply via email to