Alzabo::Index(3pm)
π Alzabo::Index β bestie edition π
okay so real quick, this is the manual page for Alzabo::Index(3pm), part of the User Contributed Perl Documentation situation. it's giving "index objects" and honestly? iconic. let's get into it π¦
β¨ NAME β¨
Alzabo::Index β it's literally the Index objects, that's the whole vibe π
πΈ SYNOPSIS πΈ
here's the lil snippet, no cap, copy it exactly bestie:
foreach my $i ($table->indexes)
{
foreach my $c ($i->columns)
{
print $c->name;
print '(' . $i->prefix($c) . ')' if $i->prefix($c);
}
}
π DESCRIPTION π
so this object represents an index on a table. that's the main character energy right there β¨
an index is made of columns plus optional prefixes for each column. and what's a prefix? okay so it says how many characters of the column should actually be indexed β like, the first X chars. that's it, that's the prefix π
lowkey important caveats tho, listen up:
- some RDBMS's don't even have a concept of index prefixes π
- not all column types are likely to allow prefixes β but tbh this depends on the RDBMS, so it varies π
- and the order of the columns is significant β do not come for the ordering, it matters fr fr
π METHODS π
π§ columns
returns an ordered list of the Alzabo::Column objects that are being indexed. ordered, bestie. the sequence is the whole point π
π
prefix (Alzabo::Column object)
okay so a column prefix is β and this is quoting the source vibes, "to the best of my knowledge" β a MySQL specific concept. which means you cannot set it when you're using an RDBMSRules module for a different RDBMS. periodt.
BUT. it's important enough for MySQL that the functionality is present anyway, so here we are π«Ά
what does it do? it lets you specify that the index should only look at a certain portion of a field β specifically the first N characters. and heads up: this prefix is required to index any sort of BLOB column in MySQL. required. not optional. don't forget it π
this method returns the prefix for the column in the index. if there's no prefix for that column in the index, it returns undef. that's it π
β unique
returns a boolean value telling you whether the index is a unique index. yes or no, slay or not slay β¨
πΈ fulltext
returns a boolean value telling you whether the index is a fulltext index. also boolean. also vibes π
π¦ function
for function indexes, this returns the function being indexed. that's the whole thing π
π₯ id
the id is generated from the table, column and prefix information for the index. which is genuinely useful β think canonical name for a hash key, for example. iykyk π
returns a string that is the id which uniquely identifies the index in this schema. one id, one index, no duplicates, iconic π
π table
returns the Alzabo::Table object to which the index belongs. its home. its origin story. its table π«Ά
π AUTHOR π
Dave Rolsky, <autarch@urth.org> β shoutout to the author, we stan π
and that's the page bestie! this was Alzabo::Index(3pm) as shipped with perl v5.34.0, dated 2022-06-14 πΈ go forth and index responsibly, mwah πβ¨
π¦ where this page comes from
- debian bookworm: libalzabo-perl 0.92-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libalzabo-perl 0.92-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libalzabo-perl 0.92-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libalzabo-perl 0.92-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libalzabo-perl 0.92-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms