Reputation
595
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
1 5 18
Impact
~36k people reached

  • 0 posts edited
  • 3 helpful flags
  • 61 votes cast
Aug
14
awarded  Popular Question
Aug
9
comment Optimize query or split in two queries and process result separately?
@AaronBertrand this query will not end on any application, I use to sync two different DB schemas that hold same data. Let's said I use a PHP script that synchronize this schema against Salesforce, then I need to perform a internal sync between this DB schema and the schema I am using on the end user application which has indexes, relations and so on
Aug
9
comment Optimize query or split in two queries and process result separately?
Can you put an example of UNION? I'm not sure how to achieve this using that sentence
Aug
9
comment Optimize query or split in two queries and process result separately?
@AaronBertrand so what is your suggestion? Rely on code? I can do that I am just look for a better way and yes save some time. If you have any better idea than code then let me know and I see if I can apply here (can't join tables at all, can give this a try, but I am not so sure the script that handle DB population will works after create any relationship)
Aug
9
comment Optimize query or split in two queries and process result separately?
@AndriyM I mean there is nothing indexed at all other than PK. Take a look here to account table and you'll see what I am talking about
Aug
9
comment Optimize query or split in two queries and process result separately?
Yes, I just saw the same, there isn't APPLY on MariaDB/MySQL and what you mean with INDEXES? Those tables are very basic so I don't think they have any column indexed if this is what you are asking me
Aug
9
comment Optimize query or split in two queries and process result separately?
@ypercube because I am trying to get the results in just one query, otherwise I will end doing in separate queries and a lot of programmatic on the server side
Aug
9
asked Optimize query or split in two queries and process result separately?
Aug
3
comment Compare values between columns in different tables
@AndriyM no at all, I'm refer to some action that relies on code side, for example: execute a piece of code. I want this act as a COUNT(*) something like IF (RESULT OF SELECT COUNT(*) FROM X > 1 ) THEN { EXECUTE CODE } ELSE { DO NOTHING } (this is just a piece of pseudo-code to show you what I am talking about)
Aug
3
asked Compare values between columns in different tables
Jul
29
awarded  Yearling
Jul
27
awarded  Caucus
Jul
23
reviewed Approve Get rows changed between two dates (latest and previous)
Jul
23
accepted Get rows changed between two dates (latest and previous)
Jul
23
asked Get rows changed between two dates (latest and previous)
Jul
21
comment Which is the right way to fix “Error: 1205 Lock wait timeout exceeded; try restarting transaction”
@jkavalik no, I am not use any of the replication form mentioned above, all happen on the same server but different DB. I am selecting from one and inserting in another one, this is what triggers does
Jul
21
revised Which is the right way to fix “Error: 1205 Lock wait timeout exceeded; try restarting transaction”
added 2 characters in body
Jul
21
revised Which is the right way to fix “Error: 1205 Lock wait timeout exceeded; try restarting transaction”
added 61 characters in body
Jul
20
comment The user specified as a definer ('root'@'%') does not exist
@rolandomysqldba says is better to delete that tables from MySQL and remove those privileges rather than run what you say, which one to follow?
Jul
20
asked Which is the right way to fix “Error: 1205 Lock wait timeout exceeded; try restarting transaction”