PHP Classes

File: SQL File

Recommend this page to a friend!
  Packages of Matthew Asham   Binkterm PHP   database/migrations/v1.6.5_add_echomail_date_received_index.sql   Download  
File: database/migrations/v1.6.5_add_echomail_date_received_index.sql
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Binkterm PHP
Bulletin board system based on the Web
Author: By
Last change:
Date: 2 months ago
Size: 766 bytes
 

Contents

Class file image Download
-- Migration: Add index on echomail date_received for efficient maintenance operations -- Version: 1.6.5 -- Date: 2026-01-08 -- -- This index significantly improves performance of the echomail_maintenance.php script -- when deleting messages by count, as it needs to ORDER BY date_received -- Add composite index for efficient querying and sorting by date_received CREATE INDEX IF NOT EXISTS idx_echomail_date_received ON echomail(echoarea_id, date_received); -- The composite index (echoarea_id, date_received) allows PostgreSQL to: -- 1. Quickly filter messages by echoarea_id -- 2. Sort by date_received without a separate sort operation -- 3. Use index-only scans for count operations -- This is critical for the deleteByCount operation in maintenance scripts