build-indexes.py

text/plain

Filename: build-indexes.py
Type: text/plain
Part: 0
Message: Re: [PATCH] Incremental sort (was: PoC: Partial sort)
#!/usr/bin/python

import itertools

columns = ['a', 'b', 'c', 'd', 'e', 'f', 'g'];

indexes = []

for cols in itertools.permutations(columns):

	indexes.append(cols)

	for l in range(1,len(cols)):

		indexes.append(cols[:l])

indexes = set(indexes)

for idx in indexes:

	if len(idx) < 4:

		print 'create index on t (' , (','.join(idx)) , ');'