With your data as such
P-C
1-3
3-6
6-4
2-8
8-7
MySQL will find 5 records and assuming that it chooses to return them in this order (it could return them in the order of the prices of items 1, 3, 6, 2 and 8 on the menu in the Oracle canteen today):-
The first record is 1, and it will store 3 (ie, the child) in the variable pv. It will then get the next record. This is record 3 and it will see if that is stored in pv and finding it, 6 will be concatenated onto the end of pv. It will then get the next record (6 in this case), check if 6 is stored in pv and as it is concatenate 4 onto the end of pv. It will then get the next record (2 in this case), check if 2 is stored in pv but as it isn't it will ignore it. It will then get the next record (8 in this case), check if 8 is stored in pv but as it isn't it will ignore it.
It will continue to process every single record on the table whether you want them or not. It will not use any indexes to do any of these checks, or to stop processing until it gets to the end of all the records.
MySQL (and relational databases in general) are designed to get sets of data, and work well for comparing one set with another set. The above query is getting a single set of data (potentially hideously large) and going through every returned record in a random order (which you hope is the order you entered them in) checking each one against a variable it is building up.