Re: How to speed up product code and subcode match

From: Andrus <kobruleht2(at)hot(dot)ee>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Bzm(at)g" <bzm(at)2bz(dot)de>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to speed up product code and subcode match
Date: 2023-05-23 14:26:12
Message-ID: 21737d42-c902-92f1-2f95-8013abca1531@hot.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi!

> Separate
> the product code and size into two columns --- if there's somebody
> who really wants to see them in the above format, give them a
> view or generated column. Then instead of the impossible-to-optimize
> queries you showed, you could do something like
>
> select toode.toode , n2, n3, n4
> from toode, vordlusajuhinnak
> where toode.toode = vordlusajuhinnak.toode;
>
Can function index

create index on toode ( *split_part( toode, '/',1) *)

and query

select toode.toode , n2, n3, n4

from toode, vordlusajuhinnak

where *split_part( toode.toode, '/',1) *= vordlusajuhinnak.toode;

used and keeping existing table structure? Functional index should
produce same speed improvement as using separate column?

Andrus.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Ross 2023-05-23 14:38:53 Re: 15 pg_upgrade with -j
Previous Message Tom Lane 2023-05-23 14:00:25 Re: How to speed up product code and subcode match