cloudflare / cloudflare/developer-platform

🐛 BUG: Very wrong metrics reported for row reads after a `execute --file` (3 order of magnitude bigger than expected).

Ouverte
#44 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
product:d1
Langage dominant
Aucune donnée de langage
Étoiles
1
Forks
0
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

### Which Cloudflare product(s) does this pertain to?

D1

### What version(s) of the tool(s) are you using?

3.67.1

### What version of Node are you using?

18.19.0

### What operating system and version are you using?

Linux Manjaro (arch)

### Describe the Bug

### Observed behavior
After an execution of `DELETE` statement from a sql file, the metric returned in the terminal (the same number is in the web dashboard) for rows read was astronomically bigger than it should be:
```sh
npx wrangler d1 execute prods --file $rm_rows_sql --remote
#returns
rows read: 70344030 (web dash display 70.72M)
```
`prods` db has close to 12K rows.
the executed slq file is something like this:
```sql
DELETE FROM products WHERE tid IN (5, 22, 34, 38, 41, 50, 57, 64, 90, 98,..)
```
where the list of values is about 1k integers and `tid` is indexed. The statement was correctly applied and it took only a few seconds.

### Expected behavior
A correct number of rows read, something like:

```sh
sqlite> .read del_not_shared.sql
QUERY PLAN (cycles=113272102 [100%])
`--SEARCH products USING INTEGER PRIMARY KEY (rowid=?) (cycles=26065003 [23%] loops=1 rows=1272)
```

### Steps to reproduce
Please provide the following:
- A minimal working subset of your worker code
- A minimal working subset of your `wrangler.toml`
- Commands used to start your local dev server, including custom env and cli args
- Steps to be performed in the browser, curl commands, or a test we can run that reliably fails (at least a percent of the time)

A git repo we can clone and run a test suite on, or which has a README with step-by-step instructions, is even better. In this case, please use the field below to provide a link to the minimal repro.

### Please provide a link to a minimal reproduction

_No response_

### Please provide any relevant error logs

_No response_

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par la commande signalée `npx wrangler d1 execute ... --file ... --remote` et le fichier SQL DELETE ; comparez sa métrique de lignes lues dans le terminal avec le résultat attendu du plan de requête SQLite. C’est terminé lorsque la commande indique un nombre plausible de lignes lues pour le DELETE indexé, correspondant au comportement attendu décrit dans l’issue.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
node.js, sql, sqlite
Domaine
cli, databases
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.