but why did it work in localhost not in digitlaocean cluster?
how can i check if he didnt visit in C Stage after this date?
but I want to know that is this query optimized?
it works great right now but wondering if it will slow down after tables have grown?
Maybe anyone know what I do wrong?
So what else I need to check?
And what have you seen?
Anyway, what did you see in postman that you are sure it is deadlock?
Why do you think this is correct?
What soft do you use on backend?
thansk everyone
reverse quota also dont work
SELECT `id, name AS title, (SELECT COUNT(*) FROM lectures WHERE lectures.section_id=sections.id AND lectures.type<>’video’) AS resource_count FROM sections AS sections WHERE sections.course_id = ’76’;`
only single quota was work
SELECT `id, name AS title, (SELECT COUNT(*) FROM lectures WHERE lectures.section_id=sections.id AND lectures.type<>’video’) AS resource_count FROM sections AS sections WHERE sections.course_id = ’76’;`
only single quota was work
I didn’t tell you to reverse quota. I mean replace to single
If you need a string literal, it
should be ‘video’
Hm… I thought double quotes works in Postgre flavor only….
SELECT `id, name AS title, (SELECT COUNT(*) FROM lectures WHERE lectures.section_id=sections.id AND lectures.type<>’video’) AS resource_count FROM sections AS sections WHERE sections.course_id = ’76’;`
only single quota was work
Well, what do you want if you can’t even paste you query without transformations to here?
SELECT `id, name AS title, (SELECT COUNT(*) FROM lectures WHERE lectures.section_id=sections.id AND lectures.type<>’video’) AS resource_count FROM sections AS sections WHERE sections.course_id = ’76’;`
only single quota was work
SELECT
`id`,
`name` AS `title`,
(
SELECT COUNT(*)
FROM `lectures`
WHERE `lectures`.`section_id` = `sections`.`id`
AND `lectures`.`type` <> ‘video’
) AS resource_count
FROM `sections` AS `sections`
WHERE `sections`.`course_id` = 76;
I am newbie. Thats why my querys isnt good so much
I try to optimize. Thanks so much
You must had different settings on those two DB s
They work everywhere
Make users and give permissions of “select” privileges and so on accordingly
I suppose this is about so called row wise security, wich is not supported by most of relational DBMS. This can be done only programmatically, by coding this access rules in each query.
DB-side code objects like views, triggers and stored procedure can help to implement this.
Usually the approach to this task is disabling direct access to the tables at all, allowing access only via views and stored procedures wich enforces the access rules , and disabling direct modification of data in the tables, allowing only modifications via stored procedures wich generate or modify access rules for created or modified rows.
Can someone tell me if clone plug-in in mysql 8 also clones mysql user & db tables? Also if using clone plug-in will be faster compared to mysqldump for database refresh. Total data dir size being 2TB.
need your help,
i’m tring to build 2 queries without success:
i have got 3 tables:
1) clients with ID,NAME
2) plays with playname,playdate,stage
3) tickets with client_id,playname,playdate,seat,cost
i’m trying to find the lowerst ticket that client buy for a show, and show only the name of the show/shows.
so i come up with this:
select plays.playname,min(tickets.cost)
from tickets
inner join plays on plays.playname=tickets.playname and plays.playdate=tickets.playdate
inner join clients on tickets.cid=clients.cid
group by plays.playname;
this one return to be all shows with the must lowest ticket.
but if i have show A with ticket that cost 200
and show B with ticket that cost 100. i want to show only the B Show. but my query show all shows and the must lowest ticket price.
how can i solve it ?
second question :
if i have client that visit in stage A, in date : 12/01/20
how can i check if he didnt visit in C Stage after this date?
i need a list of this client
thanks for the help!
need your help,
i’m tring to build 2 queries without success:
i have got 3 tables:
1) clients with ID,NAME
2) plays with playname,playdate,stage
3) tickets with client_id,playname,playdate,seat,cost
i’m trying to find the lowerst ticket that client buy for a show, and show only the name of the show/shows.
so i come up with this:
select plays.playname,min(tickets.cost)
from tickets
inner join plays on plays.playname=tickets.playname and plays.playdate=tickets.playdate
inner join clients on tickets.cid=clients.cid
group by plays.playname;
this one return to be all shows with the must lowest ticket.
but if i have show A with ticket that cost 200
and show B with ticket that cost 100. i want to show only the B Show. but my query show all shows and the must lowest ticket price.
how can i solve it ?
second question :
if i have client that visit in stage A, in date : 12/01/20
how can i check if he didnt visit in C Stage after this date?
i need a list of this client
thanks for the help!
That’s lowest ticket, what should this mean?
I’m creating a support ticket system and want to count the unread tickets
I’m using two tables: tickets and ticket_comments
here is the query I run to achieve this:
select
count(`tickets`.`id`) as aggregate
from
`tickets`
inner join (
select
`ticket_comments`.`ticket_id`,
MAX(`ticket_comments`.id) as max_id
from
`ticket_comments`
group by
`ticket_comments`.`ticket_id`
order by
NULL
) as `c` on `tickets`.`id` = `c`.`ticket_id`
and `tickets`.`user_read` < `c`.`max_id`
where
`tickets`.`user_id` = ?
the query works as it should.
but I want to know that is this query optimized?
it works great right now but wondering if it will slow down after tables have grown?
I have index on id , user_id , ticket_id (separately) but don’t have index on user_read
user_read is the last ticket comment that user have read so if this value is smaller than the last ticket comment then it’s considered unread
thanks in advance
CREATE TABLE regions (id INT AUTO_INCREMENT UNIQUE, user_id INT NOT NULL, last_check DATE DEFAULT (CURRENT_DATE), FOREIGN KEY (user_id) REFERENCES users(id));error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘(CURRENT_DATE), FOREIGN KEY (user_id) REFERENCES users(id))’ at line
CREATE TABLE regions (id INT AUTO_INCREMENT UNIQUE, user_id INT NOT NULL, last_check DATE DEFAULT (CURRENT_DATE), FOREIGN KEY (user_id) REFERENCES users(id));error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘(CURRENT_DATE), FOREIGN KEY (user_id) REFERENCES users(id))’ at line
CREATE TABLE regions (
id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT NOT NULL,
last_check TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
FOREIGN KEY (user_id) REFERENCES users(id)
);
Didn’t you think about to change your profession?

This is how I have configured. I have read on few blogs that if you allow writing on multiple nodes simultaneously you may get deadblocks. Still having those.
So what else I need to check?
