Skip to content

Proposal for New Ghost Feature Integration #1514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
BarShauli555 opened this issue Mar 18, 2025 · 0 comments
Open

Proposal for New Ghost Feature Integration #1514

BarShauli555 opened this issue Mar 18, 2025 · 0 comments

Comments

@BarShauli555
Copy link

Hi Team,

How are you?

I'm Bar from the Wix DBA team. A year ago, I added a new ghost feature to our private GitHub repository, and we would like to contribute it to this entire project.

Our main goal is to safely delete data and rebuild the table using ghost. We can implement this in two ways:

  1. When changing the DDL of this table
  2. When we want to delete old data using the ALTER command: ENGINE=InnoDB

I have added a new PR for this feature, and the code is currently running in our production environment and testing.

The PR includes:
A new WHERE clause statement, defaulting to 1=1. Here’s an example of filter operations:

Comparison operators: “<, >, =, !=”

  1. data_created > year('2020')
  2. id >= 100
  3. status IN ('done') # Please use a maximum of 5 values for IN; otherwise, use a temp table.

Sub-select from a temp table:

  1. id IN (SELECT id FROM temp_id) - Preferred for primary keys; otherwise, it’s a heavy process.
  2. varchar_column IN (SELECT varchar_column FROM varchar_temp_table)

Adding the receiving condition to the SQL builder mechanism that filters in the data according to our additional statement in the WHERE clause.

Adding tests.

Please note: This deletion only occurs from the chunk size; if any DML is inserted during the ghost operation and is written to the binlog, it will stop the entire run.

Thank you for your attention. I look forward to your feedback!

Best regards,
Bar

Let me know what you are thinking :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant