Page 22 of 170

Chicago bonfire rules

I believe that more people are hosting more backyard bonfires in Chicago in order to spend time with friends outdoors, because it’s one of the lowest risk ways to still enjoy life during the COVID-19 pandemic that Trump is prolonging.

The City of Chicago has rules on what can be burned. Be sensitive to neighbors who rely in keeping their windows open to cool and ventilate their homes.

The summary version is this: You can burn manufactured firewood that you purchased, and you can burn wood logs from any trees someone manually cut. All logs have to be untreated and two feet long or shorter.

You can’t burn scrap wood, lumber, plywood, or particle board. You also cannot burn garbage. Avoid having bonfires when the wind speed is 15 miles per hour or faster.

Read all the rules in this PDF. The rules aren’t in the municipal code; the code in section 11-4-740 says that the environment commissioner shall make rules (Chicago doesn’t currently have a department of environment).

This is my process to improve the performance of my PostgreSQL database and queries

Every now and then I’ll run the queries below to help me figure out ways to optimize the queries my application is using, and to figure out if certain tables and views (relations) need to be optimized.

Updated January 18, 2020, to add a query to alter the autovacuum and autoanalyze factors on a per table basis because I have a “cache” table that is updated quite frequently and generates many dead tuples every minute. The table would balloon from 250 MB to 15 GB in a few hours. I hope that reducing these factors to just a threshold of 100 dead tuples will prevent the inflation. I also need to monitor this that it doesn’t make my RDS database work too hard.

/* Show the last time at which every table and view was vacuumed and analyzed */
SELECT relname, last_vacuum, last_autovacuum, last_analyze, last_autoanalyze  
FROM pg_stat_all_tables  d_d
WHERE schemaname = 'public';  

/* See which queries are most popular */
SELECT * FROM pg_stat_statements where calls >=1000; /* replace 1000 with any integer, depending on how active your database is queried */
select pg_stat_statements_reset();

/* Kill a specific query */
select pg_terminate_backend(INTEGER); /* replace INTEGER with the process ID of a specific query */

/* Get the size of the database */
select pg_size_pretty(pg_database_size('DATABASE_NAME')); /* replace DATABASE_NAME with the name of your database */

/* Kill queries that are taking too long; replace DATABASE_NAME with the name of your database */
SELECT query, pg_terminate_backend(pid) 
    FROM pg_stat_activity 
    WHERE datname = 'DATABASE_NAME' 
      AND pid <> pg_backend_pid() 
      AND (state = 'active' 
      OR state = 'idle') 
      AND state_change < current_timestamp - INTERVAL '15' MINUTE; /* change 15 to any integer that you think means a query is taking too long */

/* See which queries are running */
select * from pg_stat_activity;
SELECT * FROM pg_stat_activity WHERE wait_event IS NOT NULL AND backend_type = 'client backend';

/* Find very large indexes and indexes that aren't used much */
WITH table_scans as ( 
    SELECT relid, 
        tables.idx_scan + tables.seq_scan as all_scans, 
        ( tables.n_tup_ins + tables.n_tup_upd + tables.n_tup_del ) as writes, 
                pg_relation_size(relid) as table_size 
        FROM pg_stat_user_tables as tables 
),
all_writes as ( 
    SELECT sum(writes) as total_writes 
    FROM table_scans 
),
indexes as ( 
    SELECT idx_stat.relid, idx_stat.indexrelid, 
        idx_stat.schemaname, idx_stat.relname as tablename, 
        idx_stat.indexrelname as indexname, 
        idx_stat.idx_scan,
        pg_relation_size(idx_stat.indexrelid) as index_bytes, 
        indexdef ~* 'USING btree' AS idx_is_btree 
    FROM pg_stat_user_indexes as idx_stat 
        JOIN pg_index 
            USING (indexrelid) 
        JOIN pg_indexes as indexes 
            ON idx_stat.schemaname = indexes.schemaname 
                AND idx_stat.relname = indexes.tablename 
                AND idx_stat.indexrelname = indexes.indexname 
    WHERE pg_index.indisunique = FALSE 
),
index_ratios AS ( 
SELECT schemaname, tablename, indexname, 
    idx_scan, all_scans,
    round(( CASE WHEN all_scans = 0 THEN 0.0::NUMERIC 
        ELSE idx_scan::NUMERIC/all_scans * 100 END),2) as index_scan_pct, 
    writes,
    round((CASE WHEN writes = 0 THEN idx_scan::NUMERIC ELSE idx_scan::NUMERIC/writes END),2) 
        as scans_per_write, 
    pg_size_pretty(index_bytes) as index_size, 
    pg_size_pretty(table_size) as table_size, 
    idx_is_btree, index_bytes
    FROM indexes 
    JOIN table_scans 
    USING (relid) 
),
index_groups AS ( 
SELECT 'Never Used Indexes' as reason, *, 1 as grp 
FROM index_ratios 
WHERE
    idx_scan = 0
    and idx_is_btree 
UNION ALL 
SELECT 'Low Scans, High Writes' as reason, *, 2 as grp 
FROM index_ratios 
WHERE
    scans_per_write <= 1
    and index_scan_pct < 10 
    and idx_scan > 0 
    and writes > 100 
    and idx_is_btree 
UNION ALL 
SELECT 'Seldom Used Large Indexes' as reason, *, 3 as grp 
FROM index_ratios 
WHERE
    index_scan_pct < 5
    and scans_per_write > 1 
    and idx_scan > 0 
    and idx_is_btree 
    and index_bytes > 100000000 
UNION ALL 
SELECT 'High-Write Large Non-Btree' as reason, index_ratios.*, 4 as grp 
FROM index_ratios, all_writes 
WHERE
    ( writes::NUMERIC / ( total_writes + 1 ) ) > 0.02 
    AND NOT idx_is_btree 
    AND index_bytes > 100000000 
ORDER BY grp, index_bytes DESC ) 
SELECT reason, schemaname, tablename, indexname, 
    index_scan_pct, scans_per_write, index_size, table_size
FROM index_groups; 

/* Modify the autovacuum and autoanalyze factors for a single table 
https://klotzandrew.com/blog/posgres-per-table-autovacuum-management */
ALTER TABLE cache SET (autovacuum_analyze_scale_factor = 0, autovacuum_analyze_threshold = 100);

WITH raw_data AS (
  SELECT
    pg_namespace.nspname,
    pg_class.relname,
    pg_class.oid AS relid,
    pg_class.reltuples,
    pg_stat_all_tables.n_dead_tup,
    pg_stat_all_tables.n_mod_since_analyze,
    (SELECT split_part(x, '=', 2) FROM unnest(pg_class.reloptions) q (x) WHERE x ~ '^autovacuum_analyze_scale_factor=' ) as c_analyze_factor,
    (SELECT split_part(x, '=', 2) FROM unnest(pg_class.reloptions) q (x) WHERE x ~ '^autovacuum_analyze_threshold=' ) as c_analyze_threshold,
    (SELECT split_part(x, '=', 2) FROM unnest(pg_class.reloptions) q (x) WHERE x ~ '^autovacuum_vacuum_scale_factor=' ) as c_vacuum_factor,
    (SELECT split_part(x, '=', 2) FROM unnest(pg_class.reloptions) q (x) WHERE x ~ '^autovacuum_vacuum_threshold=' ) as c_vacuum_threshold,
    to_char(pg_stat_all_tables.last_vacuum, 'YYYY-MM-DD HH24:MI:SS') as last_vacuum,
    to_char(pg_stat_all_tables.last_autovacuum, 'YYYY-MM-DD HH24:MI:SS') as last_autovacuum
  FROM
    pg_class
  JOIN pg_namespace ON pg_class.relnamespace = pg_namespace.oid
    LEFT OUTER JOIN pg_stat_all_tables ON pg_class.oid = pg_stat_all_tables.relid
  WHERE
    n_dead_tup IS NOT NULL
    AND nspname NOT IN ('information_schema', 'pg_catalog')
    AND nspname NOT LIKE 'pg_toast%'
    AND pg_class.relkind = 'r'
), data AS (
  SELECT
    *,
    COALESCE(raw_data.c_analyze_factor, current_setting('autovacuum_analyze_scale_factor'))::float8 AS analyze_factor,
    COALESCE(raw_data.c_analyze_threshold, current_setting('autovacuum_analyze_threshold'))::float8 AS analyze_threshold,
    COALESCE(raw_data.c_vacuum_factor, current_setting('autovacuum_vacuum_scale_factor'))::float8 AS vacuum_factor,
    COALESCE(raw_data.c_vacuum_threshold, current_setting('autovacuum_vacuum_threshold'))::float8 AS vacuum_threshold
  FROM raw_data
)
SELECT
  relid,
  nspname,
  relname,
  reltuples,
  n_dead_tup,
  ROUND(reltuples * vacuum_factor + vacuum_threshold) AS v_threshold,
  n_mod_since_analyze,
  ROUND(reltuples * analyze_factor + analyze_threshold) AS a_threshold,
  c_analyze_factor as caf,
  c_analyze_threshold as cat,
  c_vacuum_factor as cvf,
  c_vacuum_threshold as cvt,
  analyze_factor as af,
  analyze_threshold as at,
  vacuum_factor as vf,
  vacuum_threshold as vt,
  last_vacuum,
  last_autovacuum
FROM
  data
ORDER BY n_dead_tup DESC;

My investment in crowdfunded projects hasn’t gone well

A second project that I invested in through the crowdfunding portal, Small Change, has “failed”. It’s a project for a worker-owned bed and breakfast. According to the project owner, the project needed more funds than what they were able to obtain from Small Change investors and other investors. The owner found a new investor, who required that all Small Change investors be removed from the project. They announced that to us earlier this year, and said we would receive our initial investment + 3%.

The Small Change leadership didn’t think this plan was good enough, starting with disagreeing the removal of Small Change investors.

Eventually, the project owner returned our initial investment + 8%. I don’t know if the project owner had the right to cancel and return our investments, but I’m happy to have my money back + 8%.

I’m disappointed in the ultimate outcome of not being able to participate in 1476 Magazine because this is the second project I invested in via Small Change that has not succeeded. The first was for a group of three single-family houses built to a high energy efficiency standard that have not yet sold.

I have an investment in a third project (in Philadelphia) that is converting a disused industrial building into mixed-use with residential and I hope that one succeeds, but I haven’t received an update since it was funded. Update: I inquired and the project owner sent me the update they sent in the last couple of months, which I seemed to have missed.

Golaski Labs in Philadelphia. A Small Change poster advertises the project. The photo was taken in 2018, and significant progress has been made since then.


I believe in the Small Change mission, and crowdfunding broadly, but once I made my third investment I paused so that I could wait to see what happens with all of the projects.

Chicago’s Best Landlords, Inc.

3901 W Jackson Blvd / Chicago’s Best Landlord, Inc.
A 12-flat in West Garfield Park, Chicago.

I’m halfway done reading the book, “Family Properties: How the Struggle Over Race and Real Estate Transformed Chicago and Urban America“, by Beryl Satter, and I’ve started keeping a list of all the places she mentions.

The book is about her father, and the history of racist housing policies and displacement in Chicago’s West Side. Mark Satter, who died of heart problems when he was 49, owned several properties in Lawndale and Garfield Park.

One of them was a 12-flat in West Garfield Park at 3901 W Jackson Blvd, one block west of the eponymous park. Mark died in 1965, and the properties reverted to a trust he had set up, controlled by his wife, Clarice. Mired in debt to contractors and the mortgage, Clarice had family friend, Irving Block, sell the four properties.

3901 W Jackson Blvd eventually became the property of L.J. Epstein, a known slumlord, in 1967. (It’s unclear in the book, and online deed records don’t go that far back, if it was owned by someone else between Clarice selling it and L.J. acquiring it.)

Less than two years later, though, because of L.J.’s neglect of the building, Judge Kral placed it in receivership because of the activism of Ruby Kirk, a Black tenant from Tennessee.

The judge made Ruby the receiver, because the judge perceived that she cared about the building more than the owner. Ruby created a non-profit corporation on Monday, September 22, 1969, called “Chicago’s Best Landlord, Inc.” (It was involuntarily dissolved on February 1, 2003.)

Beryl wrote that during the remodel the corporation’s name was engraved into the stone above the front door. Along with the initials of the tenants at the time. As I was reading it I thought that stone had to still be there, and since I was biking over to Garfield Park for some hot air balloon training with a couple friends, I would stop by.

Ruby was also successful in pressing First National Bank of Chicago to issue a loan to her, a Black woman, when banks refused to lend to Black people as the Federal Housing Administration refused to insure the loans. If you’re from around here, you may remember that First National Bank merged with Banc One to become Bank One, which then became part of Chase. Chase is the second largest loan issuer in Chicago, and still has a “hard time” lending to Black people. It was also then, however, that the federal rules changed and FHA would insure mortgages in Black neighborhoods.

3901 W Jackson Blvd / Chicago’s Best Landlord, Inc.
Enjoy this little piece of Chicago history -> book -> real-life-right-now photo. Ruby Kirk’s initials are in the center.

Chicago’s Best Landlord, Inc. owned the 12-flat from 1969 until 2001, when the U.S. Department of Housing and Urban Development (HUD) foreclosed the property. First National Bank had assigned the mortgage to HUD in 1976.

Peter Gritzanis purchased the property for $270,000, according to the deed recorded on June 28, 2001, at the Cook County Recorder of Deeds office. It looks like Peter stopped owning it in 2012.

Chicago’s Lake Street ‘L’ was originally supposed to be a monorail

I bought a copy of The “L”: The Development of Chicago’s Rapid Transit System, 1888-1932, written by Bruce Moffat, a historian of electric trains in Chicago. Moffat currently works for the Chicago Transit Authority. (If there wasn’t a pandemic, you’d be able to request a hold on one of the 50 copies at the Chicago Public Library.)

The book is about the elevated trains that were built in Chicago, in competition with the street omnibuses (horse drawn), railways (cable cars and streetcars), and suburban trains (okay, some competition), prior to establishing the Chicago Transit Authority. The CTA is a State of Illinois authority, created by the legislature, that today owns and operates all of the historic and since-built elevated, subway, and at-grade ‘L’ transit as well as buses. It acquired all of the assets of all of the ‘L’, streetcar, and bus companies that were operating when it was established in 1945.

On with the story!

Back in December 1888, the Chicago City Council approved a franchise for the Lake Street Elevated Company to build a Meigs Elevated Railway above Lake Street from Canal Street to 40th Avenue (later named Crawford and now Pulaski Road), then the western border of Chicago. A tract of land west of 40th Avenue (Pulaski Road) was incorporated into the City of Chicago four months later on April 29, 1889.

If you go to the intersection of Canal and Lake Streets today you’ll see the Union Pacific railroad tracks above, heading into and out of Ogilvie Transportation Center, a skyscraper at 444 W Lake Street, a cigar store, and a vintage loft office building.

The Meigs Elevated Railway was a steam-powered elevated monorail – meaning each track had one rail to support a train.

You may not know this: I love monorails. When my family visited Walt Disney World my favorite ride was the inter-park and world famous monorail. I’ve also ridden the monorails in Disneyland (but I don’t remember my time there), Las Vegas, Seattle, Düsseldorf airport, Wuppertal, and three in Tokyo, Japan (Chiba City, Shonan, and Haneda airport; I missed the one in Tama).

I used to be obsessed with monorails. I became a member of The Monorail Society when I was a teenager and my first eBay purchase was a Disney monorail motorized toy in March 2000. I was jealous of my friends in elementary school who had a Lego monorail, and now they regularly sell for $200. I also built a SAFEGE-style monorail out of K’NEX in high school.

Drawing of the Meigs Elevated Railway monorail.
A drawing of the Meigs Elevated Railway monorail, originally published in Scientific American, July 10, 1886. Via Wikipedia; also printed in Moffat’s book where it is sourced from Railway Age, a trade journal founded in 1856 that still exists today.

It was invented by Josiah V. Meigs in Cambridge, Massachusetts; a 227-foot long demonstration line was built in 1886 on land that is now a Fairfield Inn hotel and before that was the Genoa Packing Co. (demolished in 2013).

The Meigs Elevated Railway Wikipedia article has two photos of a plaque that was on the exterior wall of the Genoa Packing Co. The new hotel building does not have the same plaque.

The Lake Street Elevated Company organizers (seven incorporators are listed in the book) hired Morris H. Alberger to be the president. According to Moffat’s book, “Alberger had convinced his fellow directors that their railroad should use an experimental and relatively complex elevated railway system developed by Joe V. Meigs”. Alberger was also the president of the Meigs Elevated Railway Company.

Moffat discusses an eighth company organizer: Michael Cassius McDonald, “politically well connected and influential”. He was the “chief sponsor” and “promoter” of the Lake Street elevated proposal which came to be known as “Mike’s Upstairs Railroad”.

The Meigs Electric Railway – the monorail – was never built. Moffat says that the reason the monorail was never built was because it was difficult to promote and raised funds by selling shares.

Almost a year after City Council approved the MER to run over Lake Street, they “deleted the Meigs requirement” in November 1890 so that the Lake Street Elevated Company could build a traditional iron structure. The trains would also be “traditional”. (The first elevated train started running in Manhattan and the Bronx on August 26, 1878 – that was the Third Avenue Elevated – ten years prior to the Meigs monorail being approved in Chicago.)

Even before City Council “deleted” the franchise’s requirement to build a monorail, the Lake Street Elevated Company had already started building the iron structure for a train in December 1889, at Lake and Clinton Streets, where the Clinton Green Line station is now.

That’s the end of the story for the monorail, but I’ll continue talking about the Lake Street ‘L’.

The Lake Street Elevated opens!

Construction had reached “just west of Ashland Avenue” by October 1892, less than three years after the first iron girder was erected at Clinton. A year after that last construction milestone at Ashland, the tracks for service were completed to California Avenue (2800 West).

The Lake Street Elevated Company’s first service was set to begin on October 30, 1893. The opening was delayed, however, until an inauguration on Saturday, November 4, 1893, to mourn the death of Mayor Carter Harrison, who was assassinated during his fifth term. Passenger service began two days later on Monday, November 6, 1893.

Service was extended into the Loop elevated tracks in 1895.

Map of the Lake Street Elevated, from Market Street (now Wacker Drive) to Harlem Avenue and South Boulevard.
Map of the Lake Street Elevated, from Market Street (now Wacker Drive) to Harlem Avenue and South Boulevard.

Heading closer to downtown Chicago

In early 1893, the Lake Street Elevated Company wanted to run their trains down Market Street (now Wacker Drive) from Lake Street to Madison Street.

Photograph showing the elevated stub track on Market Street. The view is looking east along Lake Street at Market Street, where the elevated train would turn south.
Photograph showing the elevated stub track on Market Street. The view is looking east along Lake Street at Market Street, where the elevated train would turn south. Photo taken by a Chicago Daily News, Inc., photographer in 1908. The caption in the Explore Chicago Collections database says,

The Market Street “stub” ran past the future site of the Civic Opera Building, opened in November 1929. Operagoers and workers in the office tower of the building would have ridden the ‘L’ here until the Chicago Transit Authority

The Lake Street Elevated’s Market Street stub terminated at Madison Street. The Civic Opera Building is on the left. Image is from the CTA’s collection. Market Street was renamed Wacker Drive when the street was reconstructed as a double decker street starting in 1948.

Extending further into the Garfield Park neighborhood

Tracks were built six blocks west of California Avenue, to Homan Avenue, but the stations were incomplete. Service to the Homan station started November 24, 1893, and four blocks further west to Hamlin Avenue in January 1894.

The Homan Avenue station no longer exists. Today’s Green Line over Lake Street was rebuilt from 1994 to 1996 and the Homan station was abandoned. According to Chicago “L”.org, the CTA decided to move the station two blocks west to Central Park Drive (3600 West). It was “completely deconstructed in spring of 2000 and put into storage”. It was renovated, made accessible, and opened as the Conservatory-Central Park Drive station in June 2001.

Chicago “L”.org notes that this visitors access to the Garfield Park Conservatory, evens out stop spacing, but does not intersect a bus route which Homan Ave does. The CTA closed Hamlin station on March 18, 1956. I don’t know when it was demolished.

Onward, to Austin and Oak Park!

Back to the Lake Street elevated timeline. Serviced operated to Hamlin Avenue in 1894. The next year it was operating to 52nd Avenue (now Laramie Avenue), the western boundary of Chicago. On the other side of that boundary was the Township of Cicero. Austin, a township neighborhood, was annexed by Chicago in 1899. The Village of Oak Park eventually emerged from the township, incorporating in 1902.

Austin was location of Cicero’s town hall. The town hall building, at the Central and Lake station, is now part of the Austin Town Hall Park and Cultural Center, owned and operated by the Chicago Park District.

Austin Town Hall in Chicago, Illinois
Austin Town Hall, the former town hall of the Township of Cicero. Photo taken in 2019 by Eric Allix Rogers.

Moffat’s book describes a lot of political controversy about extending the Lake Street Elevated into Cicero, which seems fitting for the Chicago region. Passenger service to Austin Avenue (now Boulevard) started April 19, 1899.

The next month, on May 14, 1889, trains that ran east-west above Lake Street came down a ramp – to the surface – onto north-south Lombard Avenue a couple of blocks south to Randolph Street. They turned west onto Randolph Street and continued until Wisconsin Avenue/Marion Street. The tracks on Randolph Street were in the middle of the street, and owned by Suburban Railroad, an interurban railway company.

The tracks were previously owned by Chicago, Harlem & Batavia Railway. I’m including that information because I grew up there. However, the railroad never made it that far: “No effort was made to extend the railroad to that distance place, but money was spent to purchase new locomotives and passenger cars and make other improvements.”

Residents here had the option of taking trains into downtown Chicago on the Chicago & Northwestern Railway. Those tracks are now owned by Union Pacific, which also operates the former C&NW lines as Metra’s UP-West Line. The line terminates at Ogilvie Transportation Center, which used to be called Northwestern Station, which was C&NW’s second location for their downtown terminal.

Moffat discussed these passengers’ choices, writing, “Although a ride on the nearby Chicago & Northwestern was faster, the “L’s” more frequent schedule, convenient Loop stops, and lower fare drew many riders away from the steam railroad”. The same is true today; the ‘L’ costs less than Metra but takes longer to reach the West Loop.

The story about the construction and operation of the Lake Street Elevated is almost done. I’m going to end it as soon as the train reaches the current terminus at Harlem Avenue in Oak Park.

Service to Marion Street started in late January 1901, on the street level of South Boulevard, thus ending service on Randolph Street a few blocks south. Trains started servicing the Harlem station on May 20, 1910. Remember that the reason the trains are now on South Boulevard is because Lake Street runs with a slight northwest diagonal, ends at the Chicago & Northwestern Railway embankment, and resumes a few blocks west. In 1961, the line was elevated onto C&NW’s embankment.

Even though the station is currently called “Harlem/Lake”, the station is at Harlem/South Boulevard, and Lake Street is one block north.


N.B.

Meigs’s railway was mentioned in an op-ed in the Boston Globe Magazine on Sunday, February 23, 1992, as the newspapers’s architecture critic, Robert Campbell, and Peter Vanderwarker, an architectural historian, lamented the towering car infrastructure proposed in the Central Artery/Tunnel Project (also known as “Big Dig”, the most expensive highway construction in the country), as well as the darkening effect of the elevated trains. It’s really quite an essay.

The op-ed in the Boston Globe Magazine, 2/23/1992

But competition was vicious. Arson and vandalism hampered Meigs, as did his insistence on old-fashioned steam power instead of electricity. Nothing besides the Cambridge test line was ever built. The Meigs monorail made its last run in 1894. Conventional elevated trains, modeled on those of Manhattan and far more massive than Meigs’, soon darkened Boston’s streets.

[snipped]

By the end of this decade, the view will have changed radically. A dramatic Babel of steel and concrete, perhaps resembling a great sports stadium, will rise like a gray mountain in the middle distance at the left of the photo. The introverted automobile will have won its long battle for supremacy over the sociable train.

“MEIGS ELEVATED RAILWAY – Changing TRACKS”, By Robert Campbell and Peter Vanderwarker

Meigs Field, a former airport in downtown Chicago that existed between 1948 and 2003, was named after Merrill C. Meigs, a pilot and former head of the Chicago Aero Commission. He believed that Chicago needed a third airport, within 10 minutes of downtown. The airport was built and named after Meigs in 1949. I haven’t found a relationship between the two Meigs.