PostgreSQL La base de donnees la plus sophistiquee au monde.

Forums PostgreSQL.fr

Le forum officiel de la communauté francophone de PostgreSQL

Vous n'êtes pas identifié(e).

#1 Optimisation » postgreSql optimisation query » 11/11/2022 18:55:23

ccoupez
Réponses : 1

I have a postgreSql data base.

In this database i have two tables with the same Foreignkey (who is User)

so i have a table A (list of all user) and a table B (list of user i follow)

and i would like to filter the table A and also add a new colomn who tell me if the user is in the table B or not.

For the moment i do this in multiple task :

    first i get the filter list of user in the table A
    second i get the filter list of user in the table B
    third i parse the table A and for each user i check if it is present or not in the table B

My question is : can i do this more efficiently ?? in one query for exemple ?

I hope i am clear enough

thank you in advance for your answer

I try to optimise my code If someone have an idea I'm all ears

Pied de page des forums

Propulsé par FluxBB