This pattern works if you have an SQL View that does the query you want (and then you may still filter it, as you see fit).
FunkyBot joined the channel
fikka joined the channel
ihor
schinckel: nice! It is looks nice
schinckel
You can even use that sort of stuff with recursive CTEs.
deramius has quit
geetar joined the channel
ihor
I need to check how indexes works with views and how to update views for big table
schinckel
It uses the indexes on the original tables: views are calculated live.
mattmcc
Views are essentially stored queries. Materialized views, though, can have their own.
schinckel
Yeah, that.
mattmcc
Which has pros & cons. Updates to large materialized views may be more expensive than if you'd used a plain view and updated its constituent tables for example.
We use a materialized view for products so that (among other reasons) all the FTS related indexing that pulls from a dozen tables happens in one place.
geetar joined the channel
fikka has quit
ihor
> building materialized view with FTS
Does it have any cons over separated FTS solution?
sorry advantages
mattmcc
It just depends on your needs. Our FTS needs are met quite adequately by PG's own FTS support, so we use that rather than maintain, say, an Elasticsearch stack.
rpkilby joined the channel
ihor has quit
geetar joined the channel
mightyspaj joined the channel
fikka joined the channel
rpkilby has quit
fikka has quit
limbera joined the channel
limbera
my application has organizations and members, and i'm writing an API in which the organization payload contains a list of it's members, and the members endpoint contains a reference to the organization (that links a User with the Organization)
i'm wondering if that's bad design, it has some code smell because the serializers i am using are referencing each other
epopt has quit
timkofu joined the channel
the MemberSerializer is in the same file as the OrganizationSerializer and they both need to reference each other
i guess my question is, should i be remodelling my payloads and the way the front end consumes this data to not do this? or is there something i'm missing
fikka joined the channel
mcspud
limbera you're alive
This is a great thing
limbera
hey mate
hah yes i am
mcspud
limbera - its not bad design, especially if you are implementing a strict HATEOAS pattern
But typically you'll have "reduced" serialisers for the nested resources
limbera
i am doing so
and i am doing that too
how are you mate?
mcspud
Great!
You?
PM
limbera
how do i handle the OrgSerializer trying to serialize the MemberSerializer