'fixed' slow sql warnings with postgres...

This commit is contained in:
BroodjeAap 2023-01-22 10:48:08 +00:00
parent 05802c6ef4
commit a5f6e2f6b1
2 changed files with 3 additions and 11 deletions

View file

@ -125,6 +125,8 @@ For example, if you want to set up GoWatch with Browserless, Apprise and a Postg
## Database
By default, GoWatch will use an SQLite database, stored in the `/config` directory for the docker image.
If you have only a few watches with schedules of a few minutes+ then SQLite is probably fine.
But with more watches, especially with shorter schedules, Gorm will start logging warnings about `SLOW SQL`, which are just warnings, but at that point it's probably better to switch to another database.
You can use another database by changing the `database.dsn` value in the config or `GOWATCH_DATABASE_DSN` environment variable, for example with a PostgreSQL database:
```

12
todo.md
View file

@ -4,14 +4,4 @@
- scraping.go
- util.go
- edit.ts
- diagram.ts
- SLOW SQL
- SELECT * FROM `filter_connections` WHERE watch_id = 1
- SELECT * FROM `watches` WHERE `watches`.`id` = 7 ORDER BY `watches`.`id` LIMIT 1
- SELECT * FROM `filters` WHERE watch_id = 1
- INSERT INTO `filter_outputs` (`watch_id`,`name`,`value`,`time`) VALUES (7,"Caption","D","2023-01-│>
20 14:20:25.454") RETURNING `id`
- NIL: SELECT * FROM `filter_connections` WHERE watch_id = 1
- /app/main.go:374 ERROR: column "filter_outputs.value" must appear in the GROUP BY clause or be used in an aggregate function (SQL│ </body>
STATE 42803)
- diagram.ts