Skip to content

D1: What's the better practice for querying the row COUNT of my table? #24647

@Bylx666

Description

@Bylx666

Proposed changes

What I learned at class is to SELECT seq FROM sqlite_sequence or COUNT(*).

However I got no such table: sqlite_sequence: SQLITE_ERROR, and worried about the performance of using COUNT.

Is there a better way?

Subject Matter

Better practices to count rows for your table with D1.

Content Location

https://developers.cloudflare.com/d1/best-practices/query-d1/

Additional information

I get great impression about Workers. Thanks for every worker's patience.

Metadata

Metadata

Labels

content:newRequest for new/missing contentdocumentationDocumentation editsproduct:d1D1: https://developers.cloudflare.com/d1/

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions