Efficient Database Pagination: Comparing Offset and Keyset Strategies
In modern web applications, handling large datasets requires efficient pagination. Developers often face three primary challenges: optimizing query performance for deep pages, ensuring data consistency (preventing "drifting"), and maintaining API simplicity. This article explores the two dominant approaches to database pagination: the ...
Posted on Sun, 19 Jul 2026 17:00:54 +0000 by ThE_eNd
Storing JSON Documents in PostgreSQL Using Java
PostgreSQL JSONB Columns in Java Applications
Database Schema Setup
Create a table with a JSONB column to store semi-structured data:
CREATE TABLE documents (
id SERIAL PRIMARY KEY,
content JSONB NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_documents_content ON documents USING GIN (content);
The GIN ...
Posted on Tue, 07 Jul 2026 17:30:52 +0000 by djdon11
Understanding MogDB vs Kingbase Performance Differences in sysbench Benchmarks
Root Cause Analysis of Performance Variations
A colleague recently shared a comparative analysis between MogDB and KingBase conducted by another technical blogger. The benchmark utilized sysbench for testing, and the results indicated that MogDB underperformed compared to KingBase in most scenarios, with only one test case showing significantly ...
Posted on Wed, 01 Jul 2026 17:51:19 +0000 by hd_webdev
Querying Hierarchical and Related Data with PostgreSQL Self-Joins
A self-join operates by treating a single table as two distinct entitise through table aliasing. This technique proves essential when modeling hierarchical relationships—such as organizational reporting structures—or when comparing records within the same dataset to identify duplicates or related pairs.
The fundamental pattern requires assignin ...
Posted on Wed, 01 Jul 2026 17:41:34 +0000 by thecookie
PostgreSQL's Parser Implementation with Flex and Bison
Understanding PostgreSQL's Parser Architecture
When examining PostgreSQL's source code, one might notice that the conventional Bison parser function yyparse is replaced by base\_yyparse(). This modification is part of PostgreSQL's customized implementation of Flex and Bison for its SQL parsing needs.
The PostgreSQL parser configuration in gram. ...
Posted on Tue, 23 Jun 2026 16:50:25 +0000 by jstarkweather
Practical SQL Patterns for Data Transformation and Performance Tuning
String and Temporal Data Extraction
When extracting partial text or specific date components, standard string and datetime functions provide consistent results across most relational engines. Use SUBSTRING or dialect-specific shortcuts like LEFT to truncate values, and CONCAT_WS to merge fields with a consistent delimiter.
-- Extract first 6 ch ...
Posted on Mon, 22 Jun 2026 16:14:31 +0000 by vivek
Strategies for Reducing Time and Resource Usage During Postgres Large Table Index Rebuilds
Why Rebuilding Indexes Matters
Indexes act as a pointer structure that accelerates data retrieval. Over time, as tables undergo frequent INSERT, UPDATE, and DELETE operations, the underlying index structure can experience bloat or fragmentation. This degradation forces the query planner to scan more pages than necessary, leading to slower respo ...
Posted on Sat, 20 Jun 2026 16:23:07 +0000 by countrydj
PostgreSQL Function Resolution: Handling Ambiguous Candidate Sets
Function candidate resolution in PostgreSQL proceeds through strict filtering and scoring phases. The following configuration demonstrates how the dispatcher handles type coercion, base type mapping, and category matching when resolving overloaded signatures.
Initial Parameter and Signature Configuration
Actual argument OIDs: InputParams = (845 ...
Posted on Mon, 15 Jun 2026 16:53:50 +0000 by d401tq
PostgreSQL Internal Subquery Resolution Process
Query Structure
SELECT val FROM (SELECT val FROM source_table);
Internal Representation
The derived clause FROM (SELECT val FROM source_table) generates a RangeTblEntry for the enclosing query.
The base relation source_table generates a separate RangeTblEntry inside the nested query.
All RangeTblEntry instances form a range table list, linke ...
Posted on Thu, 11 Jun 2026 18:24:16 +0000 by Gump
Greenplum Automatic Partition Management: A Comprehensive Guide
Greenplum 6 provides robust partitioning capabilities that allow for efficient data management. This guide presents an enhanced automatic partitioning solution that supports daily, monthly, and yearly partitioning strategies with dynamic future partition creation.
Partition Management Function
The following function automates partition creatio ...
Posted on Wed, 10 Jun 2026 16:14:27 +0000 by leetee