jakob / jakob/Postico

Filters should not default to "contains"

Open
#824 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
485
Forks
8
PR merge metrics
No merged PRs in 30d

Description

Just tossing in an issue for something that has bugged me for a while about Postico (and actually other SQL tools that I've used as well): the table filters default to selecting "contains" for any string column. This results in a "LIKE" query, which will do a full table scan even, I believe, on an indexed column. On a large table, that is painful... and often not what I wanted anyway.

The dbs I work in a lot have mostly UUID primary keys so I am constantly copying the id from one table and pasting it into a filter for another table. If I space out changing that "contains" filter selection to "is exactly" I am often kicking off a very long query... sometimes minutes. The Postico UI does allow me to change the filter and fire off the corrected query without waiting for the bad one to complete, but I assume that my db server is still left chewing on the unintended long query... especially when I was just trying to load a specific record by its id.

It could even be a preference setting to say "any column name that ends in _id is treated as a discrete value and defaults to 'is exactly' for filtering". But really, why default to "contains" at all? I feel like, in my day-to-day work, I am mostly querying where a column equals a given value and only occasionally.

Would it be possible to (either by default or via a preference setting) make "is exactly" the default selection for filtering by a string column so that it works the same as other types (which default to "=")? Thanks!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named in the issue. Start by locating the table-filter UI and the logic that selects operators for string columns, then trace how that choice becomes a SQL query. Done means string filters default to “is exactly,” or the requested preference behavior is clearly implemented and verified without triggering the unintended broad query.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sql
Domain
database, desktop
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.