suppose i have a set of conditions i want to find all rows which satisfy all those condition in postgresql in fastest way possible [closed]

The table is user table with userId and various fields like balance, age, username etc

conditions are like

  • queries with <,>,<=,>=,=
  • queries having range operator
  • queries with IN,NOT IN

for example:

  • users with balance > 5000
  • users with age in range [20,30]
  • users with username in [‘abc’,’def’]

there will be a array of such queries and i want to find all those rows which satisfies all these conditions

I will be having a table with billion of rows so want to do this efficiently.

NOTE : Didnt find close reason appropriate , question asks a single requirement how to filter rows from a table using multiple conditions , that’s it.

  • There just isn’t anywhere near enough information to provide an answer. What queries? What table? What indexes are on that table? What joins? (& that list goes on).

    – 

  • Have edited with more details

    – 

  • 1

    sorry but your question is too broad and vague (still)

    – 

Leave a Comment