# NPlusOneFinding

> Potential N+1 query group sharing one captured call-site fingerprint.

[API reference](/docs/api/index.md) › [Debug Core](/docs/extensions/debug-core/reference/index.md) › [Panel](/docs/extensions/debug-core/reference/panel/index.md) › [Db](/docs/extensions/debug-core/reference/panel/db/index.md) › NPlusOneFinding

| final readonly class | `PHPForge\Debug\Panel\Db\NPlusOneFinding` |
| --- | --- |
| Source | [`src/Panel/Db/NPlusOneFinding.php`](https://github.com/php-forge/debug-core/blob/main/src/Panel/Db/NPlusOneFinding.php#L10) |

Potential N+1 query group sharing one captured call-site fingerprint.

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-count"></span>`$count` readonly constructor | `positive-int` | Number of observed query occurrences. | `NPlusOneFinding` |
| <span id="property-fingerprint"></span>`$fingerprint` readonly constructor | `non-empty-string` | Stable backtrace fingerprint. | `NPlusOneFinding` |
| <span id="property-firstSequence"></span>`$firstSequence` readonly constructor | `int` | First query sequence used as the deep-link target. | `NPlusOneFinding` |
| <span id="property-representativeQuery"></span>`$representativeQuery` readonly constructor | `string` | Statement shown as the sample of the group. | `NPlusOneFinding` |
| <span id="property-sequences"></span>`$sequences` readonly constructor | `list<int>` | Query sequences belonging to the group. | `NPlusOneFinding` |
| <span id="property-totalDuration"></span>`$totalDuration` readonly constructor | `float` | Total group duration in milliseconds. | `NPlusOneFinding` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Creates a potential N+1 query finding. | `NPlusOneFinding` |
| [`id()`](#method-id) | Returns the stable DOM id the queries grid deep-links the group with. | `NPlusOneFinding` |

## Method details

### __construct() <span id="method-__construct"></span>

```php
public function __construct(non-empty-string $fingerprint, positive-int $count, float $totalDuration, int $firstSequence, list<int> $sequences, string $representativeQuery)
```

Creates a potential N+1 query finding.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$fingerprint` | `non-empty-string` | Stable backtrace fingerprint. |
| `$count` | `positive-int` | Number of observed query occurrences. |
| `$totalDuration` | `float` | Total group duration in milliseconds. |
| `$firstSequence` | `int` | First query sequence used as the deep-link target. |
| `$sequences` | `list<int>` | Query sequences belonging to the group. |
| `$representativeQuery` | `string` | Statement shown as the sample of the group. |

### id() <span id="method-id"></span>

```php
public function id(): string
```

Returns the stable DOM id the queries grid deep-links the group with.

**Returns**

`string`: DOM id derived from the first query sequence of the group.