Is the Post Correspondence Problem with more than two rows harder than the standard two-row variant?

The standard Post Correspondence Problem concerns tiles with two rows of symbols, and whether a tile arrangement can be made so that the sequence of the top symbols of the tiles is equal to the bottom one.

Let $ \text{n-PCP}, \text{n} > 0$ a generalization of the Post Correspondence Problem where the tiles contain $ \text{n}$ rows, and the sequences of the symbols have to be equal for all of these rows.

Obviously $ \text{1-PCP}$ is decidable (in fact it’s trivial because the answer to the problem is always true). $ \text{2-PCP}$ is the standard PCP.

But what if $ \text{n} > 2$ ? Is it harder or can it be reduced to the standard PCP (like >3-SAT being reduced to 3-SAT)?

Recommendations about deleting large set of rows in MSSQL

I need to delete about 75+ million rows from a table everyday that contains around 3.5 billions of record.

Database recovery mode is simple, I have writen a code that deletes 15.000 rows in a while condition until all 75M records is deleted. (i use batch delete due to log file grow) However, with current deletion speed it looks like it will take at least 5 days, which means that amount of data required to be deleted is multiply faster than my deletion speed.

Basically what i’m trying to do is summarizing (in another table) and deleting data older than 2 months. There is no update operation in that table, only insert and delete.

I have an enterprise edition of MSSQL 2017

Any suggestions will be welcome.

Delete rows or columns of matrix containing invalid elements, such that a maximum number of valid elements is kept

Originally posted in stack-overflow but was told to post here.

Context: I am doing a PCA on a MxN (N >> M) matrix with some invalid values located in the matrix. I cannot infer these values, so I need to remove all of them, which means I need to delete the whole corresponding row or column. Of course I want to keep the maximum amount of data. The invalid entries represent ~30% of data, but most of it is completly fill in a few lines, few of it is scattered in the rest of the matrix.

Some possible approches:

  • Similar to this problem , where I format my matrix such that valid data entries are equal to 1 and invalid entries to a huge negative number. However, all proposed solutions are of exponential complexity and my problem is simpler.

  • Computing the ratio (invalid data / valid data) for each row or column, and deleting the highest ratio(s). Recompute the ratios for the sub-matrix and remove the highest(s) ratios. (not sure how many lines or columns we can remove safely in one step), and so on until there is no invalid data left. It seems like an okay solution, but I am unsure it always gives the optimal solution.

My guess is that it is a standard data analysis problem, but surprisingly I could not find a solution online.

Too many rows on wordpress wp_options table

On one of my sites I saw that in wp_options table there are more than a hundred thousand rows after a while they all start similar to something like: _wp_session_ _wp_session_expires_ and it mosty sas things like “you must anable payment gateways to use digital downloads” etc….

it looks like someone inserted this bad content into my database.

Question 1) Is it ok if I just delete these rows or it will harm something? Question 2) How can I prevent someone inserting things into my database again? and my password was strong anyway Question 3) what were they doing with my database? I didnt notice anything visible on my site

my most importnat question at this point is question 1

What settings to use to export mysql table rows that I’ll be importing to another table with data using phpmyadmin

If I’m using phpmyadmin to manage mysql database, what settings should I use to export only two rows of data that I’ll be importing to another table with the same name that contains many other rows?

I used the quick option, but I’m getting an error that table already exists and nothing gets imported.

If I use the default custom option with the default settings, I get the same error message.

So, what’s the best settings to use to export settings that I’m going to import to another table?

Mysql, Getting all rows in which field ends in a specific character, and another field exists that is the same but doesn’t end in that character

I need to get all rows which end in a specific character, P for example, but in which a similar key sans the P exists. I have no idea how to approach this one in MySQL.

This is very small example, my actual data is huge with other columns also.

+------------+ |    key     | +------------+ | value_100  | | value_100P | | value_101  | | value_101  | | value_102  | | value_102P | | value_103P | | value_104P | +------------+ 

The query would output,

+------------+ |    key     | +------------+ | value_100P | | value_102P | +------------+ 

how to get rows with more than 1 appearance of a specific column in relational algebra

I have a table like this:

PostId   |    Body    |    AuthorId    2             b               F   2             b               E   4             d               A   4             d               E   8             h               F  

So what I want is to get all the rows that have more that 1 appearance of PostId. Here the result would be 2 and 4 because they appear more than 1 time. I want this in relational algebra.
I have already a relation that works just fine but in this relation I use aggregation methods and I don’t really what to use count in my relation. I am wondering if there is a way to this with subtraction or division operators?
What I do for now is π PostId (σ c ≥ 2 ( γ Body; COUNT(PostId)->c R2)) to get the row with more than 1 appearance of PostId.
Thanks in advance for help

Finding all rows of 2 variables using Gaussian Elimination

Suppose I have a system of linear equations. Using Gaussian elimination, I can determine whether a solution exists, and even find a valid solution.

During the elimination, I can combine rows together, to produce new rows with different number of variables. Is there a method to find all possible rows that contain exactly 2 variables? For example, I may want to find all equalities between variables. This is equivalent to finding all rows that contain exactly 2 variables. Is it possible to do this without trying all (exponentially many) combinations of rows?

For example if I have:

Row 1: A xor B xor C = 1

Row 2: A xor B xor D = 1

I can combine row 1 and row 2 to say that C xor D = 0

If I have a large amount of rows, and they require large combinations of large rows to produce smaller rows, is it trivial or hard to find all rows of size 2? Can I do better than adding random pairs to the system and checking it still has a solution?

Select rows of a matrix in which entires in a column contain particular text


For the matrix above, I want to select all those rows in which the first column contains the text “ave” (i.e. rows 4 and 6). To get those columns containing “two_ave”…

Select[data, #[[1]] == two_ave &]

…obviously works. I was hoping replacing the “two’ with a wildcard might get the job done, but I can’t seem to get it to work. I’ve had a good search around but can’t find the answer. Can anybody help?