Skip to content

Postgres wont use the proper index

I have the following table: id : id dim_id : fk day : date value : int With the following indexes: id : BTREE dim_id : BTREE dim_id, day : BTREE day, value …

Using two sets of conditions in where clause

I’m trying to get the count of items in my table where it should satisfy these conditions status = active type = Pre-order date = $date_input OR status = active type = Both date = $date_input I’m …