243 points · by samsk · 6y ago · 30 comments
Then just pass user-entered queries through websearch_to_tsquery() and have access to multiple search capabilities easily. It supports searching for alternatives with "or", phrases in quotes, and excluding terms with a minus sign, which is all syntax that a lot of people are already used to. For example it can handle a query like:
blizzard or overwatch -"hong kong"
That would find anything with "blizzard" or "overwatch" in it, but exclude anything with "hong kong" (if you wanted to avoid results about that recent controversy).It's really useful, and makes it so that you can add reasonable search functionality with almost no work at all.
That said, (and only because your example reminded me) I absolutely hate the NLP `or` operator. I feel like any language to offer an `or` operator needs to require the simultaneous usage of a grouping operator (parentheses, etc.) to clarify the order of operations. A space is an implicit `and` so I never know if the `or` is working on directly adjacent keywords or the query as a whole.
Check it out here: https://www.postgresql.org/docs/12/progress-reporting.html
I have had several cases where query performance dropped significantly (unfortunately in managed AWS Aurora DB, so I have limited inspection abilities).
Index rebuilds is the solution but it locks the entire table.
You can get a concurrent rebuild by creating a new index concurrently, then transactionally drop the old one and rename the new one. It's error prone though.
Wonderful! (Now I only have to wait 12 months for AWS Aurora to upgrade.)
actually you can't since you can't create/drop indexes concurrently inside a transaction.
btw. my #1 request would be a better materialized view (which supports indexes) and also makes the performane of some stuff really better. unfortunatly you can't refresh it without a full seq scan. it would be great if postgres would have an auto updating materialized view.
> it would be great if postgres would have an auto updating materialized view.
100%. Check out Incremental View Maintainence https://wiki.postgresql.org/wiki/Incremental_View_Maintenanc...
There's been some work done on it, but it's a pretty difficult problem. If/when it comes to PostgreSQL it'll come for only very simple queries.
I’m a little sad though to see yet another JSON location mini-language appear. We’ve got JSONPointer (IETF standard for the web, used by jsonschema), JSONPath, the more expressive but cross language JMESPath, the CLI favorite jq, and presumably a billion more. It’s wearing me out.
Edit: and topically, free for the weekend! https://twitter.com/MarkusWinand/status/1199982940471607297
The basic book would pretty much just cover "select * from table". Everything beyond that, for instance "select * from table limit 10", is implementation-specific...
(I'm not even exaggerating: https://en.wikibooks.org/wiki/SQL_Dialects_Reference/Select_... )
Thanks!